aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/ip_tunnel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 2f498f87e3d8..d3e447936720 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -573,6 +573,9 @@ int ip_tunnel_encap(struct sk_buff *skb, struct ip_tunnel *t,
573 if (t->encap.type == TUNNEL_ENCAP_NONE) 573 if (t->encap.type == TUNNEL_ENCAP_NONE)
574 return 0; 574 return 0;
575 575
576 if (t->encap.type >= MAX_IPTUN_ENCAP_OPS)
577 return -EINVAL;
578
576 rcu_read_lock(); 579 rcu_read_lock();
577 ops = rcu_dereference(iptun_encaps[t->encap.type]); 580 ops = rcu_dereference(iptun_encaps[t->encap.type]);
578 if (likely(ops && ops->build_header)) 581 if (likely(ops && ops->build_header))