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>
This commit is contained in:
committed by
David S. Miller
parent
40ba84993d
commit
4e3fd7a06d
@@ -86,7 +86,7 @@ static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr,
|
||||
{
|
||||
struct inetpeer_addr daddr;
|
||||
|
||||
ipv6_addr_copy((struct in6_addr *)daddr.addr.a6, v6daddr);
|
||||
*(struct in6_addr *)daddr.addr.a6 = *v6daddr;
|
||||
daddr.family = AF_INET6;
|
||||
return inet_getpeer(&daddr, create);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <linux/netfilter.h> /* for union nf_inet_addr */
|
||||
#include <linux/ip.h>
|
||||
#include <linux/ipv6.h> /* for struct ipv6hdr */
|
||||
#include <net/ipv6.h> /* for ipv6_addr_copy */
|
||||
#include <net/ipv6.h>
|
||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#endif
|
||||
@@ -119,8 +119,8 @@ ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr)
|
||||
const struct ipv6hdr *iph = nh;
|
||||
iphdr->len = sizeof(struct ipv6hdr);
|
||||
iphdr->protocol = iph->nexthdr;
|
||||
ipv6_addr_copy(&iphdr->saddr.in6, &iph->saddr);
|
||||
ipv6_addr_copy(&iphdr->daddr.in6, &iph->daddr);
|
||||
iphdr->saddr.in6 = iph->saddr;
|
||||
iphdr->daddr.in6 = iph->daddr;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@@ -137,7 +137,7 @@ static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst,
|
||||
{
|
||||
#ifdef CONFIG_IP_VS_IPV6
|
||||
if (af == AF_INET6)
|
||||
ipv6_addr_copy(&dst->in6, &src->in6);
|
||||
dst->in6 = src->in6;
|
||||
else
|
||||
#endif
|
||||
dst->ip = src->ip;
|
||||
|
||||
@@ -309,11 +309,6 @@ ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
|
||||
((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]));
|
||||
}
|
||||
|
||||
static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
|
||||
{
|
||||
memcpy(a1, a2, sizeof(struct in6_addr));
|
||||
}
|
||||
|
||||
static inline void ipv6_addr_prefix(struct in6_addr *pfx,
|
||||
const struct in6_addr *addr,
|
||||
int plen)
|
||||
|
||||
@@ -1217,8 +1217,8 @@ void xfrm_flowi_addr_get(const struct flowi *fl,
|
||||
memcpy(&daddr->a4, &fl->u.ip4.daddr, sizeof(daddr->a4));
|
||||
break;
|
||||
case AF_INET6:
|
||||
ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->u.ip6.saddr);
|
||||
ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->u.ip6.daddr);
|
||||
*(struct in6_addr *)saddr->a6 = fl->u.ip6.saddr;
|
||||
*(struct in6_addr *)daddr->a6 = fl->u.ip6.daddr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user