summaryrefslogtreecommitdiff
path: root/pbrd/pbr_map.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-09-01 14:23:40 -0400
committerMark Stapp <mjs@voltanet.io>2020-09-01 14:23:40 -0400
commit9d0b324d5fe4163d39a43536d5730467a0a9655b (patch)
tree22c11bfd780e12efd9a1b10ee34cc7d551e9506d /pbrd/pbr_map.c
parent2e5b029865137c1aa383454d3552487a2b998ee4 (diff)
pbrd: fix SA warning in nhg map
Fix SA warnings in nhg map functions. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'pbrd/pbr_map.c')
-rw-r--r--pbrd/pbr_map.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index cce97b5dfb..058881cbfc 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -785,8 +785,13 @@ void pbr_map_check_vrf_nh_group_change(const char *nh_group,
if (pbrms->nhgrp_name)
continue;
- if (pbrms->nhg
- && strcmp(nh_group, pbrms->internal_nhg_name))
+ if (pbrms->nhg == NULL)
+ continue;
+
+ if (strcmp(nh_group, pbrms->internal_nhg_name))
+ continue;
+
+ if (pbrms->nhg->nexthop == NULL)
continue;
if (pbrms->nhg->nexthop->vrf_id != old_vrf_id)
@@ -810,8 +815,13 @@ void pbr_map_check_interface_nh_group_change(const char *nh_group,
if (pbrms->nhgrp_name)
continue;
- if (pbrms->nhg
- && strcmp(nh_group, pbrms->internal_nhg_name))
+ if (pbrms->nhg == NULL)
+ continue;
+
+ if (strcmp(nh_group, pbrms->internal_nhg_name))
+ continue;
+
+ if (pbrms->nhg->nexthop == NULL)
continue;
if (pbrms->nhg->nexthop->ifindex != oldifindex)