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/ripd.h b/ripd/ripd.h
index 23a12c4..c414c76 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -25,6 +25,9 @@
/* RIP version number. */
#define RIPv1 1
#define RIPv2 2
+/* N.B. stuff will break if
+ (RIPv1 != RI_RIP_VERSION_1) || (RIPv2 != RI_RIP_VERSION_2) */
+
/* RIP command list. */
#define RIP_REQUEST 1
@@ -85,7 +88,8 @@
int sock;
/* Default version of rip instance. */
- u_char version;
+ int version_send; /* version 1 or 2 (but not both) */
+ int version_recv; /* version 1 or 2 or both */
/* Output buffer of RIP. */
struct stream *obuf;
@@ -322,6 +326,8 @@
#define RI_RIP_VERSION_1 1
#define RI_RIP_VERSION_2 2
#define RI_RIP_VERSION_1_AND_2 3
+/* N.B. stuff will break if
+ (RIPv1 != RI_RIP_VERSION_1) || (RIPv2 != RI_RIP_VERSION_2) */
/* Default value for "default-metric" command. */
#define RIP_DEFAULT_METRIC_DEFAULT 1