--- zzzz-none-000/linux-4.9.231/net/ipv6/tcp_ipv6.c 2020-07-22 07:10:54.000000000 +0000 +++ falcon-5590-729/linux-4.9.231/net/ipv6/tcp_ipv6.c 2022-03-30 12:03:35.000000000 +0000 @@ -69,6 +69,10 @@ #include #include +#ifdef CONFIG_AVM_PA +#include +#endif + static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb); static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, struct request_sock *req); @@ -238,6 +242,7 @@ fl6.flowi6_mark = sk->sk_mark; fl6.fl6_dport = usin->sin6_port; fl6.fl6_sport = inet->inet_sport; + fl6.flowi6_uid = sk->sk_uid; opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk)); final_p = fl6_update_dst(&fl6, opt, &final); @@ -404,7 +409,7 @@ if (!sock_owned_by_user(sk)) tcp_v6_mtu_reduced(sk); else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, - &tp->tsq_flags)) + &sk->sk_tsq_flags)) sock_hold(sk); goto out; } @@ -835,6 +840,7 @@ fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark); fl6.fl6_dport = t1->dest; fl6.fl6_sport = t1->source; + fl6.flowi6_uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); /* Pass a socket to ip6_dst_lookup either it is for RST @@ -1419,6 +1425,10 @@ goto no_tcp_socket; process: +#ifdef CONFIG_AVM_PA + avm_pa_add_local_session(skb, sk); +#endif + if (sk->sk_state == TCP_TIME_WAIT) goto do_time_wait;