Commit 9716178a authored by Jonas Bonn's avatar Jonas Bonn Committed by Jakub Kicinski

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: default avatarJonas Bonn <jonas@norrbonn.se>
Acked-by: default avatarHarald Welte <laforge@gnumonks.org>
Acked-by: default avatarPravin B Shelar <pshelar@ovn.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 29f53b5c
......@@ -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. */
......
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