]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enum 4339/head
authorStephen Worley <sworley@cumulusnetworks.com>
Sun, 3 Mar 2019 01:58:38 +0000 (20:58 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Tue, 14 May 2019 19:19:12 +0000 (12:19 -0700)
Add an upspecified option to the AFI enum and update
switch statements using it in bgpd and pbrd.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
bgpd/bgp_vty.c
lib/zebra.h
pbrd/pbr_zebra.c

index 6197a6d562cfc2059c398c6ae679ff253fba4ee6..9ea8c66a9bb0bf79bc61df963508e8b78e498eec 100644 (file)
@@ -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;
index b1ea43c747cdde0817356a8eebc3a32b97a45424..3e1eefdb2e31efeb4dee3d6fb2ef954516c9b9ce 100644 (file)
@@ -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 {
index aad0e4275fb913d1ca8d53b64e6316ed0261c8fc..466a9a13ae1ae6451148b5d8282fd0b0f20a128d 100644 (file)
@@ -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;
        }
 }