bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT

Explicitly spell out what we are trying to do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-01-09 16:57:35 -05:00
parent f014634e85
commit 946de1b95a
5 changed files with 5 additions and 5 deletions

View File

@ -1725,7 +1725,7 @@ static void bgp_pbr_policyroute_remove_from_zebra_unit(
temp.type = IPSET_NET_NET;
}
if (bpf->vrf_id == VRF_UNKNOWN) /* XXX case BGP destroy */
temp.vrf_id = 0;
temp.vrf_id = VRF_DEFAULT;
else
temp.vrf_id = bpf->vrf_id;
bpme = &temp2;

View File

@ -9679,7 +9679,7 @@ DEFUN (show_ip_ospf_vrfs,
if (uj)
json_vrf = json_object_new_object();
if (ospf->vrf_id == 0)
if (ospf->vrf_id == VRF_DEFAULT)
name = VRF_DEFAULT_NAME;
else
name = ospf->name;

View File

@ -2353,7 +2353,7 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
unsigned char family;
int type;
afi_t afi = AFI_UNSPEC;
vrf_id_t vrf_id = 0;
vrf_id_t vrf_id = VRF_DEFAULT;
struct interface *ifp = NULL;
struct nhmsg *nhm = NULL;
struct nexthop nh = {};

View File

@ -1416,7 +1416,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
struct nexthop *nexthop = NULL;
struct nexthop_group *ng = NULL;
int i, ret;
vrf_id_t vrf_id = 0;
vrf_id_t vrf_id;
struct ipaddr vtep_ip;
s = msg;

View File

@ -507,7 +507,7 @@ static bool zebra_nhg_find(struct nhg_hash_entry **nhe, uint32_t id,
if (lookup.nhg->nexthop->next) {
/* Groups can have all vrfs and AF's in them */
lookup.afi = AFI_UNSPEC;
lookup.vrf_id = 0;
lookup.vrf_id = VRF_DEFAULT;
} else {
switch (lookup.nhg->nexthop->type) {
case (NEXTHOP_TYPE_IFINDEX):