From b9d92881f5d45601c4268d99baec8835068b73c2 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 28 Apr 2006 16:22:36 +0000 Subject: [ripd] Fix logic to send updates on all connected addresses. 2006-04-28 Andrew J. Schorr * 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 | 11 +++++++++++ ripd/ripd.c | 48 +++++++++++++++++------------------------------- 2 files changed, 28 insertions(+), 31 deletions(-) (limited to 'ripd') diff --git a/ripd/ChangeLog b/ripd/ChangeLog index d795509e..89302d55 100644 --- a/ripd/ChangeLog +++ b/ripd/ChangeLog @@ -1,3 +1,14 @@ +2006-04-28 Andrew J. Schorr + + * 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 * ripd.c: correct bug that allowed route learnt through RIP to take diff --git a/ripd/ripd.c b/ripd/ripd.c index c8aa5221..e91adb84 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -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); + } + } } } -- cgit v1.2.1