Skip to content

Commit c2ff682

Browse files
NicolasDichteldavem330
authored andcommitted
sit: fix an oops when IFLA_IPTUN_PROTO is not set
The use of this attribute has been added in 32b8a8e (sit: add IPv4 over IPv4 support). It is optional, by default proto is IPPROTO_IPV6. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent eea86af commit c2ff682

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/ipv6/sit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ static int ipip6_validate(struct nlattr *tb[], struct nlattr *data[])
12961296
{
12971297
u8 proto;
12981298

1299-
if (!data)
1299+
if (!data || !data[IFLA_IPTUN_PROTO])
13001300
return 0;
13011301

13021302
proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);

0 commit comments

Comments
 (0)