mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
erspan: Check IFLA_GRE_ERSPAN_VER is set.
commit51fa960d3bupstream. Add a check to make sure the IFLA_GRE_ERSPAN_VER is provided by users. Fixes:f989d546a2("erspan: Add type I version 0 support.") Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7f12ecf453
commit
61206032d6
@@ -1106,7 +1106,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 */
|
||||
|
||||
Reference in New Issue
Block a user