diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/ipv6.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3b1d963d396c..c893a1ce4b39 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -282,6 +282,18 @@ static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr | |||
| 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static inline int | ||
| 286 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | ||
| 287 | const struct in6_addr *a2) | ||
| 288 | { | ||
| 289 | unsigned int i; | ||
| 290 | |||
| 291 | for (i = 0; i < 4; i++) | ||
| 292 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | ||
| 293 | return 1; | ||
| 294 | return 0; | ||
| 295 | } | ||
| 296 | |||
| 285 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 297 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
| 286 | { | 298 | { |
| 287 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 299 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
