]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2004-07-23 Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
authorpaul <paul>
Fri, 23 Jul 2004 15:26:14 +0000 (15:26 +0000)
committerpaul <paul>
Fri, 23 Jul 2004 15:26:14 +0000 (15:26 +0000)
        * if_ioctl_solaris.c: HAVE_IPV6 ifdef fixups
        * zserv.c: ditto
        * ioctl_solaris.c: ditto.
        * interface.c: cast for LLADDR
        * interface.h: Add guards, include redistribute.h and remove
          extraneous definitions of zebra_interface_{up,down}_update
        * ioctl.h: Add AF_IOCTL define for non SOLARIS_IPV6
        * redistribute.h: include dependent header, zserv.h
        * zserv.h: include dependent header, rib.h

zebra/ChangeLog
zebra/if_ioctl_solaris.c
zebra/interface.c
zebra/interface.h
zebra/ioctl.h
zebra/ioctl_solaris.c
zebra/redistribute.h
zebra/zserv.h

index b121b4484cfdc4368dfda67df8161e38ad5b9ea2..718de62591f1261427e2d343cb17b227c3b36f08 100644 (file)
@@ -1,3 +1,15 @@
+2004-07-23 Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
+
+        * if_ioctl_solaris.c: HAVE_IPV6 ifdef fixups
+        * zserv.c: ditto
+        * ioctl_solaris.c: ditto.
+        * interface.c: cast for LLADDR
+        * interface.h: Add guards, include redistribute.h and remove
+          extraneous definitions of zebra_interface_{up,down}_update
+        * ioctl.h: Add AF_IOCTL define for non SOLARIS_IPV6
+        * redistribute.h: include dependent header, zserv.h
+        * zserv.h: include dependent header, rib.h
+
 2004-07-23 Paul Jakma <paul@dishone.st>
 
        * irdp_main.c: use setsockopt_pktinfo_ipv4
index 9441abed844762affb3c901291bd5feade61e0fc..c05883c66c5302e6dec3c7c6616952d79f275ce8 100644 (file)
@@ -137,11 +137,22 @@ calculate_lifc_len:     /* must hold privileges to enter here */
   for (n = 0; n < lifconf.lifc_len; n += sizeof (struct lifreq))
     {
       ifp = if_get_by_name (lifreq->lifr_name);
+
       if (lifreq->lifr_addr.ss_family == AF_INET)
         ifp->flags |= IFF_IPV4;
+
       if (lifreq->lifr_addr.ss_family == AF_INET6)
-        ifp->flags |= IFF_IPV6;
+        {
+#ifdef HAVE_IPV6
+          ifp->flags |= IFF_IPV6;
+#else
+          lifreq++;
+          continue;
+#endif /* HAVE_IPV6 */
+        }
+        
       if_add_update (ifp);
+
       interface_info_ioctl (ifp);
       if_get_addr (ifp, (struct sockaddr *) &lifreq->lifr_addr);
       lifreq++;
@@ -265,7 +276,8 @@ if_get_addr (struct interface *ifp, struct sockaddr *addr)
           dest_pnt = (char *) &SIN (&dest)->sin_addr;
         }
     }
-  else
+#ifdef HAVE_IPV6
+  else if (af == AF_INET6)
     {
       if (ifp->flags & IFF_POINTOPOINT)
         {
@@ -285,15 +297,17 @@ if_get_addr (struct interface *ifp, struct sockaddr *addr)
             }
         }
     }
-
+#endif /* HAVE_IPV6 */
 
   /* Set address to the interface. */
   if (af == AF_INET)
     connected_add_ipv4 (ifp, 0, &SIN (addr)->sin_addr, prefixlen,
                         (struct in_addr *) dest_pnt, NULL);
-  else
+#ifdef HAVE_IPV6
+  else if (af == AF_INET6)
     connected_add_ipv6 (ifp, &SIN6 (addr)->sin6_addr, prefixlen,
                         (struct in6_addr *) dest_pnt);
+#endif /* HAVE_IPV6 */
 
   return 0;
 }
@@ -319,6 +333,7 @@ interface_list ()
 struct connected *
 if_lookup_linklocal (struct interface *ifp)
 {
+#ifdef HAVE_IPV6
   listnode node;
   struct connected *ifc;
 
@@ -333,5 +348,7 @@ if_lookup_linklocal (struct interface *ifp)
           (IN6_IS_ADDR_LINKLOCAL (&ifc->address->u.prefix6)))
         return ifc;
     }
+#endif /* HAVE_IPV6 */
+
   return NULL;
 }
index 3a7a5919ac05f7029649919961c232cfbae63f25..bf84a6984adfb2d2d5a27f77d4be825bd598e40f 100644 (file)
@@ -543,8 +543,8 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
       u_char *ptr;
 
       vty_out (vty, "  HWaddr: ");
