summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_pbr.c2
-rw-r--r--lib/nexthop_group.c5
-rw-r--r--ospfd/ospf_vty.c2
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zapi_msg.c2
-rw-r--r--zebra/zebra_nhg.c4
6 files changed, 9 insertions, 8 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c
index 83194e010a..14f5fefb20 100644
--- a/bgpd/bgp_pbr.c
+++ b/bgpd/bgp_pbr.c
@@ -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;
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c
index 0f1a87cf6e..3005a51c71 100644
--- a/lib/nexthop_group.c
+++ b/lib/nexthop_group.c
@@ -250,8 +250,7 @@ static void _nexthop_add_sorted(struct nexthop **head,
{
struct nexthop *position, *prev;
- /* Ensure this gets set */
- nexthop->next = NULL;
+ assert(!nexthop->next);
for (position = *head, prev = NULL; position;
prev = position, position = position->next) {
@@ -281,6 +280,8 @@ void nexthop_group_add_sorted(struct nexthop_group *nhg,
{
struct nexthop *tail;
+ assert(!nexthop->next);
+
/* Try to just append to the end first;
* trust the list is already sorted
*/
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 152a7e83b7..1542ef88fb 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -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;
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 29a341abbd..dd6e62ee6c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -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 = {};
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 651babdeba..af44768a51 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -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;
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 2a76fa61e9..7430307320 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -478,7 +478,7 @@ static void handle_recursive_depend(struct nhg_connected_tree_head *nhg_depends,
struct nhg_hash_entry *depend = NULL;
struct nexthop_group resolved_ng = {};
- nexthop_group_add_sorted(&resolved_ng, nh);
+ resolved_ng.nexthop = nh;
depend = zebra_nhg_rib_find(0, &resolved_ng, afi);
depends_add(nhg_depends, depend);
@@ -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):