Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351381
b: refs/heads/master
c: 3867517
h: refs/heads/master
i:
  351379: 32847bb
v: v3
  • Loading branch information
YOSHIFUJI Hideaki / 吉藤英明 authored and David S. Miller committed Jan 14, 2013
1 parent 7cf5d8b commit 2c76e9c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ef973320349cd536b33427aed98512e532d4cc6
refs/heads/master: 38675170e4235f859bb85564c33ffa077a1c1ef7
26 changes: 26 additions & 0 deletions trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,31 @@ static inline bool ipv6_addr_equal(const struct in6_addr *a1,
#endif
}

#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
static inline bool __ipv6_prefix_equal64_half(const __be64 *a1,
const __be64 *a2,
unsigned int len)
{
if (len && ((*a1 ^ *a2) & cpu_to_be64(~0UL) << (64 - len)))
return false;
return true;
}

static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
const struct in6_addr *addr2,
unsigned int prefixlen)
{
const __be64 *a1 = (const __be64 *)addr1;
const __be64 *a2 = (const __be64 *)addr2;

if (prefixlen >= 64) {
if (a1[0] ^ a2[0])
return false;
return __ipv6_prefix_equal64_half(a1 + 1, a2 + 1, prefixlen - 64);
}
return __ipv6_prefix_equal64_half(a1, a2, prefixlen);
}
#else
static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
const struct in6_addr *addr2,
unsigned int prefixlen)
Expand All @@ -419,6 +444,7 @@ static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,

return true;
}
#endif

struct inet_frag_queue;

Expand Down

0 comments on commit 2c76e9c

Please sign in to comment.