From 982e633bfa41a6daf07003abf27459d1b975f4bc Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 3 May 2007 17:39:04 -0700 Subject: [PATCH] --- yaml --- r: 53495 b: refs/heads/master c: db3459d1a71d885334831cdca6646a48f5ea0483 h: refs/heads/master i: 53493: a27fecf135432d8bb33f730149ef4057eaab98ab 53491: 61e925cbdea6af0d838c9e2313aa65d187e68268 53487: 5dae2ecafbad778d45ae50ab2065e9147c8c9f1a v: v3 --- [refs] | 2 +- trunk/include/net/ipv6.h | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index a42f86e37003..8dda79897e31 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b40b4f79ce789e9e28d382c85006f62be2725282 +refs/heads/master: db3459d1a71d885334831cdca6646a48f5ea0483 diff --git a/trunk/include/net/ipv6.h b/trunk/include/net/ipv6.h index 2ce3941d8993..4fa5dfe886c4 100644 --- a/trunk/include/net/ipv6.h +++ b/trunk/include/net/ipv6.h @@ -204,9 +204,9 @@ struct ip6_flowlabel { struct ip6_flowlabel *next; __be32 label; + atomic_t users; struct in6_addr dst; struct ipv6_txoptions *opt; - atomic_t users; unsigned long linger; u8 share; u32 owner; @@ -291,7 +291,7 @@ static inline int ipv6_addr_src_scope(const struct in6_addr *addr) static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2) { - return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); + return memcmp(a1, a2, sizeof(struct in6_addr)); } static inline int @@ -308,7 +308,7 @@ ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) { - memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); + memcpy(a1, a2, sizeof(struct in6_addr)); } static inline void ipv6_addr_prefix(struct in6_addr *pfx, @@ -319,13 +319,10 @@ static inline void ipv6_addr_prefix(struct in6_addr *pfx, int o = plen >> 3, b = plen & 0x7; + memset(pfx->s6_addr, 0, sizeof(pfx->s6_addr)); memcpy(pfx->s6_addr, addr, o); - if (b != 0) { + if (b != 0) pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b); - o++; - } - if (o < 16) - memset(pfx->s6_addr + o, 0, 16 - o); } static inline void ipv6_addr_set(struct in6_addr *addr,