diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2016-11-10 13:15:43 -0200 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2016-11-25 11:45:39 -0200 |
| commit | 6aec4b41760e6ba54fc52b09f6d3ecfe173f6ee6 (patch) | |
| tree | 41ff63d4ac7ce84913455cd758a51b7dadfbc896 /ripd/ripd.c | |
| parent | f90310cfe8a5d17357a0e31cb7e55eb7d6024092 (diff) | |
ripd: add "none" option to the "ip rip receive version" command
RFC 2453 says (section 5.1):
"(...) For completeness, routers should also implement a receive control
switch which would determine whether to accept, RIP-1 only, RIP-2 only,
both, or none. It should also be configurable on a per-interface basis".
For the "ip rip send version" command, we don't need to implement the
"none" option because there's already the "passive-interface" command
for that.
Fixes IxANVL RIP test 16.8.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/ripd.c')
| -rw-r--r-- | ripd/ripd.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index 97e80ed43b..f27a817aed 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -1937,15 +1937,9 @@ rip_read (struct thread *t) /* RIP Version check. RFC2453, 4.6 and 5.1 */ vrecv = ((ri->ri_receive == RI_RIP_UNSPEC) ? rip->version_recv : ri->ri_receive); - if ((packet->version == RIPv1) && !(vrecv & RIPv1)) - { - if (IS_RIP_DEBUG_PACKET) - zlog_debug (" packet's v%d doesn't fit to if version spec", - packet->version); - rip_peer_bad_packet (&from); - return -1; - } - if ((packet->version == RIPv2) && !(vrecv & RIPv2)) + if (vrecv == RI_RIP_VERSION_NONE || + ((packet->version == RIPv1) && !(vrecv & RIPv1)) || + ((packet->version == RIPv2) && !(vrecv & RIPv2))) { if (IS_RIP_DEBUG_PACKET) zlog_debug (" packet's v%d doesn't fit to if version spec", |
