Subject: Re: [PATCH net-next 4/5] net: Refactor inetpeer address struct

From: David Ahern <[email-masked]>
Date: Thu, 27 Aug 2015 15:52:39 -0700

On 8/27/15 2:16 PM, David Ahern wrote:
> @@ -124,12 +122,12 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
>   static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
>   				    const struct inetpeer_addr *b)
>   {
> -	int i, n = (a->family == AF_INET ? 1 : 4);
> +	int i, n = (a->family == AF_INET ? sizeof(a->a4) : sizeof(a->a6));

Forgot the / by sizeof(u32) (key size) in this version of the patches. 
v2 coming.

>
>   	for (i = 0; i < n; i++) {
> -		if (a->addr.a6[i] == b->addr.a6[i])
> +		if (a->key[i] == b->key[i])
>   			continue;
> -		if ((__force u32)a->addr.a6[i] < (__force u32)b->addr.a6[i])
> +		if (a->key[i] < b->key[i])
>   			return -1;
>   		return 1;
>   	}
>