diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-08-26 10:23:12 +0200 |
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-08-26 10:29:12 +0200 |
| commit | a152692f5ac207b5f55104b18ddc3146089db474 (patch) | |
| tree | 87f14bfc21b0e257723e825f07229f565b4d4a42 /bgpd/bgp_zebra.c | |
| parent | f85dfb3f1a66c4e6085162451583e764e2c41a25 (diff) | |
bgpd: fix labels static-analyser
Fix static-analyser warnings with BGP labels:
> $ scan-build make -j12
> bgpd/bgp_updgrp_packet.c:819:10: warning: Access to field 'extra' results in a dereference of a null pointer (loaded from variable 'path') [core.NullDereference]
> ? &path->extra->labels->label[0]
> ^~~~~~~~~
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_zebra.c')
| -rw-r--r-- | bgpd/bgp_zebra.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 2d9100b895..6e2efabf8f 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1311,7 +1311,7 @@ static void bgp_zebra_announce_parse_nexthop( api_nh->srte_color = bgp_attr_get_color(info->attr); if (bgp_debug_zebra(&api->prefix)) { - if (bgp_path_info_num_labels(mpinfo)) { + if (BGP_PATH_INFO_NUM_LABELS(mpinfo)) { zlog_debug("%s: p=%pFX, bgp_is_valid_label: %d", __func__, p, bgp_is_valid_label( @@ -1385,7 +1385,7 @@ static void bgp_zebra_announce_parse_nexthop( mpinfo->peer->sort == BGP_PEER_CONFED)) *allow_recursion = true; - num_labels = bgp_path_info_num_labels(mpinfo); + num_labels = BGP_PATH_INFO_NUM_LABELS(mpinfo); labels = num_labels ? mpinfo->extra->labels->label : NULL; if (num_labels && (is_evpn || bgp_is_valid_label(&labels[0]))) { |
