]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_pbr.c
Merge pull request #4027 from pguibert6WIND/fix_interface_rtadv
[mirror_frr.git] / bgpd / bgp_pbr.c
index c0be36ed3f4ad3b9b7d8483bc275dc2ed1cfacbf..0fddfa75a1e88a87f33cd38cefeecc8529e1be3f 100644 (file)
@@ -1421,7 +1421,8 @@ static void bgp_pbr_flush_iprule(struct bgp *bgp, struct bgp_pbr_action *bpa,
                        /* unlink path to bpme */
                        path = (struct bgp_path_info *)bpr->path;
                        extra = bgp_path_info_extra_get(path);
-                       listnode_delete(extra->bgp_fs_iprule, bpr);
+                       if (extra->bgp_fs_iprule)
+                               listnode_delete(extra->bgp_fs_iprule, bpr);
                        bpr->path = NULL;
                }
        }
@@ -1458,7 +1459,8 @@ static void bgp_pbr_flush_entry(struct bgp *bgp, struct bgp_pbr_action *bpa,
                        /* unlink path to bpme */
                        path = (struct bgp_path_info *)bpme->path;
                        extra = bgp_path_info_extra_get(path);
-                       listnode_delete(extra->bgp_fs_pbr, bpme);
+                       if (extra->bgp_fs_pbr)
+                               listnode_delete(extra->bgp_fs_pbr, bpme);
                        bpme->path = NULL;
                }
        }
@@ -2065,8 +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 && 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",
@@ -2213,7 +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 && 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",