[Xorp-hackers] Query regarding IPv6 code

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Wed Mar 5 21:28:45 PST 2008


Jonathan Day <imipak at yahoo.com> wrote:

> I've been trying to compile XORP on a box that doesn't
> have IPv6 enabled. So, naturally, I told configure to
> disable IPv6.

When you say that the box doesn't have IPv6 enabled, do you mean
that the OS has IPv6 support, but it has been explicitly disabled
(e.g., by recompiling the kernel), or do you mean that it lacks even
the system IPv6 header files (e.g., /usr/include/netinet6/*).

If it lacks the header files, then "configure" should be smart
enough to automatically exclude IPv6.
You should see something like the following when running
"configure":

checking whether the system has IPv6 stack... no


> Turns out that there's a number of places where there
> are unguarded uses of IPv6 defines and types. These
> crash when compiling on a system that doesn't have
> these defined, for obvious reasons.

If you see compilation errors because of missing IPv6-related stuff,
then this is a bug. Please create a Bugzilla entry with the output
from ./configure and the compilation.

> Now, the two questions I'd like to throw out there
> are:
> 
> 1) Is this just my box, or is this repeatable?

What OS are you using?
Those days it is difficult to find an OS that doesn't have IPv6, so
we don't have the chance to test that the compliation actually
succeeds on IPv4-only boxes.

> 2) If it is repeatable, is it better to fix this by
> placing guards (#ifdef) around the IPv6 code, -or- by
> having a set of dummy IPv6 headers?

Depends on the situation. Majority of the protocols use the help
of "class IPv4, "class IPv6", "class IPvX", but sometimes we use
"#ifdef HAVE_IPV6 ... #endif" guards. The "#ifdef HAVE_IPV6" guard
is typically used only in the FEA.
Usage of IPv6-specific headers or structures might be guarded by
"#ifdef HAVE_FOO" where "HAVE_FOO" is tested/defined by "configure".

Thanks,
Pavlin

> (If the IPv6 functions are all going to fall out in
> the wash, dummy headers would mean fewer changes to
> mainline code, which means less risk of introducing
> bugs and fewer preprocessor commands. On the other
> hand, guarding is closer to being what you actually
> want.)
> 
> Jonathan
> 
> 
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> 
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list