aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2011-11-20 22:39:03 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-22 16:43:32 -0500
commit4e3fd7a06dc20b2d8ec6892233ad2012968fe7b6 (patch)
treeda3fbec7672ac6b967dfa31cec6c88f468a57fa2 /net/netfilter
parent40ba84993d66469d336099c5af74c3da5b73e28d (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 'net/netfilter')
-rw-r--r--net/netfilter/ipset/ip_set_hash_ip.c2
-rw-r--r--net/netfilter/ipset/ip_set_hash_net.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_sync.c6
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c10
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c4
-rw-r--r--net/netfilter/xt_TCPMSS.c2
-rw-r--r--net/netfilter/xt_addrtype.c2
8 files changed, 15 insertions, 15 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_ip.c b/net/netfilter/ipset/ip_set_hash_ip.c
index f2d576e6b769..4015fcaf87bc 100644
--- a/net/netfilter/ipset/ip_set_hash_ip.c
+++ b/net/netfilter/ipset/ip_set_hash_ip.c
@@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_ip6_elem *elem)
241static inline void 241static inline void
242hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src) 242hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src)
243{ 243{
244 ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); 244 dst->ip.in6 = src->ip.in6;
245} 245}
246 246
247static inline void 247static inline void
diff --git a/net/netfilter/ipset/ip_set_hash_net.c b/net/netfilter/ipset/ip_set_hash_net.c
index 60d016541c58..28988196775e 100644
--- a/net/netfilter/ipset/ip_set_hash_net.c
+++ b/net/netfilter/ipset/ip_set_hash_net.c
@@ -267,7 +267,7 @@ static inline void
267hash_net6_data_copy(struct hash_net6_elem *dst, 267hash_net6_data_copy(struct hash_net6_elem *dst,
268 const struct hash_net6_elem *src) 268 const struct hash_net6_elem *src)
269{ 269{
270 ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); 270 dst->ip.in6 = src->ip.in6;
271 dst->cidr = src->cidr; 271 dst->cidr = src->cidr;
272} 272}
273 273
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 093cc327020f..611c3359b94d 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -983,7 +983,7 @@ static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related,
983 if (!cp) 983 if (!cp)
984 return NF_ACCEPT; 984 return NF_ACCEPT;
985 985
986 ipv6_addr_copy(&snet.in6, &iph->saddr); 986 snet.in6 = iph->saddr;
987 return handle_response_icmp(AF_INET6, skb, &snet, cih->nexthdr, cp, 987 return handle_response_icmp(AF_INET6, skb, &snet, cih->nexthdr, cp,
988 pp, offset, sizeof(struct ipv6hdr)); 988 pp, offset, sizeof(struct ipv6hdr));
989} 989}
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 3cdd479f9b5d..bcf5563e4837 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -603,9 +603,9 @@ sloop:
603#ifdef CONFIG_IP_VS_IPV6 603#ifdef CONFIG_IP_VS_IPV6
604 if (cp->af == AF_INET6) { 604 if (cp->af == AF_INET6) {
605 p += sizeof(struct ip_vs_sync_v6); 605 p += sizeof(struct ip_vs_sync_v6);
606 ipv6_addr_copy(&s->v6.caddr, &cp->caddr.in6); 606 s->v6.caddr = cp->caddr.in6;
607 ipv6_addr_copy(&s->v6.vaddr, &cp->vaddr.in6); 607 s->v6.vaddr = cp->vaddr.in6;
608 ipv6_addr_copy(&s->v6.daddr, &cp->daddr.in6); 608 s->v6.daddr = cp->daddr.in6;
609 } else 609 } else
610#endif 610#endif
611 { 611 {
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index aa2d7206ee8a..38a576d05b4b 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -235,7 +235,7 @@ __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr,
235 goto out_err; 235 goto out_err;
236 } 236 }
237 } 237 }
238 ipv6_addr_copy(ret_saddr, &fl6.saddr); 238 *ret_saddr = fl6.saddr;
239 return dst; 239 return dst;
240 240
241out_err: 241out_err:
@@ -279,7 +279,7 @@ __ip_vs_get_out_rt_v6(struct sk_buff *skb, struct ip_vs_dest *dest,
279 atomic_read(&rt->dst.__refcnt)); 279 atomic_read(&rt->dst.__refcnt));
280 } 280 }
281 if (ret_saddr) 281 if (ret_saddr)
282 ipv6_addr_copy(ret_saddr, &dest->dst_saddr.in6); 282 *ret_saddr = dest->dst_saddr.in6;
283 spin_unlock(&dest->dst_lock); 283 spin_unlock(&dest->dst_lock);
284 } else { 284 } else {
285 dst = __ip_vs_route_output_v6(net, daddr, ret_saddr, do_xfrm); 285 dst = __ip_vs_route_output_v6(net, daddr, ret_saddr, do_xfrm);
@@ -705,7 +705,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
705 /* mangle the packet */ 705 /* mangle the packet */
706 if (pp->dnat_handler && !pp->dnat_handler(skb, pp, cp)) 706 if (pp->dnat_handler && !pp->dnat_handler(skb, pp, cp))
707 goto tx_error; 707 goto tx_error;
708 ipv6_addr_copy(&ipv6_hdr(skb)->daddr, &cp->daddr.in6); 708 ipv6_hdr(skb)->daddr = cp->daddr.in6;
709 709
710 if (!local || !skb->dev) { 710 if (!local || !skb->dev) {
711 /* drop the old route when skb is not shared */ 711 /* drop the old route when skb is not shared */
@@ -967,8 +967,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
967 be16_add_cpu(&iph->payload_len, sizeof(*old_iph)); 967 be16_add_cpu(&iph->payload_len, sizeof(*old_iph));
968 iph->priority = old_iph->priority; 968 iph->priority = old_iph->priority;
969 memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl)); 969 memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl));
970 ipv6_addr_copy(&iph->daddr, &cp->daddr.in6); 970 iph->daddr = cp->daddr.in6;
971 ipv6_addr_copy(&iph->saddr, &saddr); 971 iph->saddr = saddr;
972 iph->hop_limit = old_iph->hop_limit; 972 iph->hop_limit = old_iph->hop_limit;
973 973
974 /* Another hack: avoid icmp_send in ip_fragment */ 974 /* Another hack: avoid icmp_send in ip_fragment */
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index f03c2d4539f6..f9368f33e7af 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -750,10 +750,10 @@ static int callforward_do_filter(const union nf_inet_addr *src,
750 struct rt6_info *rt1, *rt2; 750 struct rt6_info *rt1, *rt2;
751 751
752 memset(&fl1, 0, sizeof(fl1)); 752 memset(&fl1, 0, sizeof(fl1));
753 ipv6_addr_copy(&fl1.daddr, &src->in6); 753 fl1.daddr = src->in6;
754 754
755 memset(&fl2, 0, sizeof(fl2)); 755 memset(&fl2, 0, sizeof(fl2));
756 ipv6_addr_copy(&fl2.daddr, &dst->in6); 756 fl2.daddr = dst->in6;
757 if (!afinfo->route(&init_net, (struct dst_entry **)&rt1, 757 if (!afinfo->route(&init_net, (struct dst_entry **)&rt1,
758 flowi6_to_flowi(&fl1), false)) { 758 flowi6_to_flowi(&fl1), false)) {
759 if (!afinfo->route(&init_net, (struct dst_entry **)&rt2, 759 if (!afinfo->route(&init_net, (struct dst_entry **)&rt2,
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 9e63b43faeed..3ecade3966d5 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -161,7 +161,7 @@ static u_int32_t tcpmss_reverse_mtu(const struct sk_buff *skb,
161 struct flowi6 *fl6 = &fl.u.ip6; 161 struct flowi6 *fl6 = &fl.u.ip6;
162 162
163 memset(fl6, 0, sizeof(*fl6)); 163 memset(fl6, 0, sizeof(*fl6));
164 ipv6_addr_copy(&fl6->daddr, &ipv6_hdr(skb)->saddr); 164 fl6->daddr = ipv6_hdr(skb)->saddr;
165 } 165 }
166 rcu_read_lock(); 166 rcu_read_lock();
167 ai = nf_get_afinfo(family); 167 ai = nf_get_afinfo(family);
diff --git a/net/netfilter/xt_addrtype.c b/net/netfilter/xt_addrtype.c
index b77d383cec78..c047de2046ad 100644
--- a/net/netfilter/xt_addrtype.c
+++ b/net/netfilter/xt_addrtype.c
@@ -42,7 +42,7 @@ static u32 match_lookup_rt6(struct net *net, const struct net_device *dev,
42 int route_err; 42 int route_err;
43 43
44 memset(&flow, 0, sizeof(flow)); 44 memset(&flow, 0, sizeof(flow));
45 ipv6_addr_copy(&flow.daddr, addr); 45 flow.daddr = *addr;
46 if (dev) 46 if (dev)
47 flow.flowi6_oif = dev->ifindex; 47 flow.flowi6_oif = dev->ifindex;
48 48