erspan: Check IFLA_GRE_ERSPAN_VER is set.
Subsystems (3)
PATCH 1/1 erspan: Check IFLA_GRE_ERSPAN_VER is set.
Add a check to make sure the IFLA_GRE_ERSPAN_VER is provided by users.
Fixes f989d546a2d5 ("erspan: Add type I version 0 support.")
Cc Eric Dumazet <[email protected]>
Signed-off-by William Tu <[email protected]>
--- net/ipv4/ip_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/ip_gre.c +2 -1
@@ -1087,7 +1087,8 @@ static int erspan_validate(struct nlattr *tb[], struct nlattr *data[],if (ret)return ret; -if (nla_get_u8 (data[IFLA_GRE_ERSPAN_VER ]) ==0 ) +if (data[IFLA_GRE_ERSPAN_VER ] && +nla_get_u8 (data[IFLA_GRE_ERSPAN_VER ]) ==0 )return 0 ;/* ERSPAN type II/III should only have GRE sequence and key flag */
Signature · 1 line
2.7.4
Quoted 6 lines · William Tu
Add a check to make sure the
IFLA_GRE_ERSPAN_VERis provided by users.Fixes f989d546a2d5 ("erspan: Add type I version 0 support.")Cc Eric Dumazet <[email protected]>Signed-off-by William Tu <[email protected]>---
Reviewed-by Eric Dumazet <[email protected]>
Thanks.
From: William Tu <[email protected]>
Date: Tue, 12 May 2020 10:36:23 -0700
Quoted 5 lines
Add a check to make sure the
IFLA_GRE_ERSPAN_VERis provided by users.Fixes f989d546a2d5 ("erspan: Add type I version 0 support.")Cc Eric Dumazet <[email protected]>Signed-off-by William Tu <[email protected]>
Applied, thanks.