Browse Source

2004-05-09 Paul Jakma <paul@dishone.st>

	* ioctl.c: (if_get_mtu) set mtu6 to mtu
	* mtu_kvm.c: (if_kvm_get_mtu) set mtu6 to mtu
	* rt_netlink.c: (netlink_interface) set mtu6 to mtu
	  (netlink_link_change) ditto

2004-05-09 Sowmini Varadhan <sowmini.varadhan@sun.com>

	* interface.c: (if_delete_update) only used with HAVE_NETLINK
	  and RTM_IFANNOUNCE.
	  (if_flag_dump_vty) Solaris IFF_IPV4 and IFF_IPV6 if flags
	  (if_dump_vty) print mtu6 if not same as mtu
paul 16 years ago
parent
commit
44145db3ae
5 changed files with 35 additions and 10 deletions
  1. 8 0
      zebra/ChangeLog
  2. 18 1
      zebra/interface.c
  3. 4 4
      zebra/ioctl.c
  4. 2 2
      zebra/mtu_kvm.c
  5. 3 3
      zebra/rt_netlink.c

+ 8 - 0
zebra/ChangeLog

@@ -7,6 +7,10 @@
 	  (zsend_ipv4_delete) ditto.
 	  (zsend_ipv6_add) ditto.
 	  (zsend_ipv6_delete) ditto.
+	* ioctl.c: (if_get_mtu) set mtu6 to mtu
+	* mtu_kvm.c: (if_kvm_get_mtu) set mtu6 to mtu
+	* rt_netlink.c: (netlink_interface) set mtu6 to mtu
+	  (netlink_link_change) ditto 
 	  
 2004-05-09 Sowmini Varadhan <sowmini.varadhan@sun.com>
 
@@ -21,6 +25,10 @@
 	  (various) Apply static qualifier. Add comments.
 	* zserv.h: Definitions changed as per above.
 	* redistribute.c: Changes as per zserv.c.
+	* interface.c: (if_delete_update) only used with HAVE_NETLINK
+	  and RTM_IFANNOUNCE.
+	  (if_flag_dump_vty) Solaris IFF_IPV4 and IFF_IPV6 if flags
+	  (if_dump_vty) print mtu6 if not same as mtu	  
 	  
 2004-04-06  Krzysztof Oledzki <oleq@ans.pl>
 

+ 18 - 1
zebra/interface.c

@@ -209,7 +209,14 @@ if_add_update (struct interface *ifp)
     }
 }
 
-/* Handle an interface delete event */
+
+/* Handle an interface delete event
+ * 
+ * This function is only called  when support for
+ * RTM_IFANNOUNCE or AF_NETLINK sockets (RTM_DELLINK message)
+ * is available. It is not called on, eg, Solaris.
+ */
+#if (defined(RTM_IFANNOUNCE) || defined(HAVE_NETLINK))
 void 
 if_delete_update (struct interface *ifp)
 {
@@ -261,6 +268,7 @@ if_delete_update (struct interface *ifp)
     }
   zebra_interface_delete_update (ifp);
 }
+#endif /* (defined(RTM_IFANNOUNCE) || defined(HAVE_NETLINK) */
 
 /* Interface is up. */
 void
@@ -381,6 +389,10 @@ if_flag_dump_vty (struct vty *vty, unsigned long flag)
   IFF_OUT_VTY (IFF_LINK1, "LINK1");
   IFF_OUT_VTY (IFF_LINK2, "LINK2");
   IFF_OUT_VTY (IFF_MULTICAST, "MULTICAST");
+#ifdef SOLARIS_IPV6
+  IFF_OUT_VTY (IFF_IPV4, "IFF_IPv4");
+  IFF_OUT_VTY (IFF_IPV6, "IFF_IPv6");
+#endif /* SOLARIS_IPV6 */
   vty_out (vty, ">");
 }
 
@@ -514,6 +526,11 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
   vty_out (vty, "  index %d metric %d mtu %d ",
 	   ifp->ifindex, ifp->metric, ifp->mtu);
   if_flag_dump_vty (vty, ifp->flags);
+#ifdef HAVE_IPV6
+  if (ifp->mtu6 != ifp->mtu)
+    vty_out (vty, "mtu6 %d ", ifp->mtu6);
+#endif 
+
   vty_out (vty, "%s", VTY_NEWLINE);
 
   /* Hardware address. */

+ 4 - 4
zebra/ioctl.c

@@ -148,19 +148,19 @@ if_get_mtu (struct interface *ifp)
   if (if_ioctl (SIOCGIFMTU, (caddr_t) & ifreq) < 0) 
     {
       zlog_info ("Can't lookup mtu by ioctl(SIOCGIFMTU)");
-      ifp->mtu = -1;
+      ifp->mtu6 = ifp->mtu = -1;
       return;
     }
 
 #ifdef SUNOS_5
-  ifp->mtu = ifreq.ifr_metric;
+  ifp->mtu6 = ifp->mtu = ifreq.ifr_metric;
 #else
-  ifp->mtu = ifreq.ifr_mtu;
+  ifp->mtu6 = ifp->mtu = ifreq.ifr_mtu;
 #endif /* SUNOS_5 */
 
 #else
   zlog (NULL, LOG_INFO, "Can't lookup mtu on this system");
-  ifp->mtu = -1;
+  ifp->mtu6 = ifp->mtu = -1;
 #endif
 }
 

+ 2 - 2
zebra/mtu_kvm.c

@@ -46,7 +46,7 @@ if_kvm_get_mtu (struct interface *ifp)
     {""}
   };
 
-  ifp->mtu = -1;
+  ifp->mtu6 = ifp->mtu = -1;
   
   kvmd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, buf);
 
@@ -93,5 +93,5 @@ if_kvm_get_mtu (struct interface *ifp)
       return ;
     }
 
-  ifp->mtu = ifnet.if_mtu;
+  ifp->mtu6 = ifp->mtu = ifnet.if_mtu;
 }

+ 3 - 3
zebra/rt_netlink.c

@@ -447,7 +447,7 @@ netlink_interface (struct sockaddr_nl *snl, struct nlmsghdr *h)
 
   ifp->ifindex = ifi->ifi_index;
   ifp->flags = ifi->ifi_flags & 0x0000fffff;
-  ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+  ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
   ifp->metric = 1;
 
   /* Hardware type and address. */
@@ -910,7 +910,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
 
           ifp->ifindex = ifi->ifi_index;
           ifp->flags = ifi->ifi_flags & 0x0000fffff;
-          ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+          ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
           ifp->metric = 1;
 
           /* If new link is added. */
@@ -920,7 +920,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
         {
           /* Interface status change. */
           ifp->ifindex = ifi->ifi_index;
-          ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+          ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
           ifp->metric = 1;
 
           if (if_is_operative (ifp))