From 54430df953d6c590e5f446530a21d18277eeda56 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 8 Sep 2022 19:41:02 +0200 Subject: BGP: Do not assume that all channels are struct bgp_channel In principle, the channel list is a list of parent struct proto and can contain general structures of type struct channel, That is useful e.g. for adding MPLS channels to BGP. --- proto/bgp/bgp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'proto/bgp/bgp.h') diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index 15a759fb..5d0e9791 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -485,6 +485,9 @@ struct bgp_parse_state { #define BGP_RX_BUFFER_EXT_SIZE 65535 #define BGP_TX_BUFFER_EXT_SIZE 65535 +#define BGP_CF_WALK_CHANNELS(P,C) WALK_LIST(C, P->c.channels) if (C->c.channel == &channel_bgp) +#define BGP_WALK_CHANNELS(P,C) WALK_LIST(C, P->p.channels) if (C->c.channel == &channel_bgp) + static inline int bgp_channel_is_ipv4(struct bgp_channel *c) { return BGP_AFI(c->afi) == BGP_AFI_IPV4; } -- cgit v1.2.3