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.
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 3a1d81d..1aec0f0 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -269,21 +269,14 @@
/* 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 @@
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. */