From b26f891dca50643e68dc24f1a097438b80638dd4 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Sat, 2 Mar 2019 20:58:38 -0500 Subject: [PATCH] lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enum Add an upspecified option to the AFI enum and update switch statements using it in bgpd and pbrd. Signed-off-by: Stephen Worley --- bgpd/bgp_vty.c | 1 + lib/zebra.h | 8 +++++++- pbrd/pbr_zebra.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 6197a6d56..9ea8c66a9 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -119,6 +119,7 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi) case AFI_L2VPN: return BGP_EVPN_NODE; break; + case AFI_UNSPEC: case AFI_MAX: // We should never be here but to clarify the switch statement.. return BGP_IPV4_NODE; diff --git a/lib/zebra.h b/lib/zebra.h index b1ea43c74..3e1eefdb2 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -422,7 +422,13 @@ extern const char *zserv_command_string(unsigned int command); #endif /* Address family numbers from RFC1700. */ -typedef enum { AFI_IP = 1, AFI_IP6 = 2, AFI_L2VPN = 3, AFI_MAX = 4 } afi_t; +typedef enum { + AFI_UNSPEC = 0, + AFI_IP = 1, + AFI_IP6 = 2, + AFI_L2VPN = 3, + AFI_MAX = 4 +} afi_t; /* Subsequent Address Family Identifier. */ typedef enum { diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index aad0e4275..466a9a13a 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -349,6 +349,11 @@ void route_add(struct pbr_nexthop_group_cache *pnhgc, struct nexthop_group nhg, "%s: Asked to install unsupported route type: L2VPN", __PRETTY_FUNCTION__); break; + case AFI_UNSPEC: + DEBUGD(&pbr_dbg_zebra, + "%s: Asked to install unspecified route type", + __PRETTY_FUNCTION__); + break; } } @@ -391,6 +396,11 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi) "%s: Asked to delete unsupported route type: L2VPN", __PRETTY_FUNCTION__); break; + case AFI_UNSPEC: + DEBUGD(&pbr_dbg_zebra, + "%s: Asked to delete unspecified route type", + __PRETTY_FUNCTION__); + break; } } -- 2.39.5