From ac55a722d67c7354f2ab877ff79309027f7ac3ca Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Thu, 7 Oct 2021 17:37:07 +0200 Subject: ipsec: fix protect update log if nexthop is NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If logging is on, it will try to print the address nh. Make sure it is not NULL. Type: fix Change-Id: I81c0295865901406d86e0d822a103b4d5adffe47 Signed-off-by: Benoît Ganne --- src/vnet/ipsec/ipsec_tun.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/vnet/ipsec') diff --git a/src/vnet/ipsec/ipsec_tun.c b/src/vnet/ipsec/ipsec_tun.c index 58f9efefdc4..1a9a25783ae 100644 --- a/src/vnet/ipsec/ipsec_tun.c +++ b/src/vnet/ipsec/ipsec_tun.c @@ -569,6 +569,9 @@ ipsec_tun_protect_update (u32 sw_if_index, ipsec_main_t *im; int rv; + if (NULL == nh) + nh = &IP_ADDR_ALL_0; + ITP_DBG2 ("update: %U/%U", format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, format_ip_address, nh); @@ -581,8 +584,6 @@ ipsec_tun_protect_update (u32 sw_if_index, rv = 0; im = &ipsec_main; - if (NULL == nh) - nh = &IP_ADDR_ALL_0; itpi = ipsec_tun_protect_find (sw_if_index, nh); vec_foreach_index (ii, sas_in) -- cgit 1.2.3-korg