]> git.puffer.fish Git - mirror/frr.git/commitdiff
Last fixes from 6Wind patch.
authorhasso <hasso>
Sun, 25 May 2003 21:04:54 +0000 (21:04 +0000)
committerhasso <hasso>
Sun, 25 May 2003 21:04:54 +0000 (21:04 +0000)
lib/command.c
lib/sockunion.c
lib/zebra.h
zebra/connected.c
zebra/interface.h
zebra/ioctl.c
zebra/kernel_socket.c
zebra/zebra_rib.c
zebra/zserv.c
zebra/zserv.h

index f57cf5caddda342721d161f0c94369bfe8858b74..5d429338e473686c8b0a1160dd116031691a89d2 100644 (file)
@@ -718,6 +718,8 @@ cmd_ipv6_match (char *str)
   int state = STATE_START;
   int colons = 0, nums = 0, double_colon = 0;
   char *sp = NULL;
+  struct sockaddr_in6 sin6_dummy;
+  int ret;
 
   if (str == NULL)
     return partly_match;
@@ -725,6 +727,15 @@ cmd_ipv6_match (char *str)
   if (strspn (str, IPV6_ADDR_STR) != strlen (str))
     return no_match;
 
+  /* use inet_pton that has a better support,
+   * for example inet_pton can support the automatic addresses:
+   *  ::1.2.3.4
+   */
+  ret = inet_pton(AF_INET6, str, &sin6_dummy.sin6_addr);
+   
+  if (ret == 1)
+    return exact_match;
+
   while (*str != '\0')
     {
       switch (state)
index 13b0be6b98b091155c6ab366bb3f578092d90fbe..e4b311c7c20a84dfa740b958c15190ecb1a8a8b6 100644 (file)
@@ -344,8 +344,13 @@ sockunion_connect (int fd, union sockunion *peersu, unsigned short port,
        {
 #ifdef HAVE_SIN6_SCOPE_ID
          /* su.sin6.sin6_scope_id = ifindex; */
+#ifdef MUSICA
+         su.sin6.sin6_scope_id = ifindex; 
+#endif
 #endif /* HAVE_SIN6_SCOPE_ID */
+#ifndef MUSICA
          SET_IN6_LINKLOCAL_IFINDEX (su.sin6.sin6_addr, ifindex);
+#endif
        }
 #endif /* KAME */
       break;
index 175eb6e22fa13a4924724dd89548e1e1709cdeeb..baad6d6acd717278412a55e5336541723df884d6 100644 (file)
@@ -143,6 +143,10 @@ typedef int socklen_t;
 #include <netinet/in_var.h>
 #endif /* HAVE_NETINET_IN_VAR_H */
 
+#ifdef HAVE_NETINET6_IN6_VAR_H
+#include <netinet6/in6_var.h>
+#endif /* HAVE_NETINET6_IN6_VAR_H */
+
 #ifdef HAVE_NETINET_IN6_VAR_H
 #include <netinet/in6_var.h>
 #endif /* HAVE_NETINET_IN6_VAR_H */
index 5d1c6b66735fafaae0262a734e913a1f29079cf1..280e423e7cec265735e57c5fbf36cf7a4cf8796c 100644 (file)
@@ -263,8 +263,11 @@ connected_up_ipv6 (struct interface *ifp, struct connected *ifc)
   /* Apply mask to the network. */
   apply_mask_ipv6 (&p);
 
+#if ! defined (MUSICA) && ! defined (LINUX)
+  /* XXX: It is already done by rib_bogus_ipv6 within rib_add_ipv6 */
   if (IN6_IS_ADDR_UNSPECIFIED (&p.prefix))
     return;
+#endif
 
   rib_add_ipv6 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0);
 
index dbfa822128fb8f8ab43e3455871cb5c7cff95810..3ab624f204a5a27cd64bd0313a978f70564dba02 100644 (file)
@@ -31,7 +31,9 @@
 
 /* Router advertisement feature. */
 #if (defined(LINUX_IPV6) && (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME)
-#define RTADV
+  #ifdef HAVE_RTADV
+    #define RTADV
+  #endif
 #endif
 
 #ifdef RTADV
index 13afba299da9280af575e83ebecad80e7eb5d4a4..3e5d1d2fbb75fbc02e8090f5671419f013cb3475 100644 (file)
@@ -474,8 +474,10 @@ if_prefix_add_ipv6 (struct interface *ifp, struct connected *ifc)
 #endif
   memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6));
   
+#ifdef HAVE_IFRA_LIFETIME 
   addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; 
   addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; 
+#endif
 
   ret = if_ioctl_ipv6 (SIOCAIFADDR_IN6, (caddr_t) &addreq);
   if (ret < 0)
@@ -513,8 +515,10 @@ if_prefix_delete_ipv6 (struct interface *ifp, struct connected *ifc)
 #endif
   memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6));
 
+#ifdef HAVE_IFRA_LIFETIME
   addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; 
   addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; 
+#endif
 
   ret = if_ioctl_ipv6 (SIOCDIFADDR_IN6, (caddr_t) &addreq);
   if (ret < 0)
index 1e915d1db8d87631a3b708c3f70b48bb83eafea7..17893a87b719a465c28c9e491bf3be11d3655946 100644 (file)
@@ -763,9 +763,8 @@ kernel_read (struct thread *thread)
 
   thread_add_read (master, kernel_read, NULL, sock);
 
-#ifdef DEBUG
-  rtmsg_debug (&buf.r.rtm);
-#endif /* DEBUG */
+  if (IS_ZEBRA_DEBUG_KERNEL)
+    rtmsg_debug (&buf.r.rtm);
 
   rtm = &buf.r.rtm;
 