-      for (i = 0, ptr = LLADDR (sdl); i < sdl->sdl_alen; i++, ptr++)
-       vty_out (vty, "%s%02x", i == 0 ? "" : ":", *ptr);
+      for (i = 0, ptr = (u_char *)LLADDR (sdl); i < sdl->sdl_alen; i++, ptr++)
+        vty_out (vty, "%s%02x", i == 0 ? "" : ":", *ptr);
       vty_out (vty, "%s", VTY_NEWLINE);
     }
 #else
index c1f9f71c470d341109821ff243fb7d3fcd528448..88049b40d952cb76ebf47393a437ca2d8bb40e74 100644 (file)
  * 02111-1307, USA.  
  */
 
+#ifndef _ZEBRA_INTERFACE_H
+#define _ZEBRA_INTERFACE_H
+
+#include "redistribute.h"
+
 #ifdef HAVE_IRDP
 #include "zebra/irdp.h"
 #endif
@@ -169,8 +174,6 @@ void if_add_update (struct interface *ifp);
 void if_up (struct interface *);
 void if_down (struct interface *);
 void if_refresh (struct interface *);
-void zebra_interface_up_update (struct interface *ifp);
-void zebra_interface_down_update (struct interface *ifp);
 
 #ifdef HAVE_PROC_NET_DEV
 int ifstat_update_proc ();
@@ -189,3 +192,5 @@ int ifaddr_proc_ipv6 ();
 #ifdef BSDI
 int if_kvm_get_mtu (struct interface *);
 #endif /* BSDI */
+
+#endif /* _ZEBRA_INTERFACE_H */
index eadc69a0131d1179a3dbcb7880210a4410cd607c..a82c3125e0604fbd5d5a41a6261c8795c4485b2b 100644 (file)
@@ -49,6 +49,10 @@ struct connected *if_lookup_linklocal( struct interface *);
 #define AF_IOCTL(af, request, buffer) \
         ((af) == AF_INET? if_ioctl(request, buffer) : \
                           if_ioctl_ipv6(request, buffer))
+#else /* SOLARIS_IPV6 */
+
+#define AF_IOCTL(af, request, buffer)  if_ioctl(request, buffer)
+
 #endif /* SOLARIS_IPV6 */
 
 #endif /* _ZEBRA_IOCTL_H */
index 805a9ca0eeacbd9f067233dea9c3c43cf686eabb..7b4dde36400865a4b90d0df20b966db5d12f648e 100644 (file)
@@ -80,10 +80,11 @@ if_ioctl (u_long request, caddr_t buffer)
   return 0;
 }
 
-#ifdef HAVE_IPV6
+
 int
 if_ioctl_ipv6 (u_long request, caddr_t buffer)
 {
+#ifdef HAVE_IPV6
   int sock;
   int ret = 0;
   int err = 0;
@@ -116,9 +117,10 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer)
       errno = err;
       return ret;
     }
+#endif /* HAVE_IPV6 */
+
   return 0;
 }
-#endif /* HAVE_IPV6 */
 
 /*
  * get interface metric
@@ -134,8 +136,10 @@ if_get_metric (struct interface *ifp)
 
   if (ifp->flags & IFF_IPV4)
     ret = AF_IOCTL (AF_INET, SIOCGLIFMETRIC, (caddr_t) & lifreq);
+#ifdef SOLARIS_IPV6
   else if (ifp->flags & IFF_IPV6)
     ret = AF_IOCTL (AF_INET6, SIOCGLIFMETRIC, (caddr_t) & lifreq);
+#endif /* SOLARIS_IPV6 */
   else
     ret = -1;
     
@@ -171,10 +175,13 @@ if_get_mtu (struct interface *ifp)
         }
     }
 
-
+#ifdef HAVE_IPV6
   if ((ifp->flags & IFF_IPV6) == 0)
-
+    return;
+    
+  memset(&lifreq, 0, sizeof(lifreq));
   lifreq_set_name (&lifreq, ifp);
+
   ret = AF_IOCTL (AF_INET6, SIOCGLIFMTU, (caddr_t) & lifreq);
   if (ret < 0)
     {
@@ -185,6 +192,7 @@ if_get_mtu (struct interface *ifp)
     {
       ifp->mtu6 = lifreq.lifr_metric;
     }
+#endif /* HAVE_IPV6 */
 }
 
 /* Set up interface's address, netmask (and broadcast? ).
index 8b45cf3b2edd24473034e4bf4b1e4ff6816360d8..14b92b0d5c9295b70830012221706c657c396cff 100644 (file)
@@ -24,6 +24,7 @@
 #define _ZEBRA_REDISTRIBUTE_H
 
 #include "table.h"
+#include "zserv.h"
 
 void zebra_redistribute_add (int, struct zserv *, int);
 void zebra_redistribute_delete (int, struct zserv *, int);
index f043099b52455e753f56c9267c8a9017217eec44..90e85f689e57e9f121c2ef664f9795e7f2628dab 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _ZEBRA_ZSERV_H
 #define _ZEBRA_ZSERV_H
 
+#include "rib.h"
+
 /* Default port information. */
 #define ZEBRA_PORT                    2600
 #define ZEBRA_VTY_PORT                2601