diff options
| author | Alexey Dobriyan <adobriyan@gmail.com> | 2011-11-20 22:39:03 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-11-22 16:43:32 -0500 |
| commit | 4e3fd7a06dc20b2d8ec6892233ad2012968fe7b6 (patch) | |
| tree | da3fbec7672ac6b967dfa31cec6c88f468a57fa2 /include | |
| parent | 40ba84993d66469d336099c5af74c3da5b73e28d (diff) | |
net: remove ipv6_addr_copy()
C assignment can handle struct in6_addr copying.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 2 | ||||
| -rw-r--r-- | include/net/inetpeer.h | 2 | ||||
| -rw-r--r-- | include/net/ip_vs.h | 8 | ||||
| -rw-r--r-- | include/net/ipv6.h | 5 | ||||
| -rw-r--r-- | include/net/xfrm.h | 4 |
5 files changed, 8 insertions, 13 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 3d8f9c44e27d..f15fd985b08a 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -237,7 +237,7 @@ static inline bool __rpc_copy_addr6(struct sockaddr *dst, | |||
| 237 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | 237 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; |
| 238 | 238 | ||
| 239 | dsin6->sin6_family = ssin6->sin6_family; | 239 | dsin6->sin6_family = ssin6->sin6_family; |
| 240 | ipv6_addr_copy(&dsin6->sin6_addr, &ssin6->sin6_addr); | 240 | dsin6->sin6_addr = ssin6->sin6_addr; |
| 241 | return true; | 241 | return true; |
| 242 | } | 242 | } |
| 243 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | 243 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 78c83e62218f..73a5c26c01ea 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -86,7 +86,7 @@ static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, | |||
| 86 | { | 86 | { |
| 87 | struct inetpeer_addr daddr; | 87 | struct inetpeer_addr daddr; |
| 88 | 88 | ||
| 89 | ipv6_addr_copy((struct in6_addr *)daddr.addr.a6, v6daddr); | 89 | *(struct in6_addr *)daddr.addr.a6 = *v6daddr; |
| 90 | daddr.family = AF_INET6; | 90 | daddr.family = AF_INET6; |
| 91 | return inet_getpeer(&daddr, create); | 91 | return inet_getpeer(&daddr, create); |
| 92 | } | 92 | } |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 873d5be7926c..48fd12e9d3af 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #include <linux/netfilter.h> /* for union nf_inet_addr */ | 21 | #include <linux/netfilter.h> /* for union nf_inet_addr */ |
| 22 | #include <linux/ip.h> | 22 | #include <linux/ip.h> |
| 23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
| 24 | #include <net/ipv6.h> /* for ipv6_addr_copy */ | 24 | #include <net/ipv6.h> |
| 25 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 25 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 26 | #include <net/netfilter/nf_conntrack.h> | 26 | #include <net/netfilter/nf_conntrack.h> |
| 27 | #endif | 27 | #endif |
| @@ -119,8 +119,8 @@ ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) | |||
| 119 | const struct ipv6hdr *iph = nh; | 119 | const struct ipv6hdr *iph = nh; |
| 120 | iphdr->len = sizeof(struct ipv6hdr); | 120 | iphdr->len = sizeof(struct ipv6hdr); |
| 121 | iphdr->protocol = iph->nexthdr; | 121 | iphdr->protocol = iph->nexthdr; |
| 122 | ipv6_addr_copy(&iphdr->saddr.in6, &iph->saddr); | 122 | iphdr->saddr.in6 = iph->saddr; |
| 123 | ipv6_addr_copy(&iphdr->daddr.in6, &iph->daddr); | 123 | iphdr->daddr.in6 = iph->daddr; |
| 124 | } else | 124 | } else |
| 125 | #endif | 125 | #endif |
| 126 | { | 126 | { |
| @@ -137,7 +137,7 @@ static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst, | |||
| 137 | { | 137 | { |
| 138 | #ifdef CONFIG_IP_VS_IPV6 | 138 | #ifdef CONFIG_IP_VS_IPV6 |
| 139 | if (af == AF_INET6) | 139 | if (af == AF_INET6) |
| 140 | ipv6_addr_copy(&dst->in6, &src->in6); | 140 | dst->in6 = src->in6; |
| 141 | else | 141 | else |
| 142 | #endif | 142 | #endif |
| 143 | dst->ip = src->ip; | 143 | dst->ip = src->ip; |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3f0258d2ef01..f35188e002d9 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -309,11 +309,6 @@ ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | |||
| 309 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])); | 309 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])); |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | ||
| 313 | { | ||
| 314 | memcpy(a1, a2, sizeof(struct in6_addr)); | ||
| 315 | } | ||
| 316 | |||
| 317 | static inline void ipv6_addr_prefix(struct in6_addr *pfx, | 312 | static inline void ipv6_addr_prefix(struct in6_addr *pfx, |
| 318 | const struct in6_addr *addr, | 313 | const struct in6_addr *addr, |
| 319 | int plen) | 314 | int plen) |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 4de7ed9016d9..89174e29dca9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -1217,8 +1217,8 @@ void xfrm_flowi_addr_get(const struct flowi *fl, | |||
| 1217 | memcpy(&daddr->a4, &fl->u.ip4.daddr, sizeof(daddr->a4)); | 1217 | memcpy(&daddr->a4, &fl->u.ip4.daddr, sizeof(daddr->a4)); |
| 1218 | break; | 1218 | break; |
| 1219 | case AF_INET6: | 1219 | case AF_INET6: |
| 1220 | ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->u.ip6.saddr); | 1220 | *(struct in6_addr *)saddr->a6 = fl->u.ip6.saddr; |
| 1221 | ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->u.ip6.daddr); | 1221 | *(struct in6_addr *)daddr->a6 = fl->u.ip6.daddr; |
| 1222 | break; | 1222 | break; |
| 1223 | } | 1223 | } |
| 1224 | } | 1224 | } |
