[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55DF94B7.5000605@cumulusnetworks.com>
Date: Thu, 27 Aug 2015 15:52:39 -0700
From: David Ahern <dsa@...ulusnetworks.com>
To: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 4/5] net: Refactor inetpeer address struct
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;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists