]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-05-08 Sowmini Varadhan <sowmini.varadhan@sun.com>
authorpaul <paul>
Sat, 8 May 2004 05:00:31 +0000 (05:00 +0000)
committerpaul <paul>
Sat, 8 May 2004 05:00:31 +0000 (05:00 +0000)
        * if.h: Add mtu6 field to struct interface, IPv6 MTU may differ
          from IPv4, and Solaris treats the MTU's differently.
          Add connected_add_by_prefix, for use by later patch.
        * if.c: (connected_add_by_prefix) Add prefix to connected list.
          (if_flag_dump) Solaris: Dump IFF_IPv4/6 flag
          (if_dump) Dump mtu6 flag, for HAVE_IPV6.

lib/ChangeLog
lib/if.c
lib/if.h

index 121d1d6238d57b75ff3e494aa40c25ea859afba4..b7c54228bd3c8125bc59402ea5e1bfd203684924 100644 (file)
@@ -1,3 +1,12 @@
+2004-05-08 Sowmini Varadhan <sowmini.varadhan@sun.com>
+
+       * if.h: Add mtu6 field to struct interface, IPv6 MTU may differ
+         from IPv4, and Solaris treats the MTU's differently.
+         Add connected_add_by_prefix, for use by later patch.
+       * if.c: (connected_add_by_prefix) Add prefix to connected list.
+         (if_flag_dump) Solaris: Dump IFF_IPv4/6 flag
+         (if_dump) Dump mtu6 flag, for HAVE_IPV6.
+
 2004-04-21 Boris Kovalenko <boris@tagnet.ru>
 
        * daemon.c: (daemon) fix check for error return from setsid
index 8237b2f21318df5f7de3eb45faad0c6d444c1d9c..e76f609231e1d75babbfe84a9896c6d27e26bfd5 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -30,7 +30,6 @@
 #include "if.h"
 #include "sockunion.h"
 #include "prefix.h"
-#include "zebra/connected.h"
 #include "memory.h"
 #include "table.h"
 #include "buffer.h"
@@ -402,6 +401,10 @@ if_flag_dump (unsigned long flag)
   IFF_OUT_LOG (IFF_LINK1, "LINK1");
   IFF_OUT_LOG (IFF_LINK2, "LINK2");
   IFF_OUT_LOG (IFF_MULTICAST, "MULTICAST");
+#ifdef SOLARIS_IPV6
+  IFF_OUT_LOG (IFF_IPV4, "IFF_IPv4");
+  IFF_OUT_LOG (IFF_IPV6, "IFF_IPv6");
+#endif /* SOLARIS_IPV6 */
 
   strlcat (logbuf, ">", BUFSIZ);
 
@@ -414,8 +417,15 @@ if_dump (struct interface *ifp)
 {
   listnode node;
 
-  zlog_info ("Interface %s index %d metric %d mtu %d %s",
+  zlog_info ("Interface %s index %d metric %d mtu %d "
+#ifdef HAVE_IPV6
+             "mtu6 %d "
+#endif /* HAVE_IPV6 */
+             "%s",
             ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, 
+#ifdef HAVE_IPV6
+            ifp->mtu6,
+#endif /* HAVE_IPV6 */
             if_flag_dump (ifp->flags));
   
   for (node = listhead (ifp->connected); node; nextnode (node))
@@ -709,6 +719,29 @@ connected_lookup_address (struct interface *ifp, struct in_addr dst)
   return match;
 }
 
+struct connected *
+connected_add_by_prefix (struct interface *ifp, struct prefix *p, 
+                         struct prefix *destination)
+{
+  struct connected *ifc;
+
+  /* Allocate new connected address. */
+  ifc = connected_new ();
+  ifc->ifp = ifp;
+
+  /* Fetch interface address */
+  ifc->address = prefix_new();
+  memcpy (ifc->address, p, sizeof(struct prefix));
+
+  /* Fetch dest address */
+  ifc->destination = prefix_new();
+  memcpy (ifc->destination, destination, sizeof(struct prefix));
+
+  /* Add connected address to the interface. */
+  listnode_add (ifp->connected, ifc);
+  return ifc;
+}
+
 #ifndef HAVE_IF_NAMETOINDEX
 unsigned int
 if_nametoindex (const char *name)
index 708853bc85bbf9b316cb00109fa6fb9672a53357..70a12860ab3d492bd158e45f1dba7af79867bde7 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -94,7 +94,8 @@ struct interface
   int metric;
 
   /* Interface MTU. */
-  int mtu;
+  int mtu;    /* IPv4 MTU */
+  int mtu6;   /* IPv6 MTU - probably, but not neccessarily same as mtu */
 
   /* Hardware address. */
 #ifdef HAVE_SOCKADDR_DL
@@ -205,8 +206,13 @@ char *ifindex2ifname (unsigned int);
 struct connected *connected_new ();
 void connected_free (struct connected *);
 void connected_add (struct interface *, struct connected *);
-struct connected  *connected_delete_by_prefix (struct interface *, struct prefix *);
-struct connected  *connected_lookup_address (struct interface *, struct in_addr);
+struct connected  *connected_add_by_prefix (struct interface *,
+                                            struct prefix *,
+                                            struct prefix *);
+struct connected  *connected_delete_by_prefix (struct interface *, 
+                                               struct prefix *);
+struct connected  *connected_lookup_address (struct interface *, 
+                                             struct in_addr);
 
 #ifndef HAVE_IF_NAMETOINDEX
 unsigned int if_nametoindex (const char *);