[PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one

2017-01-17 Thread Josef Bacik
We pass these per-protocol equal functions around in various places, but we can just have one function that checks the sk->sk_family and then do the right comparison function. I've also changed the ipv4 version to not cast to inet_sock since it is unneeded. Signed-off-by: Josef Bacik --- includ

Re: [PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one

2017-01-12 Thread Josef Bacik
On Thu, Jan 12, 2017 at 12:41 PM, Craig Gallek wrote: On Wed, Jan 11, 2017 at 3:19 PM, Josef Bacik wrote: +int inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, +bool match_wildcard) +{ +#if IS_ENABLED(CONFIG_IPV6) + if (sk->sk_family == AF

Re: [PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one

2017-01-12 Thread Craig Gallek
On Wed, Jan 11, 2017 at 3:19 PM, Josef Bacik wrote: > +int inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, > +bool match_wildcard) > +{ > +#if IS_ENABLED(CONFIG_IPV6) > + if (sk->sk_family == AF_INET6) Still wrapping my head around this, so take it

[PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one

2017-01-11 Thread Josef Bacik
We pass these per-protocol equal functions around in various places, but we can just have one function that checks the sk->sk_family and then do the right comparison function. I've also changed the ipv4 version to not cast to inet_sock since it is unneeded. Signed-off-by: Josef Bacik --- includ

[PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one

2016-12-22 Thread Josef Bacik
We pass these per-protocol equal functions around in various places, but we can just have one function that checks the sk->sk_family and then do the right comparison function. I've also changed the ipv4 version to not cast to inet_sock since it is unneeded. Signed-off-by: Josef Bacik --- includ