Red Hat Bugzilla – Bug 212612
dhcp won't compile with RHEL4 gcc
Last modified: 2007-11-30 17:11:46 EST
dcantrell: Thank you *very* much for cleaning up the mess in dhcp.
Here's a simple patch that works around an arcane compilation problem
with gcc shipped in RHEL4. All the patch does is rearrange a generated
include to define an enum before using in a typedef and prototypes.
The better fix would be to generate the file correctly, as there's another identical
patch I'm about to post against dhcpv6, exactly the same issue.
If you're *really* energetic, the gcc problem should be fixed as well ;-)
No problem. I had to make the source RPM more manageable. The previous
maintainer was a bit sloppy with patches and history and didn't care about
making use of CVS and tags.
Anyways, where is the patch?
I'll go ahead and fix up dhcp and dhcpv6 as well since I own both of those.
I've sent the patch privately, otherwise fish the patch out of
which I just built. The spec file application is a bit wonky
since the patch has to be applied after the file is generated.
Sent it privately to what address?
Hehe, yours: <firstname.lastname@example.org>
Patch also copied to
and eixstence at that URI verified.
Same patch to libdhcp as well.
I've copied patches and *.src.rpm's for all of the above to http://wraptastic.org/pub/jbj,
but its all exatly the same rearrangement.
Note that libdhcpv6 "compiles", but installs the boogered file, so libdhcp build fails later.
I've built new dhcp and libdhcp packages that fix these issues. They are in
The dhcpv6 package needs the same patch as dhcp. The failure
comes when linking libdhcp from including
libdhcp has other issues, needs a modern <sys/queue.h> as
well as modern <linux/netlink.h> and <linux/rtnetlink.h>
There are copies of the changes I'm making to compile with
RHEL4/CentOS4 at http://wraptastic.org/pub/jbj
There's also mkinitrd fiddles there to compile. I'll know in
the next day or two whether "functional" and then will
attempt better than slamming a private copy of queue.h et al
Meanwhile, the same dhcp patch is also needed in dhcpv6.
libdhcp uses <sys/queue.h>. dhcpv6 has a static copy of an old BSD queue.h, but
I've removed that and have it using the glibc queue.h.
Both libdhcp and dhcpv6 include the netlink headers in /usr/include. There are
no static copies.
Using <sys/queue.h> creates instant legacy, as the queue.h from RHLE4 glibc
is not updated. Including private "new" queue.h is one solution, rewriting the
code to not depend on silly BSD macros is another.
I'll send you a patch to internalize the macros from <sys/queue.h> so
that the "old" vs "new" issue disappears if you want. Otherwise, slamming
a later queue.h into libdhcp and mkinitrd is an efficient solution, just pugly.
netlink.h and rtnetlink.h are trickier. In my case I'm building for 2.6.18 and
cannot change the development environment. So I include netlink.h from
rtnetlink.h from 2.6.18. Perfectly understood why that is a crazy thing to do.
Thanks for dhcpv6 fixing.
I'm not a fan of carrying forward archaic BSD code. Using the glibc-provided
queue.h seemed fine to me, but I'm not opposed to rewriting the code to not use
the BSD stuff.
I would much prefer a rewrite than to drop a later queue.h in the code. Send
patches on over for other ways to fix this problem.
Regarding the netlink.h and rtnetlink.h...I'm going to say that's a side effect
of your development environment requirements. I don't want to drop specific
versions of those in to the source since they are provided on the target build
system anyway. But I think you understand that.
Thanks for the help.
Perfectly understood. I ain't happy carrying around private copies of include files either.
I'll drop you a patch to rewrite dhcp* without including <sys/queue.h>
down the road a bit. I gotta figger mkinitrd functionality first.
Thanks for fixing, less code I have to maintain.
Wotta bloody mess dhcp code is, sigh. Its amazing that so much depends
on this ugly rotten code base.