]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Do not keep BAF_EXT_LEN flag internally
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 30 Mar 2021 14:59:11 +0000 (16:59 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 30 Mar 2021 14:59:11 +0000 (16:59 +0200)
The flag makes sense just in external representation. It is reset during
BGP export, but keeping it internally broke MRT dumps for short attributes
that used it anyways.

Thanks to Simon Marsh for the bugreport and the patch.

proto/bgp/attrs.c

index 6752cb7f0a5ccd8d0bc4f7b42e0c18ff21c2cc61..24ba00ba735cfbc20434f8e8cb3e7a90b5815447 100644 (file)
@@ -88,7 +88,7 @@ bgp_set_attr(ea_list **attrs, struct linpool *pool, uint code, uint flags, uintp
       attrs,
       pool,
       EA_CODE(PROTOCOL_BGP, code),
-      flags,
+      flags & ~BAF_EXT_LEN,
       bgp_attr_table[code].type,
       val
   );
@@ -118,7 +118,7 @@ bgp_set_attr(ea_list **attrs, struct linpool *pool, uint code, uint flags, uintp
 static inline int
 bgp_put_attr_hdr3(byte *buf, uint code, uint flags, uint len)
 {
-  *buf++ = flags;
+  *buf++ = flags & ~BAF_EXT_LEN;
   *buf++ = code;
   *buf++ = len;
   return 3;