summaryrefslogtreecommitdiff
path: root/proto/bgp
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-04-04 05:20:49 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-04-04 05:20:49 +0200
commitf881b98d9b48e7a60c46dffc29009a86dac63233 (patch)
treeb76bf3dbdab86538ff92ae3e8ac84948f771273d /proto/bgp
parent231c63851e3a56201dd02abfbf3fce47a80f8ae0 (diff)
BGP: Fix bgp_med handling
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.
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/bgp.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index a36949c2..0461ea28 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -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);