From owner-freebsd-current Mon May 1 12:41: 7 2000 Delivered-To: freebsd-current@freebsd.org Received: from shell.telemere.net (shell.telemere.net [63.224.9.3]) by hub.freebsd.org (Postfix) with ESMTP id C27A137BB86 for ; Mon, 1 May 2000 12:40:53 -0700 (PDT) (envelope-from visigoth@telemere.net) Received: by shell.telemere.net (Postfix, from userid 1001) id D595970601; Mon, 1 May 2000 14:38:21 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by shell.telemere.net (Postfix) with ESMTP id D1D1F6C801 for ; Mon, 1 May 2000 14:38:21 -0500 (CDT) Date: Mon, 1 May 2000 14:38:21 -0500 (CDT) From: Visigoth To: current@freebsd.org Subject: Header includes and defines in freebsd 4-Stable [ISC-Bugs#102] (bind9) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 issue... Thanks for all of the wonderful work everybody! Visigoth Damieon Stark Sr. Unix Systems Administrator visigoth@telemere.net ____________________________________________________________________________ | - M$ Win 2K was built for the internet. | - Unix _BUILT_ the internet. | FreeBSD - The POWER to serve | http://www.freebsd.org your call... | | ---------------------------------------------------------------------------- ---------- Forwarded message ---------- Date: Mon, 1 May 2000 11:12:27 -0700 (PDT) From: Michael Graff via RT To: visigoth@telemere.net Subject: [ISC-Bugs #102] (bind9) Compiling bind 9 b2 on freebsd 4.0-STABLE > grep ALIGN lib/isc/unix/*.c [nothing] > 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: SYNOPSIS #include #include 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 necessary. We have added inclusion of for now, but once FreeBSD fixes their files we'll remove that, as it really isn't needed by anything other than FreeBSD. --Michael Visigoth via RT writes: > On Sat, 29 Apr 2000, Michael Graff via RT wrote: > > > (David C Lawrence) via RT 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 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 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message