diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 17:30:40 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 17:30:40 +0200 |
commit | ec6816a206cc20b42909932324ba6f6505e8c767 (patch) | |
tree | 771cdc62d1ab4fa8ad4a0ffef15f9a5a7946aedd /src | |
parent | c9956990d49e501696f9c9fdb9f1345381e6724a (diff) |
receive: netif_rx consumes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/receive.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/receive.c b/src/receive.c index 06be5f7..ed146d1 100644 --- a/src/receive.c +++ b/src/receive.c @@ -210,6 +210,7 @@ void packet_consume_data_done(struct sk_buff *skb, struct wireguard_peer *peer, struct net_device *dev; struct wireguard_peer *routed_peer; struct wireguard_device *wg; + unsigned int len; socket_set_peer_endpoint(peer, endpoint); @@ -265,8 +266,9 @@ void packet_consume_data_done(struct sk_buff *skb, struct wireguard_peer *peer, goto packet_processed; } + len = skb->len; if (likely(netif_rx(skb) == NET_RX_SUCCESS)) - rx_stats(peer, skb->len); + rx_stats(peer, len); else { ++dev->stats.rx_dropped; net_dbg_ratelimited("Failed to give packet to userspace from peer %Lu (%pISpfsc)\n", peer->internal_id, &peer->endpoint.addr); |