summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorElias Rudberg <elias.rudberg@bahnhof.net>2020-06-04 00:15:45 +0200
committerNeale Ranns <nranns@cisco.com>2020-08-20 08:56:37 +0000
commit224735bf090cde43827499405f663f859f82e161 (patch)
treeca1f0cf0ac4f8452c662226cb4b5247e47cab474 /src/vnet/ip
parent9f57c72e27e21ce8dc8ebfee059711e3102d0c6b (diff)
ip: vnet_ip_mroute_cmd payload_proto fix
Make sure payload_proto variable is set properly in vnet_ip_mroute_cmd() function. This avoids using an uninitialized payload_proto value which could lead to assertion failure when using e.g. the ip mroute add command. Type: fix Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net> Change-Id: I8b1d1df02e80150836b7b0448814d8f99747eeed
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/lookup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c
index 5d4e137fb1c..63bd281a325 100644
--- a/src/vnet/ip/lookup.c
+++ b/src/vnet/ip/lookup.c
@@ -699,7 +699,7 @@ vnet_ip_mroute_cmd (vlib_main_t * vm,
&pfx.fp_src_addr.ip4,
unformat_ip4_address, &pfx.fp_grp_addr.ip4))
{
- pfx.fp_proto = FIB_PROTOCOL_IP4;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP4;
pfx.fp_len = 64;
}
else if (unformat (line_input, "%U %U",
@@ -707,7 +707,7 @@ vnet_ip_mroute_cmd (vlib_main_t * vm,
&pfx.fp_src_addr.ip6,
unformat_ip6_address, &pfx.fp_grp_addr.ip6))
{
- pfx.fp_proto = FIB_PROTOCOL_IP6;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP6;
pfx.fp_len = 256;
}
else if (unformat (line_input, "%U/%d",
@@ -715,27 +715,27 @@ vnet_ip_mroute_cmd (vlib_main_t * vm,
&pfx.fp_grp_addr.ip4, &pfx.fp_len))
{
clib_memset (&pfx.fp_src_addr.ip4, 0, sizeof (pfx.fp_src_addr.ip4));
- pfx.fp_proto = FIB_PROTOCOL_IP4;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP4;
}
else if (unformat (line_input, "%U/%d",
unformat_ip6_address,
&pfx.fp_grp_addr.ip6, &pfx.fp_len))
{
clib_memset (&pfx.fp_src_addr.ip6, 0, sizeof (pfx.fp_src_addr.ip6));
- pfx.fp_proto = FIB_PROTOCOL_IP6;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP6;
}
else if (unformat (line_input, "%U",
unformat_ip4_address, &pfx.fp_grp_addr.ip4))
{
clib_memset (&pfx.fp_src_addr.ip4, 0, sizeof (pfx.fp_src_addr.ip4));
- pfx.fp_proto = FIB_PROTOCOL_IP4;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP4;
pfx.fp_len = 32;
}
else if (unformat (line_input, "%U",
unformat_ip6_address, &pfx.fp_grp_addr.ip6))
{
clib_memset (&pfx.fp_src_addr.ip6, 0, sizeof (pfx.fp_src_addr.ip6));
- pfx.fp_proto = FIB_PROTOCOL_IP6;
+ payload_proto = pfx.fp_proto = FIB_PROTOCOL_IP6;
pfx.fp_len = 128;
}
else if (unformat (line_input, "via local Forward"))