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/rfapi/rfapi_rib.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/rfapi/rfapi_rib.c')
| -rw-r--r-- | bgpd/rfapi/rfapi_rib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index a0bdf4961f..53e416b2ee 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -692,7 +692,7 @@ static void rfapiRibBi2Ri(struct bgp_path_info *bpi, struct rfapi_info *ri, /* label comes from MP_REACH_NLRI label */ vo->v.l2addr.label = - bgp_path_info_num_labels(bpi) + BGP_PATH_INFO_NUM_LABELS(bpi) ? decode_label(&bpi->extra->labels->label[0]) : MPLS_INVALID_LABEL; |
