Skip to content

Commit 2b2bebf

Browse files
committed
babeld: Hop Count must not be 0.
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 <[email protected]>
1 parent 44c4743 commit 2b2bebf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

babeld/message.c

+4
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ parse_packet(const unsigned char *from, struct interface *ifp,
734734
format_prefix(prefix, plen),
735735
format_address(from), ifp->name,
736736
format_eui64(message + 8), seqno);
737+
if(message[6] == 0) {
738+
debugf(BABEL_DEBUG_COMMON, "Received request with invalid hop count 0");
739+
goto done;
740+
}
737741
handle_request(neigh, prefix, plen, message[6], seqno, message + 8);
738742
} else {
739743
debugf(BABEL_DEBUG_COMMON,"Received unknown packet type %d from %s on %s.",

0 commit comments

Comments
 (0)