Skip to content

Commit

Permalink
bgpd: simplify lookup list call with fs pbr entries
Browse files Browse the repository at this point in the history
no test is done to check for validity of fs_pbr and fs_iprule pointer.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Mar 29, 2019
1 parent 2fe55af commit e0c7edb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bgpd/bgp_pbr.c
Expand Up @@ -2067,9 +2067,9 @@ static void bgp_pbr_policyroute_add_to_zebra_unit(struct bgp *bgp,
struct bgp_path_info_extra *extra =
bgp_path_info_extra_get(path);

if (extra && extra->bgp_fs_iprule &&
listnode_lookup(extra->bgp_fs_iprule,
bpr)) {
if (extra &&
listnode_lookup_nocheck(extra->bgp_fs_iprule,
bpr)) {
if (BGP_DEBUG(pbr, PBR_ERROR))
zlog_err("%s: entry %p/%p already "
"installed in bgp pbr iprule",
Expand Down Expand Up @@ -2216,8 +2216,8 @@ static void bgp_pbr_policyroute_add_to_zebra_unit(struct bgp *bgp,
struct bgp_path_info_extra *extra =
bgp_path_info_extra_get(path);

if (extra && extra->bgp_fs_pbr &&
listnode_lookup(extra->bgp_fs_pbr, bpme)) {
if (extra &&
listnode_lookup_nocheck(extra->bgp_fs_pbr, bpme)) {
if (BGP_DEBUG(pbr, PBR_ERROR))
zlog_err(
"%s: entry %p/%p already installed in bgp pbr",
Expand Down

0 comments on commit e0c7edb

Please sign in to comment.