summaryrefslogtreecommitdiffstats
path: root/src/plugins/gtpu/gtpu.c
diff options
context:
space:
mode:
authorHuawei LI <lihuawei_zzu@163.com>2022-09-29 11:28:12 +0800
committerNeale Ranns <neale@graphiant.com>2022-10-11 03:37:36 +0000
commit06923b33a9507ee6a92facb770650fff93d89dff (patch)
tree2952b05f1a800a7ed4cc07111c62ccb037471498 /src/plugins/gtpu/gtpu.c
parent23b33ec02bb08b5998d3b2ba7c6ef7d4737424c6 (diff)
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 <lihuawei_zzu@163.com>
Diffstat (limited to 'src/plugins/gtpu/gtpu.c')
-rw-r--r--src/plugins/gtpu/gtpu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/gtpu/gtpu.c b/src/plugins/gtpu/gtpu.c
index 086a4b55f63..d3a2f05dd18 100644
--- a/src/plugins/gtpu/gtpu.c
+++ b/src/plugins/gtpu/gtpu.c
@@ -473,7 +473,8 @@ int vnet_gtpu_add_mod_del_tunnel
fib_prefix_t tun_dst_pfx;
vnet_flood_class_t flood_class = VNET_FLOOD_CLASS_TUNNEL_NORMAL;
- fib_prefix_from_ip46_addr (&t->dst, &tun_dst_pfx);
+ fib_protocol_t fp = fib_ip_proto (is_ip6);
+ fib_prefix_from_ip46_addr (fp, &t->dst, &tun_dst_pfx);
if (!ip46_address_is_multicast (&t->dst))
{
/* Unicast tunnel -
@@ -497,8 +498,6 @@ int vnet_gtpu_add_mod_del_tunnel
* with different VNIs, create the output adjacency only if
* it does not already exist
*/
- fib_protocol_t fp = fib_ip_proto (is_ip6);
-
if (vtep_addr_ref (&gtm->vtep_table,
t->encap_fib_index, &t->dst) == 1)
{