]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babeld: Hop Count must not be 0.
authorzmw12306 <zmw12306@gmail.com>
Mon, 24 Mar 2025 19:32:18 +0000 (15:32 -0400)
committerzmw12306 <zmw12306@gmail.com>
Mon, 24 Mar 2025 19:32:18 +0000 (15:32 -0400)
According to RFC 8966:
Hop Count The maximum number of times that this TLV may be forwarded, plus 1. This MUST NOT be 0.
Signed-off-by: zmw12306 <zmw12306@gmail.com>
babeld/message.c

index 5a33d5c288ac6d6885143720f338ca99ba2f3e71..15022093c5c2b92da77c139d607e407624e43164 100644 (file)
@@ -693,6 +693,10 @@ parse_packet(const unsigned char *from, struct interface *ifp,
                 memcpy(src_prefix, zeroes, 16);
                 src_plen = 0;
             }
+            if(message[6] == 0) {
+                debugf(BABEL_DEBUG_COMMON, "Received seqno request with invalid hop count 0");
+                goto done;
+            }
             rc = parse_request_subtlv(message[2], message + 4 + rc,
                                       len - 2 - rc, src_prefix, &src_plen);
             if(rc < 0)