]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ripd] Fix logic to send updates on all connected addresses.
authorAndrew J. Schorr <ajschorr@alumni.princeton.edu>
Fri, 28 Apr 2006 16:22:36 +0000 (16:22 +0000)
committerAndrew J. Schorr <ajschorr@alumni.princeton.edu>
Fri, 28 Apr 2006 16:22:36 +0000 (16:22 +0000)
2006-04-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

* ripd.c: (rip_update_process) Try to fix the logic for sending
  an updated on each connected network.  The new code will
  attempt to send the update on each connected network, whereas
  the previous code seemed to be attempting to avoid sending
  more than one RIPv1 update on a given interface, but was coded
  incorrectly.  The actual effect of the old code was to send
  an update only on the first connected address in the cases
  where the interface is not multicast, or RIPv2 is not being used.

ripd/ChangeLog
ripd/ripd.c

index d795509efe2874052dcfe5db61c71abf99e088be..89302d55c43936a82b75ea530c6ee43f5ff7ee7d 100644 (file)
@@ -1,3 +1,14 @@
+2006-04-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ripd.c: (rip_update_process) Try to fix the logic for sending
+         an updated on each connected network.  The new code will
+         attempt to send the update on each connected network, whereas
+         the previous code seemed to be attempting to avoid sending
+         more than one RIPv1 update on a given interface, but was coded
+         incorrectly.  The actual effect of the old code was to send
+         an update only on the first connected address in the cases
+         where the interface is not multicast, or RIPv2 is not being used.
+
 2006-01-30 Alain Ritoux <alain.ritoux@6wind.com>
 
         * ripd.c: correct bug that allowed route learnt through RIP to take
index c8aa52215740bd938430387e9dc5036b26f5066e..e91adb840b5e6e59a895d287409905bf3999f4bc 100644 (file)
@@ -2498,42 +2498,28 @@ rip_update_process (int route_type)
 
       if (ri->running)
        {
+         /* 
+          * If there is no version configuration in the interface,
+          * use rip's version setting. 
+          */
+         int vsend = ((ri->ri_send == RI_RIP_UNSPEC) ?
+                      rip->version_send : ri->ri_send);
+
          if (IS_RIP_DEBUG_EVENT) 
-           {
-             if (ifp->name) 
-               zlog_debug ("SEND UPDATE to %s ifindex %d",
-                          ifp->name, ifp->ifindex);
-             else
-               zlog_debug ("SEND UPDATE to _unknown_ ifindex %d",
-                          ifp->ifindex);
-           }
+           zlog_debug("SEND UPDATE to %s ifindex %d",
+                      (ifp->name ? ifp->name : "_unknown_"), ifp->ifindex);
 
           /* send update on each connected network */
          for (ALL_LIST_ELEMENTS (ifp->connected, ifnode, ifnnode, connected))
            {
-             struct prefix_ipv4 *ifaddr;
-              int done = 0;
-             /* 
-               * If there is no version configuration in the interface,
-               * use rip's version setting. 
-               */
-             int vsend = ((ri->ri_send == RI_RIP_UNSPEC) ?
-                          rip->version_send : ri->ri_send);
-
-              ifaddr = (struct prefix_ipv4 *) connected->address;
-
-             if (ifaddr->family != AF_INET)
-               continue;
-
-              if ((vsend & RIPv1) && !done)
-               rip_update_interface (connected, RIPv1, route_type);
-              if ((vsend & RIPv2) && if_is_multicast(ifp))
-               rip_update_interface (connected, RIPv2, route_type);
-              done = 1;
-              if (!(vsend & RIPv2) || !if_is_multicast(ifp))
-                break;
-               
-         }
+             if (connected->address->family == AF_INET)
+               {
+                 if (vsend & RIPv1)
+                   rip_update_interface (connected, RIPv1, route_type);
+                 if ((vsend & RIPv2) && if_is_multicast(ifp))
+                   rip_update_interface (connected, RIPv2, route_type);
+               }
+           }
        }
     }