]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix bgp_med handling debian-12
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 4 Apr 2023 03:20:49 +0000 (05:20 +0200)
committerJakub Ružička <jakub.ruzicka@nic.cz>
Tue, 30 May 2023 11:31:35 +0000 (13:31 +0200)
Missing translation from BGP attribute ID to eattr ID in bgp_unset_attr()
broke automatic removal of bgp_med during export to EBGP peers.

Thanks to Edward Sun for the bugreport.

proto/bgp/bgp.h

index 2808d479f136958b37cf93b882175a4352a891f4..703f874ae8299f834c02180f47eba49906ce240e 100644 (file)
@@ -587,7 +587,9 @@ bgp_set_attr_data(ea_list **to, struct linpool *pool, uint code, uint flags, voi
   bgp_set_attr(to, pool, code, flags, (uintptr_t) a);
 }
 
-#define bgp_unset_attr(to, pool, code) ea_unset_attr(to, pool, 0, code)
+static inline void
+bgp_unset_attr(ea_list **to, struct linpool *pool, uint code)
+{ ea_unset_attr(to, pool, 0, EA_CODE(PROTOCOL_BGP, code)); }
 
 int bgp_encode_mp_reach_mrt(struct bgp_write_state *s, eattr *a, byte *buf, uint size);