Message ID | 20210123195916.2765481-13-jonas@norrbonn.se |
---|---|
State | Superseded |
Headers | show |
Series | GTP: flow based | expand |
On Sat, Jan 23, 2021 at 08:59:12PM +0100, Jonas Bonn wrote: > Signed-off-by: Jonas Bonn <jonas@norrbonn.se> Acked-by: Harald Welte <laforge@gnumonks.org> -- - Harald Welte <laforge@gnumonks.org> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 023d38b1098d..7ab8540e46d2 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -185,8 +185,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"); @@ -202,6 +204,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. */
Based on work by Pravin Shelar. Update appropriate stats when packet transmission isn't possible. Signed-off-by: Jonas Bonn <jonas@norrbonn.se> --- drivers/net/gtp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)