diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-10-26 11:33:30 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-01-24 08:52:31 +0000 |
commit | 08f843e562de923c8521a4d1d388fbb6d33c3fcf (patch) | |
tree | b9d9faef6a384770da570e13a3d883cdaa585a1c | |
parent | 63c31e0a609bb3fe5cd61b05dac7b790a9282b8d (diff) |
ip6-nd: fix coverity warning
Restructure code to avoid NULL dereference.
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: If3a4319f1b93af272b7b315a9b15ba4ee1f8e7ae
-rw-r--r-- | src/vnet/ip6-nd/ip6_ra.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vnet/ip6-nd/ip6_ra.c b/src/vnet/ip6-nd/ip6_ra.c index d3597706293..dac5ec09937 100644 --- a/src/vnet/ip6-nd/ip6_ra.c +++ b/src/vnet/ip6-nd/ip6_ra.c @@ -413,12 +413,9 @@ icmp6_router_solicitation (vlib_main_t * vm, radv_info = ip6_ra_get_itf (sw_if_index0); - error0 = ((!radv_info) ? - ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : - error0); - error0 = radv_info->send_radv == 0 ? - ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : - error0; + error0 = ((!radv_info || 0 == radv_info->send_radv) ? + ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : + error0); if (error0 == ICMP6_ERROR_NONE) { f64 now = vlib_time_now (vm); |