Greetings all..
        It seems that there may be a small socket implementation issue
with freebsd 4-Stable.  I have been in disscussion with a few people from
the isc bind 9 bug tracking department, and it seems that for the macro
CMSG_NXTHDR to function in freebsd , the macro ALIGN must be 
defined.  With both freebsd 3.4 as well as 4 that is defined in
machine/param.h, but it seems that there is an include trail in releng 3
which makes that header eventually be included.  I havent traced the
include path yet, but I know that bind 9 compiles on freebsd 3 but not
4.  The solution as I saw it (probably wrong ;) is to include either
sys/param.h (which includes machine/param.h) or to include machine/param.h
directly in the header which seems dependant on it which is sys/socket.h
Below is some of the conversation with the developers for bind 9.  I don't
claim to know the repercussions of including either one in socket.h so go
easy ;) just trying to get bind 9 to compile...   ISC as decided to
include sys/param.h in the bind 9 betas, but they would prefer if we
"fixed" the includes because freebsd seems to be the only os with this

Thanks for all of the wonderful work everybody!


Damieon Stark
Sr. Unix Systems Administrator

- M$ Win 2K was built for the internet. |
- Unix _BUILT_ the internet.            |   FreeBSD - The POWER to serve
        your call...                    |

---------- Forwarded message ----------
Date: Mon,  1 May 2000 11:12:27 -0700 (PDT)
From: Michael Graff via RT <[EMAIL PROTECTED]>
Subject: [ISC-Bugs #102] (bind9) Compiling bind 9 b2 on freebsd 4.0-STABLE

> grep ALIGN lib/isc/unix/*.c

> grep ALIGN /usr/include/sys/socket.h 
            (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))

That line is from the CMSG_NXTHDR() macro, which is how ipv6 options are
set, among other things.

If the socket.h file needs it (which it clearly does) it should arrange to
have it included.

>From "man socket" on FreeBSD, it indicates that:

     #include <sys/types.h>
     #include <sys/socket.h>

is enough.

There is no man page for CMSG_NXTHDR.

In any case, FreeBSD needs the ALIGN() macro for socket.h's compiliction if
the CMSG_NXTHDR() macro is used.  Other OSs include whatever files are

We have added inclusion of <sys/param.h> for now, but once FreeBSD fixes
their files we'll remove that, as it really isn't needed by anything
other than FreeBSD.


Visigoth via RT <[EMAIL PROTECTED]> writes:

> On Sat, 29 Apr 2000, Michael Graff via RT wrote:
> > (David C Lawrence) via RT <[EMAIL PROTECTED]> writes:
> > 
> > > I concur with Michael that it is a FreeBSD problem.  A header file
> > > should not depend on another header file having been included; any
> > > functionality that the file provides that depends on another file in
> > > order to work means the other file should be included.
> > 
> > Not only that, but including a <machine/*.h> file should never, ever,
> > happen from a portable program.
>       I couldn't agree with you more, which is why my patch included
> sys/param.h which in turn includes machine/param.h.  
> > 
> > I believe we do include <sys/param.h> which I was told would fix some
> > of this, but really, FreeBSD's socket.h should include that if it
> > depends on things in it.
>       as of bind9 beta 2 does not include sys/param.h in
> lib/isc/unix/socket.c, and I would disagree that defining ALIGN is not
> necissary for a proper socket implementation.  freebsd's own sys/socket.h
> doesn't require support for ALIGN, only your (wonderful new) code does.  I
> don't mean to turn this into a large issue, but to my (and a few
> others) best understanding your socket.c should include sys/param.h.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to