]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Tue, 29 Mar 2005 17:03:49 +0000 (17:03 +0000)
committerajs <ajs>
Tue, 29 Mar 2005 17:03:49 +0000 (17:03 +0000)
* rt_netlink.c: (netlink_link_change) If the status of an
  operative interface changes (e.g. MTU changes), the client
  daemons should be notified by calling zebra_interface_up_update.
  Previously, the information was being updated in zebra's
  interface structure, but the clients were not notified of
  changes to an operative interface.
* ospf_zebra.c: (ospf_interface_state_up) If the MTU of an operative
  interface changes, print a debug message and call ospf_if_reset()
  to simulate down/up on the interface.
* ospf_interface.h: Declare new function ospf_if_reset().
* ospf_interface.c: (ospf_if_reset) New function to call ospf_if_down
  and ospf_if_up for all ospf interfaces attached to an interface.

ospfd/ChangeLog
ospfd/ospf_interface.c
ospfd/ospf_interface.h
ospfd/ospf_zebra.c
zebra/ChangeLog
zebra/rt_netlink.c

index fbffe6a275cf5bb312a4019d7e993b2e80e3e967..98cabbd646d09c10c2c66a75ab3cc5601afeb36a 100644 (file)
@@ -1,3 +1,12 @@
+2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ospf_zebra.c: (ospf_interface_state_up) If the MTU of an operative
+         interface changes, print a debug message and call ospf_if_reset()
+         to simulate down/up on the interface.
+       * ospf_interface.h: Declare new function ospf_if_reset().
+       * ospf_interface.c: (ospf_if_reset) New function to call ospf_if_down
+         and ospf_if_up for all ospf interfaces attached to an interface.
+
 2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * ospf_packet.c: (ospf_write_frags) Enhance error message to
index df71fad6ea159bf2ff701fb61bf8afd6bfc81246..b76abe58a9d22c17ba3a44443a6bcf75322ada3b 100644 (file)
@@ -102,6 +102,25 @@ ospf_if_recalculate_output_cost (struct interface *ifp)
     }
 }
 
+/* Simulate down/up on the interface.  This is needed, for example, when 
+   the MTU changes. */
+void
+ospf_if_reset(struct interface *ifp)
+{
+  struct route_node *rn;
+  
+  for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
+    {
+      struct ospf_interface *oi;
+      
+      if ( (oi = rn->info) == NULL)
+       continue;
+
+      ospf_if_down(oi);
+      ospf_if_up(oi);
+    }
+}
+
 void
 ospf_if_reset_variables (struct ospf_interface *oi)
 {
index b49a3517f55e63a88c0b9d9be8cc54e2aa4d45ce..b3fb3ba3583495bf3d59c0219232ad4b9f8b2efe 100644 (file)
@@ -234,6 +234,9 @@ int ospf_if_is_enable (struct ospf_interface *);
 int ospf_if_get_output_cost (struct ospf_interface *);
 void ospf_if_recalculate_output_cost (struct interface *);
 
+/* Simulate down/up on the interface. */
+extern void ospf_if_reset (struct interface *);
+
 struct ospf_interface *ospf_vl_new (struct ospf *, struct ospf_vl_data *);
 struct ospf_vl_data *ospf_vl_data_new (struct ospf_area *, struct in_addr);
 struct ospf_vl_data *ospf_vl_lookup (struct ospf_area *, struct in_addr);
index 8468aed9eac9ff3e1c2ed4be3c4239aa6f6fefde..300103e12c0191b7135e2b8cf7384bb67ffd5ae1 100644 (file)
@@ -168,7 +168,6 @@ ospf_interface_state_up (int command, struct zclient *zclient,
                          zebra_size_t length)
 {
   struct interface *ifp;
-  struct interface if_tmp;
   struct ospf_interface *oi;
   struct route_node *rn;
 
@@ -181,6 +180,7 @@ ospf_interface_state_up (int command, struct zclient *zclient,
   if (if_is_operative (ifp))
     {
       /* Temporarily keep ifp values. */
+      struct interface if_tmp;
       memcpy (&if_tmp, ifp, sizeof (struct interface));
 
       zebra_interface_if_set_value (zclient->ibuf, ifp);
@@ -196,6 +196,16 @@ ospf_interface_state_up (int command, struct zclient *zclient,
 
           ospf_if_recalculate_output_cost (ifp);
         }
+
+      if (if_tmp.mtu != ifp->mtu)
+        {
+          if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
+            zlog_debug ("Zebra: Interface[%s] MTU change %u -> %u.",
+                       ifp->name, if_tmp.mtu, ifp->mtu);
+
+         /* Must reset the interface (simulate down/up) when MTU changes. */
+          ospf_if_reset(ifp);
+       }
       return 0;
     }
 
index bc3c738cfdfdb73ed0b724038b9ca1ab4e37f867..59c154dd662fba2ca78e575dbddcd17f70184de9 100644 (file)
@@ -1,3 +1,12 @@
+2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * rt_netlink.c: (netlink_link_change) If the status of an
+         operative interface changes (e.g. MTU changes), the client
+         daemons should be notified by calling zebra_interface_up_update.
+         Previously, the information was being updated in zebra's
+         interface structure, but the clients were not notified of
+         changes to an operative interface.
+
 2005-03-25 Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
        * interface.c, interface.h, rtadv.c, rtadv.h: modifications to 
          IPv6 Neighbor Discovery according to RFC3775, section 7:
index 43f687d428460690e339b601b816753c4ca78571..7a78602e7436671c4db7119b8b65c7b478f3a27e 100644 (file)
@@ -1001,6 +1001,9 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
               ifp->flags = ifi->ifi_flags & 0x0000fffff;
               if (!if_is_operative (ifp))
                 if_down (ifp);
+             else
+               /* Must notify client daemons of new interface status. */
+               zebra_interface_up_update (ifp);
             }
           else
             {