aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_gre.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 2a83591492dd..855004f08325 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -503,10 +503,11 @@ static int ipgre_tunnel_ioctl(struct net_device *dev,
503 503
504 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) 504 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p)))
505 return -EFAULT; 505 return -EFAULT;
506 if (p.iph.version != 4 || p.iph.protocol != IPPROTO_GRE || 506 if (cmd == SIOCADDTUNNEL || cmd == SIOCCHGTUNNEL) {
507 p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF)) || 507 if (p.iph.version != 4 || p.iph.protocol != IPPROTO_GRE ||
508 ((p.i_flags|p.o_flags)&(GRE_VERSION|GRE_ROUTING))) { 508 p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF)) ||
509 return -EINVAL; 509 ((p.i_flags|p.o_flags)&(GRE_VERSION|GRE_ROUTING)))
510 return -EINVAL;
510 } 511 }
511 p.i_flags = gre_flags_to_tnl_flags(p.i_flags); 512 p.i_flags = gre_flags_to_tnl_flags(p.i_flags);
512 p.o_flags = gre_flags_to_tnl_flags(p.o_flags); 513 p.o_flags = gre_flags_to_tnl_flags(p.o_flags);