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:
parent
814a178413
commit
ae3e13373b
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue