Skip to content

Commit

Permalink
zebra: Check if a nexthop was added to the nhg
Browse files Browse the repository at this point in the history
Before doing anything with our tables, less make sure
we even added anything to the group.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
  • Loading branch information
sworleys committed Oct 25, 2019
1 parent e8b0e42 commit a3267f8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,6 @@ static struct nexthop netlink_nexthop_process_nh(struct rtattr **tb,
EC_ZEBRA_BAD_NHG_MESSAGE,
"Nexthop gateway with bad address family (%d) received from kernel",
family);
// TODO: Different return value?
return nh;
}
gate = RTA_DATA(tb[NHA_GATEWAY]);
Expand Down Expand Up @@ -2298,12 +2297,8 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
ns_id);
}


SET_FLAG(nh.flags, NEXTHOP_FLAG_ACTIVE);
if (nhm->nh_flags & RTNH_F_ONLINK)
SET_FLAG(nh.flags, NEXTHOP_FLAG_ONLINK);

nexthop_group_add_sorted(&nhg, &nh);
if (!nhg.nexthop)
return -1;

if (nhe) {
/* This is a change to a group we already have */
Expand Down

0 comments on commit a3267f8

Please sign in to comment.