Commit ae3e1337 authored by William Tu's avatar William Tu Committed by David S. Miller

net: erspan: fix wrong return value

If pskb_may_pull return failed, return PACKET_REJECT
instead of -ENOMEM.

Fixes: 94d7d8f2 ("ip6_gre: add erspan v2 support")
Fixes: f551c91d ("net: erspan: introduce erspan v2 for ip_gre")
Signed-off-by: default avatarWilliam Tu <u9012063@gmail.com>
Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Acked-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 814a1784
...@@ -287,7 +287,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, ...@@ -287,7 +287,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
if (tunnel) { if (tunnel) {
len = gre_hdr_len + erspan_hdr_len(ver); len = gre_hdr_len + erspan_hdr_len(ver);
if (unlikely(!pskb_may_pull(skb, len))) if (unlikely(!pskb_may_pull(skb, len)))
return -ENOMEM; return PACKET_REJECT;
if (__iptunnel_pull_header(skb, if (__iptunnel_pull_header(skb,
len, len,
......
...@@ -524,7 +524,7 @@ static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len, ...@@ -524,7 +524,7 @@ static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len,
int len = erspan_hdr_len(ver); int len = erspan_hdr_len(ver);
if (unlikely(!pskb_may_pull(skb, len))) if (unlikely(!pskb_may_pull(skb, len)))
return -ENOMEM; return PACKET_REJECT;
if (__iptunnel_pull_header(skb, len, if (__iptunnel_pull_header(skb, len,
htons(ETH_P_TEB), htons(ETH_P_TEB),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment