From 06923b33a9507ee6a92facb770650fff93d89dff Mon Sep 17 00:00:00 2001 From: Huawei LI Date: Thu, 29 Sep 2022 11:28:12 +0800 Subject: fib: fix crash when create vxlan/vxlan-gpe/geneve/gtpu tunnel. Fix vpp crash when create vxlan/vxlan-gpe/geneve/gtpu tunnel with 0.0.0.0 dst ip in debug build. The ASSERT should be move out of fib_prefix_from_ip46_addr, which may be called when create vxlan/vxlan-gpe/geneve/gtpu tunnel with 0.0.0.0 dst ip. How to reproduce: 1. build debug vpp and run vpp 2. create vxlan t src 192.168.0.2 dst 0.0.0.0 vni 1 instance 1 create vxlan-gpe tunnel local 192.168.0.2 remote 0.0.0.0 vni 1 create geneve tunnel local 192.168.0.2 remote 0.0.0.0 vni 1 create gtpu tunnel src 192.168.0.2 dst 0.0.0.0 teid 1 Type: fix Change-Id: I19972f6af588f4ff7fd17de1b16b9301e43d596f Signed-off-by: Huawei LI --- src/vnet/vxlan-gpe/vxlan_gpe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/vnet/vxlan-gpe') diff --git a/src/vnet/vxlan-gpe/vxlan_gpe.c b/src/vnet/vxlan-gpe/vxlan_gpe.c index a926847051f..5919e0f0dfd 100644 --- a/src/vnet/vxlan-gpe/vxlan_gpe.c +++ b/src/vnet/vxlan-gpe/vxlan_gpe.c @@ -594,7 +594,8 @@ int vnet_vxlan_gpe_add_del_tunnel fib_prefix_t tun_remote_pfx; vnet_flood_class_t flood_class = VNET_FLOOD_CLASS_TUNNEL_NORMAL; - fib_prefix_from_ip46_addr (&t->remote, &tun_remote_pfx); + fib_protocol_t fp = fib_ip_proto (is_ip6); + fib_prefix_from_ip46_addr (fp, &t->remote, &tun_remote_pfx); if (!ip46_address_is_multicast (&t->remote)) { /* Unicast tunnel - @@ -618,8 +619,6 @@ int vnet_vxlan_gpe_add_del_tunnel * with different VNIs, create the output fib adjacency only if * it does not already exist */ - fib_protocol_t fp = fib_ip_proto (is_ip6); - if (vtep_addr_ref (&ngm->vtep_table, t->encap_fib_index, &t->remote) == 1) { -- cgit 1.2.3-korg