[quagga-dev 1093] Re: point-to-point patch

Andrew J. Schorr aschorr at telemetry-investments.com
Wed Apr 28 18:42:00 BST 2004


On Wed, Apr 28, 2004 at 12:45:01PM -0400, Greg Troxel wrote:
> I'm happy to defer to Paul.  I find INADDR_ANY to be a sensible way to
> go also.  We shouldn't assume the current code is well-though out or
> intrinsically correct, either...

I guess it's pretty obvious that I prefer the NULL pointer approach.

Just to try out the alternative, I made the following test patch
to zebra/interface.c:connected_dump_vty():

--- ./zebra/interface.c.test	2004-03-18 10:40:33.000000000 -0500
+++ ./zebra/interface.c	2004-04-28 13:32:36.000000000 -0400
@@ -413,7 +413,15 @@
 
   /* If there is destination address, print it. */
   p = connected->destination;
-  if (p)
+  /* only IPV4 and IPV6 address families are currently supported by
+     the prefix_vty_out() display function (since it calls inet_ntop) */
+  if ((p->family == AF_INET) ? (p->u.prefix4.s_addr != INADDR_ANY) :
+#ifdef HAVE_IPV6
+      ((p->family == AF_INET6) && IPV6_ADDR_CMP(&p->u.prefix6,&in6addr_any))
+#else
+      0
+#endif
+     )
     {
       if (p->family == AF_INET)
 	if (ifp->flags & IFF_BROADCAST)

Is that what you guys are proposing?  I guess we could package that
test in a macro, but it does raise the question of whether address
families other than AF_INET and AF_INET6 are or will be supported...

-Andy



More information about the Quagga-dev mailing list