From: Donald Sharp Date: Fri, 11 Apr 2025 12:42:45 +0000 (-0400) Subject: Merge pull request #16735 from zmw12306/babel_nonzeroMBZ X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2c37a217432a7207f2001c9e95006f5be732089a;p=matthieu%2Ffrr.git Merge pull request #16735 from zmw12306/babel_nonzeroMBZ babeld: Add MBZ and Reserved field checking --- 2c37a217432a7207f2001c9e95006f5be732089a diff --cc babeld/message.c index c8b1318c7a,cdf4e9ead6..cc751426ba --- a/babeld/message.c +++ b/babeld/message.c @@@ -52,9 -53,19 +53,19 @@@ static const unsigned char tlv_min_leng static bool known_ae(int ae) { - return ae <= 4; + return ae <= 3; } + static inline bool + is_all_zero(const unsigned char *data, int len) { + for (int j = 0; j < len; j++) { + if (data[j] != 0) { + return false; + } + } + return true; + } + /* Parse a network prefix, encoded in the somewhat baroque compressed representation used by Babel. Return the number of bytes parsed. */ static int