--- zzzz-none-000/linux-4.4.271/net/l2tp/l2tp_core.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/net/l2tp/l2tp_core.c 2023-01-11 09:25:44.000000000 +0000 @@ -430,6 +430,30 @@ } EXPORT_SYMBOL_GPL(l2tp_tunnel_find_nth); +void l2tp_stats_update(struct l2tp_tunnel *tunnel, + struct l2tp_session *session, + struct l2tp_stats *stats) +{ + atomic_long_add(atomic_long_read(&stats->rx_packets), + &tunnel->stats.rx_packets); + atomic_long_add(atomic_long_read(&stats->rx_bytes), + &tunnel->stats.rx_bytes); + atomic_long_add(atomic_long_read(&stats->tx_packets), + &tunnel->stats.tx_packets); + atomic_long_add(atomic_long_read(&stats->tx_bytes), + &tunnel->stats.tx_bytes); + + atomic_long_add(atomic_long_read(&stats->rx_packets), + &session->stats.rx_packets); + atomic_long_add(atomic_long_read(&stats->rx_bytes), + &session->stats.rx_bytes); + atomic_long_add(atomic_long_read(&stats->tx_packets), + &session->stats.tx_packets); + atomic_long_add(atomic_long_read(&stats->tx_bytes), + &session->stats.tx_bytes); +} +EXPORT_SYMBOL_GPL(l2tp_stats_update); + /***************************************************************************** * Receive data handling *****************************************************************************/ @@ -1195,7 +1219,7 @@ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | IPSKB_REROUTED); - nf_reset(skb); + nf_reset_no_generic_ct(skb); bh_lock_sock(sk); if (sock_owned_by_user(sk)) { @@ -1259,7 +1283,6 @@ l2tp_info(tunnel, L2TP_MSG_CONTROL, "%s: closing...\n", tunnel->name); - /* Disable udp encapsulation */ switch (tunnel->encap) { case L2TP_ENCAPTYPE_UDP: