On Tue, Oct 17, 2017 at 8:32 AM, David Ahern <dsah...@gmail.com> wrote: > On 10/16/17 9:45 PM, Eric Dumazet wrote: >> IPV6 TCP uses sk->sk_v6_daddr and sk->->sk_v6_rcv_saddr > > I moved v2 to those. > >> So I would rather remove the need to fetch np = inet6_sk(sk) in the >> first place, and look at sk->sk_family instead. > > I'll spin a v3 with that change.
Note, with CONFIG_IPV6=n, inet6_sk() is just NULL and compiler could eliminate the if(NULL) branch, I doubt compiler could do same for sk->sk_family. Oh, BTW, I thought it is okay to use sk_v6_daddr in if (NULL) case (aka CONFIG_IPV6=n), but a quick test shows compiler still complains... so probably need #if IS_ENABLED(CONFIG_IPV6).