--- zzzz-none-000/linux-4.4.60/include/net/inet_hashtables.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/include/net/inet_hashtables.h 2021-02-04 17:41:59.000000000 +0000 @@ -35,6 +35,10 @@ #include #include +#ifdef CONFIG_AVM_PA +#include +#endif + /* This is for all connections with a full identity, no wildcards. * The 'e' prefix stands for Establish, but we really put all sockets * but LISTEN ones. @@ -335,11 +339,18 @@ const struct iphdr *iph = ip_hdr(skb); if (sk) - return sk; - else - return __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, + goto out; + + sk = __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, iph->saddr, sport, iph->daddr, dport, inet_iif(skb)); + +out: +#ifdef CONFIG_AVM_PA + if (sk) + avm_pa_add_local_session(skb, sk); +#endif + return sk; } u32 sk_ehashfn(const struct sock *sk);