@@ -788,6 +787,8 @@ kernel_read (struct thread *thread)
       break;
 #endif /* RTM_IFANNOUNCE */
     default:
+      if (IS_ZEBRA_DEBUG_KERNEL)
+        zlog_info("Unprocessed RTM_type: %d", rtm->rtm_type);
       break;
     }
   return 0;
index 74edfbb899b6490b26ee14990c3965360d2b05cc..d7f8bdabfa154f019530c359b284b24617516046 100644 (file)
@@ -1539,8 +1539,14 @@ int
 rib_bogus_ipv6 (int type, struct prefix_ipv6 *p,
                struct in6_addr *gate, unsigned int ifindex, int table)
 {
-  if (type == ZEBRA_ROUTE_CONNECT && IN6_IS_ADDR_UNSPECIFIED (&p->prefix))
+  if (type == ZEBRA_ROUTE_CONNECT && IN6_IS_ADDR_UNSPECIFIED (&p->prefix)) {
+#if defined (MUSICA) || defined (LINUX)
+    /* IN6_IS_ADDR_V4COMPAT(&p->prefix) */
+    if (p->prefixlen == 96)
+      return 0;
+#endif /* MUSICA */
     return 1;
+  }
   if (type == ZEBRA_ROUTE_KERNEL && IN6_IS_ADDR_UNSPECIFIED (&p->prefix)
       && p->prefixlen == 96 && gate && IN6_IS_ADDR_UNSPECIFIED (gate))
     {
index 4753f57722d8498fa8ba905120c0c8a9cd04b506..ae1e044502ecc2a7e7201abec102e4310420c8d0 100644 (file)
@@ -448,6 +448,7 @@ zsend_ipv4_add_multipath (struct zserv *client, struct prefix *p,
        {
          stream_putc (s, 1);
 
+         /* XXX: Waht's about NEXTHOP_TYPE_IPV4_IFNAME ? */
          if (nexthop->type == NEXTHOP_TYPE_IPV4
              || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
            stream_put_in_addr (s, &nexthop->gate.ipv4);
@@ -529,6 +530,8 @@ zsend_ipv4_delete_multipath (struct zserv *client, struct prefix *p,
   return 0;
 }
 
+#if 0
+#warning oldies
 int
 zsend_ipv4_add (struct zserv *client, int type, int flags,
                struct prefix_ipv4 *p, struct in_addr *nexthop,
@@ -610,8 +613,11 @@ zsend_ipv4_delete (struct zserv *client, int type, int flags,
 
   return 0;
 }
+#endif /* oldies */
 
 #ifdef HAVE_IPV6
+#if 0
+#warning oldies
 int
 zsend_ipv6_add (struct zserv *client, int type, int flags,
                struct prefix_ipv6 *p, struct in6_addr *nexthop,
@@ -652,6 +658,7 @@ zsend_ipv6_add (struct zserv *client, int type, int flags,
 
   return 0;
 }
+#endif /* oldies */
 
 int
 zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p,
@@ -687,7 +694,9 @@ zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p,
        {
          stream_putc (s, 1);
 
-         if (nexthop->type == NEXTHOP_TYPE_IPV6)
+         if (nexthop->type == NEXTHOP_TYPE_IPV6
+             || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX
+             || nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
            stream_write (s, (u_char *) &nexthop->gate.ipv6, 16);
          else
            stream_write (s, (u_char *) &empty, 16);
@@ -711,6 +720,8 @@ zsend_ipv6_add_multipath (struct zserv *client, struct prefix *p,
   return 0;
 }
 
+#if 0
+#warning oldies
 int
 zsend_ipv6_delete (struct zserv *client, int type, int flags,
                   struct prefix_ipv6 *p, struct in6_addr *nexthop,
@@ -751,6 +762,7 @@ zsend_ipv6_delete (struct zserv *client, int type, int flags,
 
   return 0;
 }
+#endif /* oldies */
 
 int
 zsend_ipv6_delete_multipath (struct zserv *client, struct prefix *p,
index a083611fe3bd9cf5fed3c6aa102c022d25e0c085..ec3c9f4b3955f264ea7f7e1eb58b4b30cac3f9ba 100644 (file)
@@ -89,6 +89,8 @@ zsend_interface_up (struct zserv *, struct interface *);
 int
 zsend_interface_down (struct zserv *, struct interface *);
 
+#if 0
+#warning oldies
 int
 zsend_ipv4_add (struct zserv *client, int type, int flags,
                struct prefix_ipv4 *p, struct in_addr *nexthop,
@@ -98,6 +100,7 @@ int
 zsend_ipv4_delete (struct zserv *client, int type, int flags,
                   struct prefix_ipv4 *p, struct in_addr *nexthop,
                   unsigned int ifindex);
+#endif
 
 int
 zsend_ipv4_add_multipath (struct zserv *, struct prefix *, struct rib *);
@@ -106,6 +109,8 @@ int
 zsend_ipv4_delete_multipath (struct zserv *, struct prefix *, struct rib *);
 
 #ifdef HAVE_IPV6
+#if 0
+#warning oldies
 int
 zsend_ipv6_add (struct zserv *client, int type, int flags,
                struct prefix_ipv6 *p, struct in6_addr *nexthop,
@@ -115,6 +120,7 @@ int
 zsend_ipv6_delete (struct zserv *client, int type, int flags,
                   struct prefix_ipv6 *p, struct in6_addr *nexthop,
                   unsigned int ifindex);
+#endif
 
 int
 zsend_ipv6_add_multipath (struct zserv *, struct prefix *, struct rib *);