summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@yandex-team.ru>2022-09-16 17:01:00 +0000
committerNeale Ranns <neale@graphiant.com>2022-09-19 01:46:57 +0000
commita58dae61aea7e781a27ce65462dd38ab55e8599c (patch)
treea4274eaf16724c1c3bd8227406fe0d20b3ccac98 /src
parent755b529c11d37f839dfba91127657a47390b88a2 (diff)
igmp: validate ip router alert option length
It's known there're one or more 32-bit increments in the ip header. So just check ip router alert option length with minimal performance impact, and don't care of the total options length. Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru> Change-Id: I46dd06516f793846b931a1dc8612f2735f8d24d3
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ip/ip4_options.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_options.c b/src/vnet/ip/ip4_options.c
index 9b01151a1f0..6ef6b6030cc 100644
--- a/src/vnet/ip/ip4_options.c
+++ b/src/vnet/ip/ip4_options.c
@@ -78,6 +78,11 @@ VLIB_NODE_FN (ip4_options_node) (vlib_main_t * vm,
{
case IP4_ROUTER_ALERT_OPTION:
/*
+ * check the option length
+ */
+ if (options[1] != 4)
+ break;
+ /*
* if it's an IGMP packet, pass up the local stack
*/
if (IP_PROTOCOL_IGMP == ip4->protocol)