Merge pull request #10693 from anlancs/bgpd-add-check-ns

zebra: use "assert" instead of unnecessary check
This commit is contained in:
Donald Sharp 2022-03-15 08:27:44 -04:00 committed by GitHub
commit 052b0eee2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -826,8 +826,7 @@ static int zvni_map_to_svi_ns(struct ns *ns,
struct interface **p_ifp = (struct interface **)_p_ifp; struct interface **p_ifp = (struct interface **)_p_ifp;
struct zebra_if *zif; struct zebra_if *zif;
if (!in_param) assert(in_param && p_ifp);
return NS_WALK_STOP;
/* TODO: Optimize with a hash. */ /* TODO: Optimize with a hash. */
for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
@ -842,8 +841,7 @@ static int zvni_map_to_svi_ns(struct ns *ns,
vl = (struct zebra_l2info_vlan *)&zif->l2info.vl; vl = (struct zebra_l2info_vlan *)&zif->l2info.vl;
if (vl->vid == in_param->vid) { if (vl->vid == in_param->vid) {
if (p_ifp) *p_ifp = tmp_if;
*p_ifp = tmp_if;
return NS_WALK_STOP; return NS_WALK_STOP;
} }
} }