]> git.puffer.fish Git - mirror/frr.git/commitdiff
Merge pull request #16735 from zmw12306/babel_nonzeroMBZ
authorDonald Sharp <donaldsharp72@gmail.com>
Fri, 11 Apr 2025 12:42:45 +0000 (08:42 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Apr 2025 12:42:45 +0000 (08:42 -0400)
babeld: Add MBZ and Reserved field checking

1  2 
babeld/message.c

index c8b1318c7a8fc7ac1c8b4b2443903a83483313fd,cdf4e9ead6ad001783a6ca274c003776ce54d882..cc751426baccaf8fbeef518b8fa05ad10408f9e9
@@@ -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