]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: add non-zero check for RIPv1 reserved field,
authorzmw12306 <zmw12306@gmail.com>
Tue, 25 Apr 2023 18:37:28 +0000 (14:37 -0400)
committerzmw12306 <zmw12306@gmail.com>
Tue, 25 Apr 2023 19:17:01 +0000 (15:17 -0400)
According to RFC2453 3.6, the tag of a RIP-1 entry should be zero
Signed-off-by: zmw12306 <zmw12306@gmail.com>
ripd/ripd.c

index fb3d574aaa70b71459875455c989610ef1233e7b..9167a4fa700af6615eb124fa92dd39b0ecb32a1e 100644 (file)
@@ -1171,6 +1171,12 @@ static void rip_response_process(struct rip_packet *packet, int size,
                        continue;
                }
 
+               if (packet->version == RIPv1 && rte->tag != 0) {
+                       zlog_warn("RIPv1 reserved field is nonzero: %d",
+                                 ntohs(rte->tag));
+                       continue;
+               }
+
                /* - is the destination address valid (e.g., unicast; not net 0
                   or 127) */
                if (!rip_destination_check(rte->prefix)) {