aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip6-nd/ip6_ra.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-10-26 11:33:30 +0200
committerBeno�t Ganne <bganne@cisco.com>2022-01-24 08:52:31 +0000
commit08f843e562de923c8521a4d1d388fbb6d33c3fcf (patch)
treeb9d9faef6a384770da570e13a3d883cdaa585a1c /src/vnet/ip6-nd/ip6_ra.c
parent63c31e0a609bb3fe5cd61b05dac7b790a9282b8d (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
Diffstat (limited to 'src/vnet/ip6-nd/ip6_ra.c')
-rw-r--r--src/vnet/ip6-nd/ip6_ra.c9
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);