diff mbox

[net-next] sit: fix an oops when IFLA_IPTUN_PROTO is not set

Message ID 1371636193-4612-1-git-send-email-nicolas.dichtel@6wind.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas Dichtel June 19, 2013, 10:03 a.m. UTC
The use of this attribute has been added in 32b8a8e59c9c (sit: add IPv4 over
IPv4 support). It is optional, by default proto is IPPROTO_IPV6.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/sit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller June 20, 2013, 5:15 a.m. UTC | #1
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 19 Jun 2013 12:03:13 +0200

> The use of this attribute has been added in 32b8a8e59c9c (sit: add IPv4 over
> IPv4 support). It is optional, by default proto is IPPROTO_IPV6.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 6b9c1f12..a23b838 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1310,7 +1310,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]);