mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 22:44:27 +08:00
gtp: update rx_length_errors for abnormally short packets
Based on work by Pravin Shelar. Update appropriate stats when packet transmission isn't possible. Signed-off-by: Jonas Bonn <jonas@norrbonn.se> Acked-by: Harald Welte <laforge@gnumonks.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
29f53b5c00
commit
9716178a3a
@ -189,8 +189,10 @@ static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
|
||||
|
||||
/* Get rid of the GTP + UDP headers. */
|
||||
if (iptunnel_pull_header(skb, hdrlen, skb->protocol,
|
||||
!net_eq(sock_net(pctx->sk), dev_net(pctx->dev))))
|
||||
return -1;
|
||||
!net_eq(sock_net(pctx->sk), dev_net(pctx->dev)))) {
|
||||
pctx->dev->stats.rx_length_errors++;
|
||||
goto err;
|
||||
}
|
||||
|
||||
netdev_dbg(pctx->dev, "forwarding packet from GGSN to uplink\n");
|
||||
|
||||
@ -206,6 +208,10 @@ static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
|
||||
|
||||
netif_rx(skb);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
pctx->dev->stats.rx_dropped++;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* 1 means pass up to the stack, -1 means drop and 0 means decapsulated. */
|
||||
|
Loading…
Reference in New Issue
Block a user