diff options
author | paul <paul> | 2003-06-07 01:10:00 +0000 |
---|---|---|
committer | paul <paul> | 2003-06-07 01:10:00 +0000 |
commit | f38a471c6fc96b63c5754448e9a9e32044c9ffd5 (patch) | |
tree | 6b474874414773770e2ad836065ba4658a913b9a /ripd/rip_interface.c | |
parent | 4aaff3f8d57fbb4fc5f4e5e52175a449686c3169 (diff) | |
download | quagga-f38a471c6fc96b63c5754448e9a9e32044c9ffd5.tar.bz2 quagga-f38a471c6fc96b63c5754448e9a9e32044c9ffd5.tar.xz |
From: Andrew J. Schorr <aschorr@telemetry-investments.com>
Subject: [zebra 12403] patch for ripd to accept any version of RIP
by default
The default Cisco IOS behavior is to send RIP version 1 packets and receive
version 1 and version 2 packets. But zebra version 0.92a sends and receives
only version 2 packets by default.
I have patched the code to change zebra's default behavior to sending
version 2 packets (same as before) but receiving both versions. While
this is still not identical to Cisco's behavior, it does now accept
packets of both versions and retains backwards compatibility with
zebra configurations.
Diffstat (limited to 'ripd/rip_interface.c')
-rw-r--r-- | ripd/rip_interface.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 3a1d81da..1aec0f09 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -269,21 +269,14 @@ rip_request_interface (struct interface *ifp) /* If there is no version configuration in the interface, use rip's version setting. */ - if (ri->ri_send == RI_RIP_UNSPEC) - { - if (rip->version == RIPv1) - rip_request_interface_send (ifp, RIPv1); - else - rip_request_interface_send (ifp, RIPv2); - } - /* If interface has RIP version configuration use it. */ - else - { - if (ri->ri_send & RIPv1) - rip_request_interface_send (ifp, RIPv1); - if (ri->ri_send & RIPv2) - rip_request_interface_send (ifp, RIPv2); - } + { + int vsend = ((ri->ri_send == RI_RIP_UNSPEC) ? + rip->version_send : ri->ri_send); + if (vsend & RIPv1) + rip_request_interface_send (ifp, RIPv1); + if (vsend & RIPv2) + rip_request_interface_send (ifp, RIPv2); + } } /* Send RIP request to the neighbor. */ @@ -296,7 +289,7 @@ rip_request_neighbor (struct in_addr addr) to.sin_port = htons (RIP_PORT_DEFAULT); to.sin_addr = addr; - rip_request_send (&to, NULL, rip->version); + rip_request_send (&to, NULL, rip->version_send); } /* Request routes at all interfaces. */ |