Skip to content

Commit

Permalink
sit: fix an oops when IFLA_IPTUN_PROTO is not set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Jun 20, 2013
1 parent eea86af commit c2ff682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/sit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ static int ipip6_validate(struct nlattr *tb[], struct nlattr *data[])
{
u8 proto;

if (!data)
if (!data || !data[IFLA_IPTUN_PROTO])
return 0;

proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);
Expand Down

0 comments on commit c2ff682

Please sign in to comment.