net: erspan: fix wrong return value

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

Fixes: 94d7d8f292 ("ip6_gre: add erspan v2 support")
Fixes: f551c91de2 ("net: erspan: introduce erspan v2 for ip_gre")
Signed-off-by: William Tu <u9012063@gmail.com>
Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Acked-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
William Tu 2017-12-15 14:27:43 -08:00 committed by David S. Miller
parent 814a178413
commit ae3e13373b
2 changed files with 2 additions and 2 deletions

View File

@ -287,7 +287,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
if (tunnel) {
len = gre_hdr_len + erspan_hdr_len(ver);
if (unlikely(!pskb_may_pull(skb, len)))
return -ENOMEM;
return PACKET_REJECT;
if (__iptunnel_pull_header(skb,
len,

View File

@ -524,7 +524,7 @@ static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len,
int len = erspan_hdr_len(ver);
if (unlikely(!pskb_may_pull(skb, len)))
return -ENOMEM;
return PACKET_REJECT;
if (__iptunnel_pull_header(skb, len,
htons(ETH_P_TEB),