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 /net/dccp/ipv6.c | |
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 'net/dccp/ipv6.c')
-rw-r--r-- | net/dccp/ipv6.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 17ee85ce148d..ce903f747e64 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -150,8 +150,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
150 | */ | 150 | */ |
151 | memset(&fl6, 0, sizeof(fl6)); | 151 | memset(&fl6, 0, sizeof(fl6)); |
152 | fl6.flowi6_proto = IPPROTO_DCCP; | 152 | fl6.flowi6_proto = IPPROTO_DCCP; |
153 | ipv6_addr_copy(&fl6.daddr, &np->daddr); | 153 | fl6.daddr = np->daddr; |
154 | ipv6_addr_copy(&fl6.saddr, &np->saddr); | 154 | fl6.saddr = np->saddr; |
155 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 155 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
156 | fl6.fl6_dport = inet->inet_dport; | 156 | fl6.fl6_dport = inet->inet_dport; |
157 | fl6.fl6_sport = inet->inet_sport; | 157 | fl6.fl6_sport = inet->inet_sport; |
@@ -244,8 +244,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req, | |||
244 | 244 | ||
245 | memset(&fl6, 0, sizeof(fl6)); | 245 | memset(&fl6, 0, sizeof(fl6)); |
246 | fl6.flowi6_proto = IPPROTO_DCCP; | 246 | fl6.flowi6_proto = IPPROTO_DCCP; |
247 | ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); | 247 | fl6.daddr = ireq6->rmt_addr; |
248 | ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr); | 248 | fl6.saddr = ireq6->loc_addr; |
249 | fl6.flowlabel = 0; | 249 | fl6.flowlabel = 0; |
250 | fl6.flowi6_oif = ireq6->iif; | 250 | fl6.flowi6_oif = ireq6->iif; |
251 | fl6.fl6_dport = inet_rsk(req)->rmt_port; | 251 | fl6.fl6_dport = inet_rsk(req)->rmt_port; |
@@ -270,7 +270,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req, | |||
270 | dh->dccph_checksum = dccp_v6_csum_finish(skb, | 270 | dh->dccph_checksum = dccp_v6_csum_finish(skb, |
271 | &ireq6->loc_addr, | 271 | &ireq6->loc_addr, |
272 | &ireq6->rmt_addr); | 272 | &ireq6->rmt_addr); |
273 | ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); | 273 | fl6.daddr = ireq6->rmt_addr; |
274 | err = ip6_xmit(sk, skb, &fl6, opt, np->tclass); | 274 | err = ip6_xmit(sk, skb, &fl6, opt, np->tclass); |
275 | err = net_xmit_eval(err); | 275 | err = net_xmit_eval(err); |
276 | } | 276 | } |
@@ -313,8 +313,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
313 | &rxip6h->daddr); | 313 | &rxip6h->daddr); |
314 | 314 | ||
315 | memset(&fl6, 0, sizeof(fl6)); | 315 | memset(&fl6, 0, sizeof(fl6)); |
316 | ipv6_addr_copy(&fl6.daddr, &rxip6h->saddr); | 316 | fl6.daddr = rxip6h->saddr; |
317 | ipv6_addr_copy(&fl6.saddr, &rxip6h->daddr); | 317 | fl6.saddr = rxip6h->daddr; |
318 | 318 | ||
319 | fl6.flowi6_proto = IPPROTO_DCCP; | 319 | fl6.flowi6_proto = IPPROTO_DCCP; |
320 | fl6.flowi6_oif = inet6_iif(rxskb); | 320 | fl6.flowi6_oif = inet6_iif(rxskb); |
@@ -419,8 +419,8 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
419 | goto drop_and_free; | 419 | goto drop_and_free; |
420 | 420 | ||
421 | ireq6 = inet6_rsk(req); | 421 | ireq6 = inet6_rsk(req); |
422 | ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr); | 422 | ireq6->rmt_addr = ipv6_hdr(skb)->saddr; |
423 | ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr); | 423 | ireq6->loc_addr = ipv6_hdr(skb)->daddr; |
424 | 424 | ||
425 | if (ipv6_opt_accepted(sk, skb) || | 425 | if (ipv6_opt_accepted(sk, skb) || |
426 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || | 426 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || |
@@ -491,7 +491,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
491 | 491 | ||
492 | ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); | 492 | ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); |
493 | 493 | ||
494 | ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); | 494 | newnp->rcv_saddr = newnp->saddr; |
495 | 495 | ||
496 | inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; | 496 | inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; |
497 | newsk->sk_backlog_rcv = dccp_v4_do_rcv; | 497 | newsk->sk_backlog_rcv = dccp_v4_do_rcv; |
@@ -526,9 +526,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
526 | 526 | ||
527 | memset(&fl6, 0, sizeof(fl6)); | 527 | memset(&fl6, 0, sizeof(fl6)); |
528 | fl6.flowi6_proto = IPPROTO_DCCP; | 528 | fl6.flowi6_proto = IPPROTO_DCCP; |
529 | ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr); | 529 | fl6.daddr = ireq6->rmt_addr; |
530 | final_p = fl6_update_dst(&fl6, opt, &final); | 530 | final_p = fl6_update_dst(&fl6, opt, &final); |
531 | ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr); | 531 | fl6.saddr = ireq6->loc_addr; |
532 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 532 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
533 | fl6.fl6_dport = inet_rsk(req)->rmt_port; | 533 | fl6.fl6_dport = inet_rsk(req)->rmt_port; |
534 | fl6.fl6_sport = inet_rsk(req)->loc_port; | 534 | fl6.fl6_sport = inet_rsk(req)->loc_port; |
@@ -559,9 +559,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
559 | 559 | ||
560 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); | 560 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); |
561 | 561 | ||
562 | ipv6_addr_copy(&newnp->daddr, &ireq6->rmt_addr); | 562 | newnp->daddr = ireq6->rmt_addr; |
563 | ipv6_addr_copy(&newnp->saddr, &ireq6->loc_addr); | 563 | newnp->saddr = ireq6->loc_addr; |
564 | ipv6_addr_copy(&newnp->rcv_saddr, &ireq6->loc_addr); | 564 | newnp->rcv_saddr = ireq6->loc_addr; |
565 | newsk->sk_bound_dev_if = ireq6->iif; | 565 | newsk->sk_bound_dev_if = ireq6->iif; |
566 | 566 | ||
567 | /* Now IPv6 options... | 567 | /* Now IPv6 options... |
@@ -877,7 +877,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
877 | flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); | 877 | flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); |
878 | if (flowlabel == NULL) | 878 | if (flowlabel == NULL) |
879 | return -EINVAL; | 879 | return -EINVAL; |
880 | ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst); | 880 | usin->sin6_addr = flowlabel->dst; |
881 | fl6_sock_release(flowlabel); | 881 | fl6_sock_release(flowlabel); |
882 | } | 882 | } |
883 | } | 883 | } |
@@ -910,7 +910,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
910 | return -EINVAL; | 910 | return -EINVAL; |
911 | } | 911 | } |
912 | 912 | ||
913 | ipv6_addr_copy(&np->daddr, &usin->sin6_addr); | 913 | np->daddr = usin->sin6_addr; |
914 | np->flow_label = fl6.flowlabel; | 914 | np->flow_label = fl6.flowlabel; |
915 | 915 | ||
916 | /* | 916 | /* |
@@ -949,8 +949,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
949 | saddr = &np->rcv_saddr; | 949 | saddr = &np->rcv_saddr; |
950 | 950 | ||
951 | fl6.flowi6_proto = IPPROTO_DCCP; | 951 | fl6.flowi6_proto = IPPROTO_DCCP; |
952 | ipv6_addr_copy(&fl6.daddr, &np->daddr); | 952 | fl6.daddr = np->daddr; |
953 | ipv6_addr_copy(&fl6.saddr, saddr ? saddr : &np->saddr); | 953 | fl6.saddr = saddr ? *saddr : np->saddr; |
954 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 954 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
955 | fl6.fl6_dport = usin->sin6_port; | 955 | fl6.fl6_dport = usin->sin6_port; |
956 | fl6.fl6_sport = inet->inet_sport; | 956 | fl6.fl6_sport = inet->inet_sport; |
@@ -966,11 +966,11 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
966 | 966 | ||
967 | if (saddr == NULL) { | 967 | if (saddr == NULL) { |
968 | saddr = &fl6.saddr; | 968 | saddr = &fl6.saddr; |
969 | ipv6_addr_copy(&np->rcv_saddr, saddr); | 969 | np->rcv_saddr = *saddr; |
970 | } | 970 | } |
971 | 971 | ||
972 | /* set the source address */ | 972 | /* set the source address */ |
973 | ipv6_addr_copy(&np->saddr, saddr); | 973 | np->saddr = *saddr; |
974 | inet->inet_rcv_saddr = LOOPBACK4_IPV6; | 974 | inet->inet_rcv_saddr = LOOPBACK4_IPV6; |
975 | 975 | ||
976 | __ip6_dst_store(sk, dst, NULL, NULL); | 976 | __ip6_dst_store(sk, dst, NULL, NULL); |