Skip to content
Commit fdf9ef89 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'listen_refactor_part_13'



Eric Dumazet says:

====================
inet: tcp listener refactoring, part 13

inet_hash functions are in a bad state : Too much IPv6/IPv4 copy/pasting.

Lets refactor a bit.

Idea is that we do not want to have an equivalent of inet_csk(sk)->icsk_af_ops
for request socks in order to be able to use the right variant.

In this patch series, I started to let IPv6/IPv4 converge to common helpers.

Idea is to use ipv6_addr_set_v4mapped() even for AF_INET sockets, so that
we can test
       if (sk->sk_family == AF_INET6 &&
           !ipv6_addr_v4mapped(&sk->sk_v6_daddr))
to tell if we deal with an IPv6 socket, or IPv4 one, at least in slow paths.

Ideally, we could save 8 bytes per struct sock_common, if we
alias skc_daddr & skc_rcv_saddr to skc_v6_daddr[3]/skc_v6_rcv_saddr[3].
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8f6320de 08d2cc3b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment