net: remove ipv6_addr_copy()
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 21 Nov 2011 03:39:03 +0000 (03:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2011 21:43:32 +0000 (16:43 -0500)
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>
66 files changed:
drivers/infiniband/core/addr.c
drivers/infiniband/core/cma.c
drivers/net/bonding/bond_ipv6.c
drivers/net/ethernet/broadcom/cnic.c
fs/dlm/lowcomms.c
include/linux/sunrpc/clnt.h
include/net/inetpeer.h
include/net/ip_vs.h
include/net/ipv6.h
include/net/xfrm.h
net/bridge/br_multicast.c
net/core/pktgen.c
net/dccp/ipv6.c
net/dccp/minisocks.c
net/ipv4/inet_diag.c
net/ipv4/tcp_minisocks.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/ah6.c
net/ipv6/anycast.c
net/ipv6/datagram.c
net/ipv6/exthdrs.c
net/ipv6/fib6_rules.c
net/ipv6/icmp.c
net/ipv6/inet6_connection_sock.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ip6_output.c
net/ipv6/ip6_tunnel.c
net/ipv6/ip6mr.c
net/ipv6/ipv6_sockglue.c
net/ipv6/mcast.c
net/ipv6/mip6.c
net/ipv6/ndisc.c
net/ipv6/netfilter/ip6t_REJECT.c
net/ipv6/raw.c
net/ipv6/reassembly.c
net/ipv6/route.c
net/ipv6/sit.c
net/ipv6/syncookies.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_mode_beet.c
net/ipv6/xfrm6_mode_tunnel.c
net/ipv6/xfrm6_output.c
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_state.c
net/key/af_key.c
net/netfilter/ipset/ip_set_hash_ip.c
net/netfilter/ipset/ip_set_hash_net.c
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_sync.c
net/netfilter/ipvs/ip_vs_xmit.c
net/netfilter/nf_conntrack_h323_main.c
net/netfilter/xt_TCPMSS.c
net/netfilter/xt_addrtype.c
net/netlabel/netlabel_kapi.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/sctp/ipv6.c
net/sctp/socket.c
net/sunrpc/svcauth_unix.c
net/sunrpc/svcsock.c
net/xfrm/xfrm_state.c
security/lsm_audit.c
security/selinux/hooks.c
security/selinux/netnode.c

index 691276bafd7812c168c4dadbe1aa315bf43bad80..adf0757280ed16516b793780a9574e7f66a7b6be 100644 (file)
@@ -243,8 +243,8 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
        int ret;
 
        memset(&fl6, 0, sizeof fl6);
-       ipv6_addr_copy(&fl6.daddr, &dst_in->sin6_addr);
-       ipv6_addr_copy(&fl6.saddr, &src_in->sin6_addr);
+       fl6.daddr = dst_in->sin6_addr;
+       fl6.saddr = src_in->sin6_addr;
        fl6.flowi6_oif = addr->bound_dev_if;
 
        dst = ip6_route_output(&init_net, NULL, &fl6);
@@ -258,7 +258,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
                        goto put;
 
                src_in->sin6_family = AF_INET6;
-               ipv6_addr_copy(&src_in->sin6_addr, &fl6.saddr);
+               src_in->sin6_addr = fl6.saddr;
        }
 
        if (dst->dev->flags & IFF_LOOPBACK) {
index 75ff821c0af07caaef3a0e48c8503489838bd75d..09e66cce05d3b9cbeacaee39959dd1f3aacc0fe4 100644 (file)
@@ -2005,11 +2005,11 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
        if (cma_zero_addr(src)) {
                dst = (struct sockaddr *) &id_priv->id.route.addr.dst_addr;
                if ((src->sa_family = dst->sa_family) == AF_INET) {
-                       ((struct sockaddr_in *) src)->sin_addr.s_addr =
-                               ((struct sockaddr_in *) dst)->sin_addr.s_addr;
+                       ((struct sockaddr_in *)src)->sin_addr =
+                               ((struct sockaddr_in *)dst)->sin_addr;
                } else {
-                       ipv6_addr_copy(&((struct sockaddr_in6 *) src)->sin6_addr,
-                                      &((struct sockaddr_in6 *) dst)->sin6_addr);
+                       ((struct sockaddr_in6 *)src)->sin6_addr =
+                               ((struct sockaddr_in6 *)dst)->sin6_addr;
                }
        }
 
index 027a0ee7d85bf39c85122d14991f178cfd322378..7e6632221a759dde4dc986b3aa68b250b166ff41 100644 (file)
@@ -50,7 +50,7 @@ static void bond_glean_dev_ipv6(struct net_device *dev, struct in6_addr *addr)
                struct inet6_ifaddr *ifa
                        = list_first_entry(&idev->addr_list,
                                           struct inet6_ifaddr, if_list);
-               ipv6_addr_copy(addr, &ifa->addr);
+               *addr = ifa->addr;
        } else
                ipv6_addr_set(addr, 0, 0, 0, 0);
 
@@ -168,8 +168,7 @@ static int bond_inet6addr_event(struct notifier_block *this,
                        switch (event) {
                        case NETDEV_UP:
                                if (ipv6_addr_any(&bond->master_ipv6))
-                                       ipv6_addr_copy(&bond->master_ipv6,
-                                                      &ifa->addr);
+                                       bond->master_ipv6 = ifa->addr;
                                return NOTIFY_OK;
                        case NETDEV_DOWN:
                                if (ipv6_addr_equal(&bond->master_ipv6,
@@ -191,8 +190,7 @@ static int bond_inet6addr_event(struct notifier_block *this,
                                switch (event) {
                                case NETDEV_UP:
                                        if (ipv6_addr_any(&vlan->vlan_ipv6))
-                                               ipv6_addr_copy(&vlan->vlan_ipv6,
-                                                              &ifa->addr);
+                                               vlan->vlan_ipv6 = ifa->addr;
                                        return NOTIFY_OK;
                                case NETDEV_DOWN:
                                        if (ipv6_addr_equal(&vlan->vlan_ipv6,
index 6f10c6939834df7cd68f246175bbd9aa094110f6..099f41d99ec058d9506aa134b3a74140949ac2fb 100644 (file)
@@ -3475,7 +3475,7 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
        struct flowi6 fl6;
 
        memset(&fl6, 0, sizeof(fl6));
-       ipv6_addr_copy(&fl6.daddr, &dst_addr->sin6_addr);
+       fl6.daddr = dst_addr->sin6_addr;
        if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
                fl6.flowi6_oif = dst_addr->sin6_scope_id;
 
index 990626e7da80aaf411c67f8e20ca73ac3a46bc0a..0b3109ee42571e258fd4a2ff3ef342e9ddb1658c 100644 (file)
@@ -281,7 +281,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr *retaddr)
        } else {
                struct sockaddr_in6 *in6  = (struct sockaddr_in6 *) &addr;
                struct sockaddr_in6 *ret6 = (struct sockaddr_in6 *) retaddr;
-               ipv6_addr_copy(&ret6->sin6_addr, &in6->sin6_addr);
+               ret6->sin6_addr = in6->sin6_addr;
        }
 
        return 0;
index 3d8f9c44e27d8a161daed9f8bcdd50591d906991..f15fd985b08a2b4ae8303eb56bae4d038a89a466 100644 (file)
@@ -237,7 +237,7 @@ static inline bool __rpc_copy_addr6(struct sockaddr *dst,
        struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst;
 
        dsin6->sin6_family = ssin6->sin6_family;
-       ipv6_addr_copy(&dsin6->sin6_addr, &ssin6->sin6_addr);
+       dsin6->sin6_addr = ssin6->sin6_addr;
        return true;
 }
 #else  /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
index 78c83e62218fbfff60506e4323f72343aed2b83a..73a5c26c01ea9d0b610fae74dd7c41761c868a42 100644 (file)
@@ -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);
 }
index 873d5be7926c1bef17c83ea7c79eecafede9149e..48fd12e9d3af56d99dd1fd439ac5525a42644c27 100644 (file)
@@ -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;
index 3f0258d2ef01f530685e11b0984027b8ef8a7fde..f35188e002d92a270752a1c4aee02d735d8ce920 100644 (file)
@@ -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)
index 4de7ed9016d9f6bf231c838a2da5b4aa5b41c458..89174e29dca99bf943aed6d3ed6544fd040f002e 100644 (file)
@@ -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;
        }
 }
index a5f4e5769809c74f96c1a93ab67ade401fb022d7..7743e0d109ea20b0b5c56445f83b1a1d168ac0ad 100644 (file)
@@ -127,7 +127,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip6_get(
 {
        struct br_ip br_dst;
 
-       ipv6_addr_copy(&br_dst.u.ip6, dst);
+       br_dst.u.ip6 = *dst;
        br_dst.proto = htons(ETH_P_IPV6);
 
        return br_mdb_ip_get(mdb, &br_dst);
@@ -154,7 +154,7 @@ struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
                break;
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
        case htons(ETH_P_IPV6):
-               ipv6_addr_copy(&ip.u.ip6, &ipv6_hdr(skb)->daddr);
+               ip.u.ip6 = ipv6_hdr(skb)->daddr;
                break;
 #endif
        default:
@@ -474,7 +474,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
        mldq->mld_cksum = 0;
        mldq->mld_maxdelay = htons((u16)jiffies_to_msecs(interval));
        mldq->mld_reserved = 0;
-       ipv6_addr_copy(&mldq->mld_mca, group);
+       mldq->mld_mca = *group;
 
        /* checksum */
        mldq->mld_cksum = csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
@@ -783,7 +783,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br,
        if (!ipv6_is_transient_multicast(group))
                return 0;
 
-       ipv6_addr_copy(&br_group.u.ip6, group);
+       br_group.u.ip6 = *group;
        br_group.proto = htons(ETH_P_IPV6);
 
        return br_multicast_add_group(br, port, &br_group);
@@ -1344,7 +1344,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
        if (!ipv6_is_transient_multicast(group))
                return;
 
-       ipv6_addr_copy(&br_group.u.ip6, group);
+       br_group.u.ip6 = *group;
        br_group.proto = htons(ETH_P_IPV6);
 
        br_multicast_leave_group(br, port, &br_group);
index 0001c243b35cb4cc2aadebd72fd00679adc6e002..aa53a35a631b81c4a905a69e736210f5b2ab8c5a 100644 (file)
@@ -1304,7 +1304,7 @@ static ssize_t pktgen_if_write(struct file *file,
                scan_ip6(buf, pkt_dev->in6_daddr.s6_addr);
                snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->in6_daddr);
 
-               ipv6_addr_copy(&pkt_dev->cur_in6_daddr, &pkt_dev->in6_daddr);
+               pkt_dev->cur_in6_daddr = pkt_dev->in6_daddr;
 
                if (debug)
                        printk(KERN_DEBUG "pktgen: dst6 set to: %s\n", buf);
@@ -1327,8 +1327,7 @@ static ssize_t pktgen_if_write(struct file *file,
                scan_ip6(buf, pkt_dev->min_in6_daddr.s6_addr);
                snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->min_in6_daddr);
 
-               ipv6_addr_copy(&pkt_dev->cur_in6_daddr,
-                              &pkt_dev->min_in6_daddr);
+               pkt_dev->cur_in6_daddr = pkt_dev->min_in6_daddr;
                if (debug)
                        printk(KERN_DEBUG "pktgen: dst6_min set to: %s\n", buf);
 
@@ -1371,7 +1370,7 @@ static ssize_t pktgen_if_write(struct file *file,
                scan_ip6(buf, pkt_dev->in6_saddr.s6_addr);
                snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->in6_saddr);
 
-               ipv6_addr_copy(&pkt_dev->cur_in6_saddr, &pkt_dev->in6_saddr);
+               pkt_dev->cur_in6_saddr = pkt_dev->in6_saddr;
 
                if (debug)
                        printk(KERN_DEBUG "pktgen: src6 set to: %s\n", buf);
@@ -2079,9 +2078,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
                                     ifp = ifp->if_next) {
                                        if (ifp->scope == IFA_LINK &&
                                            !(ifp->flags & IFA_F_TENTATIVE)) {
-                                               ipv6_addr_copy(&pkt_dev->
-                                                              cur_in6_saddr,
-                                                              &ifp->addr);
+                                               pkt_dev->cur_in6_saddr = ifp->addr;
                                                err = 0;
                                                break;
                                        }
@@ -2958,8 +2955,8 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
        iph->payload_len = htons(sizeof(struct udphdr) + datalen);
        iph->nexthdr = IPPROTO_UDP;
 
-       ipv6_addr_copy(&iph->daddr, &pkt_dev->cur_in6_daddr);
-       ipv6_addr_copy(&iph->saddr, &pkt_dev->cur_in6_saddr);
+       iph->daddr = pkt_dev->cur_in6_daddr;
+       iph->saddr = pkt_dev->cur_in6_saddr;
 
        skb->mac_header = (skb->network_header - ETH_HLEN -
                           pkt_dev->pkt_overhead);
index 17ee85ce148dee3ac5e12e572a61f38dcfa8d381..ce903f747e64ba27675726aa3d1ba9db0abd46ad 100644 (file)
@@ -150,8 +150,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
                         */
                        memset(&fl6, 0, sizeof(fl6));
                        fl6.flowi6_proto = IPPROTO_DCCP;
-                       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-                       ipv6_addr_copy(&fl6.saddr, &np->saddr);
+                       fl6.daddr = np->daddr;
+                       fl6.saddr = np->saddr;
                        fl6.flowi6_oif = sk->sk_bound_dev_if;
                        fl6.fl6_dport = inet->inet_dport;
                        fl6.fl6_sport = inet->inet_sport;
@@ -244,8 +244,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_DCCP;
-       ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
-       ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
+       fl6.daddr = ireq6->rmt_addr;
+       fl6.saddr = ireq6->loc_addr;
        fl6.flowlabel = 0;
        fl6.flowi6_oif = ireq6->iif;
        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,
                dh->dccph_checksum = dccp_v6_csum_finish(skb,
                                                         &ireq6->loc_addr,
                                                         &ireq6->rmt_addr);
-               ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
+               fl6.daddr = ireq6->rmt_addr;
                err = ip6_xmit(sk, skb, &fl6, opt, np->tclass);
                err = net_xmit_eval(err);
        }
@@ -313,8 +313,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
                                                            &rxip6h->daddr);
 
        memset(&fl6, 0, sizeof(fl6));
-       ipv6_addr_copy(&fl6.daddr, &rxip6h->saddr);
-       ipv6_addr_copy(&fl6.saddr, &rxip6h->daddr);
+       fl6.daddr = rxip6h->saddr;
+       fl6.saddr = rxip6h->daddr;
 
        fl6.flowi6_proto = IPPROTO_DCCP;
        fl6.flowi6_oif = inet6_iif(rxskb);
@@ -419,8 +419,8 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
                goto drop_and_free;
 
        ireq6 = inet6_rsk(req);
-       ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
-       ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
+       ireq6->rmt_addr = ipv6_hdr(skb)->saddr;
+       ireq6->loc_addr = ipv6_hdr(skb)->daddr;
 
        if (ipv6_opt_accepted(sk, skb) ||
            np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
@@ -491,7 +491,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 
                ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr);
 
-               ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr);
+               newnp->rcv_saddr = newnp->saddr;
 
                inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped;
                newsk->sk_backlog_rcv = dccp_v4_do_rcv;
@@ -526,9 +526,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 
                memset(&fl6, 0, sizeof(fl6));
                fl6.flowi6_proto = IPPROTO_DCCP;
-               ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
+               fl6.daddr = ireq6->rmt_addr;
                final_p = fl6_update_dst(&fl6, opt, &final);
-               ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
+               fl6.saddr = ireq6->loc_addr;
                fl6.flowi6_oif = sk->sk_bound_dev_if;
                fl6.fl6_dport = inet_rsk(req)->rmt_port;
                fl6.fl6_sport = inet_rsk(req)->loc_port;
@@ -559,9 +559,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 
        memcpy(newnp, np, sizeof(struct ipv6_pinfo));
 
-       ipv6_addr_copy(&newnp->daddr, &ireq6->rmt_addr);
-       ipv6_addr_copy(&newnp->saddr, &ireq6->loc_addr);
-       ipv6_addr_copy(&newnp->rcv_saddr, &ireq6->loc_addr);
+       newnp->daddr = ireq6->rmt_addr;
+       newnp->saddr = ireq6->loc_addr;
+       newnp->rcv_saddr = ireq6->loc_addr;
        newsk->sk_bound_dev_if = ireq6->iif;
 
        /* Now IPv6 options...
@@ -877,7 +877,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                        flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
                        if (flowlabel == NULL)
                                return -EINVAL;
-                       ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
+                       usin->sin6_addr = flowlabel->dst;
                        fl6_sock_release(flowlabel);
                }
        }
@@ -910,7 +910,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                        return -EINVAL;
        }
 
-       ipv6_addr_copy(&np->daddr, &usin->sin6_addr);
+       np->daddr = usin->sin6_addr;
        np->flow_label = fl6.flowlabel;
 
        /*
@@ -949,8 +949,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                saddr = &np->rcv_saddr;
 
        fl6.flowi6_proto = IPPROTO_DCCP;
-       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-       ipv6_addr_copy(&fl6.saddr, saddr ? saddr : &np->saddr);
+       fl6.daddr = np->daddr;
+       fl6.saddr = saddr ? *saddr : np->saddr;
        fl6.flowi6_oif = sk->sk_bound_dev_if;
        fl6.fl6_dport = usin->sin6_port;
        fl6.fl6_sport = inet->inet_sport;
@@ -966,11 +966,11 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
 
        if (saddr == NULL) {
                saddr = &fl6.saddr;
-               ipv6_addr_copy(&np->rcv_saddr, saddr);
+               np->rcv_saddr = *saddr;
        }
 
        /* set the source address */
-       ipv6_addr_copy(&np->saddr, saddr);
+       np->saddr = *saddr;
        inet->inet_rcv_saddr = LOOPBACK4_IPV6;
 
        __ip6_dst_store(sk, dst, NULL, NULL);
index 563b7c74e49de1e443fe2b2a662388635fac0aed..b50d5fd3d69617234ce8fa7fc7841980be454bd4 100644 (file)
@@ -60,8 +60,8 @@ void dccp_time_wait(struct sock *sk, int state, int timeo)
 
                        tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot);
                        tw6 = inet6_twsk((struct sock *)tw);
-                       ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr);
-                       ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr);
+                       tw6->tw_v6_daddr = np->daddr;
+                       tw6->tw_v6_rcv_saddr = np->rcv_saddr;
                        tw->tw_ipv6only = np->ipv6only;
                }
 #endif
index 68e8ac5143834b80e09cc4bbbbdaecf05a3a2710..bbebdecd7234adb7ec45d8e1d566c8c9a68cadc6 100644 (file)
@@ -129,10 +129,8 @@ static int inet_csk_diag_fill(struct sock *sk,
        if (r->idiag_family == AF_INET6) {
                const struct ipv6_pinfo *np = inet6_sk(sk);
 
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
-                              &np->rcv_saddr);
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
-                              &np->daddr);
+               *(struct in6_addr *)r->id.idiag_src = np->rcv_saddr;
+               *(struct in6_addr *)r->id.idiag_dst = np->daddr;
                if (ext & (1 << (INET_DIAG_TCLASS - 1)))
                        RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass);
        }
@@ -224,10 +222,8 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
                const struct inet6_timewait_sock *tw6 =
                                                inet6_twsk((struct sock *)tw);
 
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
-                              &tw6->tw_v6_rcv_saddr);
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
-                              &tw6->tw_v6_daddr);
+               *(struct in6_addr *)r->id.idiag_src = tw6->tw_v6_rcv_saddr;
+               *(struct in6_addr *)r->id.idiag_dst = tw6->tw_v6_daddr;
        }
 #endif
        nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail;
@@ -603,10 +599,8 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
        r->idiag_inode = 0;
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
        if (r->idiag_family == AF_INET6) {
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
-                              &inet6_rsk(req)->loc_addr);
-               ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
-                              &inet6_rsk(req)->rmt_addr);
+               *(struct in6_addr *)r->id.idiag_src = inet6_rsk(req)->loc_addr;
+               *(struct in6_addr *)r->id.idiag_dst = inet6_rsk(req)->rmt_addr;
        }
 #endif
        nlh->nlmsg_len = skb_tail_pointer(skb) - b;
index 0a7e3398c4616b06189bf6584f749b80dbcf8b57..945efffdd929b81b1cf4943bee865eecf1c25978 100644 (file)
@@ -343,8 +343,8 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
 
                        tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot);
                        tw6 = inet6_twsk((struct sock *)tw);
-                       ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr);
-                       ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr);
+                       tw6->tw_v6_daddr = np->daddr;
+                       tw6->tw_v6_rcv_saddr = np->rcv_saddr;
                        tw->tw_tclass = np->tclass;
                        tw->tw_ipv6only = np->ipv6only;
                }
index cf88df82e2c21ca21da8184f0370096b094dffba..58605172634198ca5b7b46c1a7364c68b4d2759a 100644 (file)
@@ -636,7 +636,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
                goto out;
        }
 
-       ipv6_addr_copy(&ifa->addr, addr);
+       ifa->addr = *addr;
 
        spin_lock_init(&ifa->lock);
        spin_lock_init(&ifa->state_lock);
@@ -1228,7 +1228,7 @@ try_nextdev:
        if (!hiscore->ifa)
                return -EADDRNOTAVAIL;
 
-       ipv6_addr_copy(saddr, &hiscore->ifa->addr);
+       *saddr = hiscore->ifa->addr;
        in6_ifa_put(hiscore->ifa);
        return 0;
 }
@@ -1249,7 +1249,7 @@ int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
                list_for_each_entry(ifp, &idev->addr_list, if_list) {
                        if (ifp->scope == IFA_LINK &&
                            !(ifp->flags & banned_flags)) {
-                               ipv6_addr_copy(addr, &ifp->addr);
+                               *addr = ifp->addr;
                                err = 0;
                                break;
                        }
@@ -1700,7 +1700,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
                .fc_protocol = RTPROT_KERNEL,
        };
 
-       ipv6_addr_copy(&cfg.fc_dst, pfx);
+       cfg.fc_dst = *pfx;
 
        /* Prevent useless cloning on PtP SIT.
           This thing is done here expecting that the whole
index ee3319487c4f6b32170f92b68cae95dbed9abd74..7694c82e629d3b38452d79ba8c1aac47954a2dc5 100644 (file)
@@ -361,10 +361,10 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
        inet->inet_rcv_saddr = v4addr;
        inet->inet_saddr = v4addr;
 
-       ipv6_addr_copy(&np->rcv_saddr, &addr->sin6_addr);
+       np->rcv_saddr = addr->sin6_addr;
 
        if (!(addr_type & IPV6_ADDR_MULTICAST))
-               ipv6_addr_copy(&np->saddr, &addr->sin6_addr);
+               np->saddr = addr->sin6_addr;
 
        /* Make sure we are allowed to bind here. */
        if (sk->sk_prot->get_port(sk, snum)) {
@@ -458,14 +458,14 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
                    peer == 1)
                        return -ENOTCONN;
                sin->sin6_port = inet->inet_dport;
-               ipv6_addr_copy(&sin->sin6_addr, &np->daddr);
+               sin->sin6_addr = np->daddr;
                if (np->sndflow)
                        sin->sin6_flowinfo = np->flow_label;
        } else {
                if (ipv6_addr_any(&np->rcv_saddr))
-                       ipv6_addr_copy(&sin->sin6_addr, &np->saddr);
+                       sin->sin6_addr = np->saddr;
                else
-                       ipv6_addr_copy(&sin->sin6_addr, &np->rcv_saddr);
+                       sin->sin6_addr = np->rcv_saddr;
 
                sin->sin6_port = inet->inet_sport;
        }
@@ -660,8 +660,8 @@ int inet6_sk_rebuild_header(struct sock *sk)
 
                memset(&fl6, 0, sizeof(fl6));
                fl6.flowi6_proto = sk->sk_protocol;
-               ipv6_addr_copy(&fl6.daddr, &np->daddr);
-               ipv6_addr_copy(&fl6.saddr, &np->saddr);
+               fl6.daddr = np->daddr;
+               fl6.saddr = np->saddr;
                fl6.flowlabel = np->flow_label;
                fl6.flowi6_oif = sk->sk_bound_dev_if;
                fl6.flowi6_mark = sk->sk_mark;
index 4c0f894d08432564899bb5611483f5dab3d2ae59..2ae79dbeec2feb356f1d91f10a9853cc5f1b5706 100644 (file)
@@ -193,9 +193,9 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des
                                                printk(KERN_WARNING "destopt hao: invalid header length: %u\n", hao->length);
                                        goto bad;
                                }
-                               ipv6_addr_copy(&final_addr, &hao->addr);
-                               ipv6_addr_copy(&hao->addr, &iph->saddr);
-                               ipv6_addr_copy(&iph->saddr, &final_addr);
+                               final_addr = hao->addr;
+                               hao->addr = iph->saddr;
+                               iph->saddr = final_addr;
                        }
                        break;
                }
@@ -241,13 +241,13 @@ static void ipv6_rearrange_rthdr(struct ipv6hdr *iph, struct ipv6_rt_hdr *rthdr)
        segments = rthdr->hdrlen >> 1;
 
        addrs = ((struct rt0_hdr *)rthdr)->addr;
-       ipv6_addr_copy(&final_addr, addrs + segments - 1);
+       final_addr = addrs[segments - 1];
 
        addrs += segments - segments_left;
        memmove(addrs + 1, addrs, (segments_left - 1) * sizeof(*addrs));
 
-       ipv6_addr_copy(addrs, &iph->daddr);
-       ipv6_addr_copy(&iph->daddr, &final_addr);
+       addrs[0] = iph->daddr;
+       iph->daddr = final_addr;
 }
 
 static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len, int dir)
index 674255f5e6b7477e6fc4a5f3acb5d336883389f3..fc1cdcd7041a85db005294f58fcf7fa4c18419c0 100644 (file)
@@ -75,7 +75,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
        if (pac == NULL)
                return -ENOMEM;
        pac->acl_next = NULL;
-       ipv6_addr_copy(&pac->acl_addr, addr);
+       pac->acl_addr = *addr;
 
        rcu_read_lock();
        if (ifindex == 0) {
@@ -296,7 +296,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
                goto out;
        }
 
-       ipv6_addr_copy(&aca->aca_addr, addr);
+       aca->aca_addr = *addr;
        aca->aca_idev = idev;
        aca->aca_rt = rt;
        aca->aca_users = 1;
index 83037af4fa7b50ddaf680f8d2fa4c339422d863f..ae08aee1773c678187f8be84414f95ac472aa426 100644 (file)
@@ -71,7 +71,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
                        flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
                        if (flowlabel == NULL)
                                return -EINVAL;
-                       ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
+                       usin->sin6_addr = flowlabel->dst;
                }
        }
 
@@ -143,7 +143,7 @@ ipv4_connected:
                }
        }
 
-       ipv6_addr_copy(&np->daddr, daddr);
+       np->daddr = *daddr;
        np->flow_label = fl6.flowlabel;
 
        inet->inet_dport = usin->sin6_port;
@@ -154,8 +154,8 @@ ipv4_connected:
         */
 
        fl6.flowi6_proto = sk->sk_protocol;
-       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-       ipv6_addr_copy(&fl6.saddr, &np->saddr);
+       fl6.daddr = np->daddr;
+       fl6.saddr = np->saddr;
        fl6.flowi6_oif = sk->sk_bound_dev_if;
        fl6.flowi6_mark = sk->sk_mark;
        fl6.fl6_dport = inet->inet_dport;
@@ -179,10 +179,10 @@ ipv4_connected:
        /* source address lookup done in ip6_dst_lookup */
 
        if (ipv6_addr_any(&np->saddr))
-               ipv6_addr_copy(&np->saddr, &fl6.saddr);
+               np->saddr = fl6.saddr;
 
        if (ipv6_addr_any(&np->rcv_saddr)) {
-               ipv6_addr_copy(&np->rcv_saddr, &fl6.saddr);
+               np->rcv_saddr = fl6.saddr;
                inet->inet_rcv_saddr = LOOPBACK4_IPV6;
                if (sk->sk_prot->rehash)
                        sk->sk_prot->rehash(sk);
@@ -257,7 +257,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info)
        skb_put(skb, sizeof(struct ipv6hdr));
        skb_reset_network_header(skb);
        iph = ipv6_hdr(skb);
-       ipv6_addr_copy(&iph->daddr, &fl6->daddr);
+       iph->daddr = fl6->daddr;
 
        serr = SKB_EXT_ERR(skb);
        serr->ee.ee_errno = err;
@@ -294,7 +294,7 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu)
        skb_put(skb, sizeof(struct ipv6hdr));
        skb_reset_network_header(skb);
        iph = ipv6_hdr(skb);
-       ipv6_addr_copy(&iph->daddr, &fl6->daddr);
+       iph->daddr = fl6->daddr;
 
        mtu_info = IP6CBMTU(skb);
 
@@ -303,7 +303,7 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu)
        mtu_info->ip6m_addr.sin6_port = 0;
        mtu_info->ip6m_addr.sin6_flowinfo = 0;
        mtu_info->ip6m_addr.sin6_scope_id = fl6->flowi6_oif;
-       ipv6_addr_copy(&mtu_info->ip6m_addr.sin6_addr, &ipv6_hdr(skb)->daddr);
+       mtu_info->ip6m_addr.sin6_addr = ipv6_hdr(skb)->daddr;
 
        __skb_pull(skb, skb_tail_pointer(skb) - skb->data);
        skb_reset_transport_header(skb);
@@ -354,8 +354,8 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
                sin->sin6_port = serr->port;
                sin->sin6_scope_id = 0;
                if (skb->protocol == htons(ETH_P_IPV6)) {
-                       ipv6_addr_copy(&sin->sin6_addr,
-                                 (struct in6_addr *)(nh + serr->addr_offset));
+                       sin->sin6_addr =
+                               *(struct in6_addr *)(nh + serr->addr_offset);
                        if (np->sndflow)
                                sin->sin6_flowinfo =
                                        (*(__be32 *)(nh + serr->addr_offset - 24) &
@@ -376,7 +376,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
                sin->sin6_flowinfo = 0;
                sin->sin6_scope_id = 0;
                if (skb->protocol == htons(ETH_P_IPV6)) {
-                       ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr);
+                       sin->sin6_addr = ipv6_hdr(skb)->saddr;
                        if (np->rxopt.all)
                                datagram_recv_ctl(sk, msg, skb);
                        if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
@@ -451,7 +451,7 @@ int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len)
                sin->sin6_flowinfo = 0;
                sin->sin6_port = 0;
                sin->sin6_scope_id = mtu_info.ip6m_addr.sin6_scope_id;
-               ipv6_addr_copy(&sin->sin6_addr, &mtu_info.ip6m_addr.sin6_addr);
+               sin->sin6_addr = mtu_info.ip6m_addr.sin6_addr;
        }
 
        put_cmsg(msg, SOL_IPV6, IPV6_PATHMTU, sizeof(mtu_info), &mtu_info);
@@ -475,7 +475,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
                struct in6_pktinfo src_info;
 
                src_info.ipi6_ifindex = opt->iif;
-               ipv6_addr_copy(&src_info.ipi6_addr, &ipv6_hdr(skb)->daddr);
+               src_info.ipi6_addr = ipv6_hdr(skb)->daddr;
                put_cmsg(msg, SOL_IPV6, IPV6_PKTINFO, sizeof(src_info), &src_info);
        }
 
@@ -550,7 +550,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
                struct in6_pktinfo src_info;
 
                src_info.ipi6_ifindex = opt->iif;
-               ipv6_addr_copy(&src_info.ipi6_addr, &ipv6_hdr(skb)->daddr);
+               src_info.ipi6_addr = ipv6_hdr(skb)->daddr;
                put_cmsg(msg, SOL_IPV6, IPV6_2292PKTINFO, sizeof(src_info), &src_info);
        }
        if (np->rxopt.bits.rxohlim) {
@@ -584,7 +584,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
                         */
 
                        sin6.sin6_family = AF_INET6;
-                       ipv6_addr_copy(&sin6.sin6_addr, &ipv6_hdr(skb)->daddr);
+                       sin6.sin6_addr = ipv6_hdr(skb)->daddr;
                        sin6.sin6_port = ports[1];
                        sin6.sin6_flowinfo = 0;
                        sin6.sin6_scope_id = 0;
@@ -659,7 +659,7 @@ int datagram_send_ctl(struct net *net, struct sock *sk,
                                                   strict ? dev : NULL, 0))
                                        err = -EINVAL;
                                else
-                                       ipv6_addr_copy(&fl6->saddr, &src_info->ipi6_addr);
+                                       fl6->saddr = src_info->ipi6_addr;
                        }
 
                        rcu_read_unlock();
index bf22a225f42218bbf05bf173d59eeae04acd8784..3d641b6e9b09256cb43f1cca0e9cabcc1526e30f 100644 (file)
@@ -243,9 +243,9 @@ static int ipv6_dest_hao(struct sk_buff *skb, int optoff)
        if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->ip_summed = CHECKSUM_NONE;
 
-       ipv6_addr_copy(&tmp_addr, &ipv6h->saddr);
-       ipv6_addr_copy(&ipv6h->saddr, &hao->addr);
-       ipv6_addr_copy(&hao->addr, &tmp_addr);
+       tmp_addr = ipv6h->saddr;
+       ipv6h->saddr = hao->addr;
+       hao->addr = tmp_addr;
 
        if (skb->tstamp.tv64 == 0)
                __net_timestamp(skb);
@@ -461,9 +461,9 @@ looped_back:
                return -1;
        }
 
-       ipv6_addr_copy(&daddr, addr);
-       ipv6_addr_copy(addr, &ipv6_hdr(skb)->daddr);
-       ipv6_addr_copy(&ipv6_hdr(skb)->daddr, &daddr);
+       daddr = *addr;
+       *addr = ipv6_hdr(skb)->daddr;
+       ipv6_hdr(skb)->daddr = daddr;
 
        skb_dst_drop(skb);
        ip6_route_input(skb);
@@ -690,7 +690,7 @@ static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto,
                memcpy(phdr->addr, ihdr->addr + 1,
                       (hops - 1) * sizeof(struct in6_addr));
 
-       ipv6_addr_copy(phdr->addr + (hops - 1), *addr_p);
+       phdr->addr[hops - 1] = **addr_p;
        *addr_p = ihdr->addr;
 
        phdr->rt_hdr.nexthdr = *proto;
@@ -888,8 +888,8 @@ struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
        if (!opt || !opt->srcrt)
                return NULL;
 
-       ipv6_addr_copy(orig, &fl6->daddr);
-       ipv6_addr_copy(&fl6->daddr, ((struct rt0_hdr *)opt->srcrt)->addr);
+       *orig = fl6->daddr;
+       fl6->daddr = *((struct rt0_hdr *)opt->srcrt)->addr;
        return orig;
 }
 
index 295571576f8383190820449f6f9b6dbe264b61d1..b6c573152067c36c90841a35ba191b611d133acc 100644 (file)
@@ -96,7 +96,7 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
                        if (!ipv6_prefix_equal(&saddr, &r->src.addr,
                                               r->src.plen))
                                goto again;
-                       ipv6_addr_copy(&flp6->saddr, &saddr);
+                       flp6->saddr = saddr;
                }
                goto out;
        }
index 90868fb42757bf8431eaea968d861d81c4da5c10..9e2bdccf9143e826799274a55656f9ffc21c2c6f 100644 (file)
@@ -290,9 +290,9 @@ static void mip6_addr_swap(struct sk_buff *skb)
                if (likely(off >= 0)) {
                        hao = (struct ipv6_destopt_hao *)
                                        (skb_network_header(skb) + off);
-                       ipv6_addr_copy(&tmp, &iph->saddr);
-                       ipv6_addr_copy(&iph->saddr, &hao->addr);
-                       ipv6_addr_copy(&hao->addr, &tmp);
+                       tmp = iph->saddr;
+                       iph->saddr = hao->addr;
+                       hao->addr = tmp;
                }
        }
 }
@@ -444,9 +444,9 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_ICMPV6;
-       ipv6_addr_copy(&fl6.daddr, &hdr->saddr);
+       fl6.daddr = hdr->saddr;
        if (saddr)
-               ipv6_addr_copy(&fl6.saddr, saddr);
+               fl6.saddr = *saddr;
        fl6.flowi6_oif = iif;
        fl6.fl6_icmp_type = type;
        fl6.fl6_icmp_code = code;
@@ -538,9 +538,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_ICMPV6;
-       ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->saddr);
+       fl6.daddr = ipv6_hdr(skb)->saddr;
        if (saddr)
-               ipv6_addr_copy(&fl6.saddr, saddr);
+               fl6.saddr = *saddr;
        fl6.flowi6_oif = skb->dev->ifindex;
        fl6.fl6_icmp_type = ICMPV6_ECHO_REPLY;
        security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
@@ -786,8 +786,8 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
                      int oif)
 {
        memset(fl6, 0, sizeof(*fl6));
-       ipv6_addr_copy(&fl6->saddr, saddr);
-       ipv6_addr_copy(&fl6->daddr, daddr);
+       fl6->saddr = *saddr;
+       fl6->daddr = *daddr;
        fl6->flowi6_proto       = IPPROTO_ICMPV6;
        fl6->fl6_icmp_type      = type;
        fl6->fl6_icmp_code      = 0;
index fee46d5a2f125f54451f5115dbddd050138af3a7..4d7bfb321c750e1a1ff16b795f0f07baed42f815 100644 (file)
@@ -65,9 +65,9 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_TCP;
-       ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
+       fl6.daddr = treq->rmt_addr;
        final_p = fl6_update_dst(&fl6, np->opt, &final);
-       ipv6_addr_copy(&fl6.saddr, &treq->loc_addr);
+       fl6.saddr = treq->loc_addr;
        fl6.flowi6_oif = sk->sk_bound_dev_if;
        fl6.flowi6_mark = sk->sk_mark;
        fl6.fl6_dport = inet_rsk(req)->rmt_port;
@@ -157,7 +157,7 @@ void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
        struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr;
 
        sin6->sin6_family = AF_INET6;
-       ipv6_addr_copy(&sin6->sin6_addr, &np->daddr);
+       sin6->sin6_addr = np->daddr;
        sin6->sin6_port = inet_sk(sk)->inet_dport;
        /* We do not store received flowlabel for TCP */
        sin6->sin6_flowinfo = 0;
@@ -215,8 +215,8 @@ int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl_unused)
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = sk->sk_protocol;
-       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-       ipv6_addr_copy(&fl6.saddr, &np->saddr);
+       fl6.daddr = np->daddr;
+       fl6.saddr = np->saddr;
        fl6.flowlabel = np->flow_label;
        IP6_ECN_flow_xmit(sk, fl6.flowlabel);
        fl6.flowi6_oif = sk->sk_bound_dev_if;
@@ -246,7 +246,7 @@ int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl_unused)
        skb_dst_set_noref(skb, dst);
 
        /* Restore final destination back after routing done */
-       ipv6_addr_copy(&fl6.daddr, &np->daddr);
+       fl6.daddr = np->daddr;
 
        res = ip6_xmit(sk, skb, &fl6, np->opt, np->tclass);
        rcu_read_unlock();
index 4566dbd916d36a346bdf49b0f1b2b9e5c4e866e3..b7867a1215b1758a8b99b4f3261519f991a8986d 100644 (file)
@@ -386,7 +386,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
                err = -EINVAL;
                goto done;
        }
-       ipv6_addr_copy(&fl->dst, &freq->flr_dst);
+       fl->dst = freq->flr_dst;
        atomic_set(&fl->users, 1);
        switch (fl->share) {
        case IPV6_FL_S_EXCL:
index 68ef97f353b65b8d7c2abafb12f272dcc79db32b..a24e15557843521940693bb7f42033664e0ea69d 100644 (file)
@@ -238,8 +238,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
        hdr->nexthdr = proto;
        hdr->hop_limit = hlimit;
 
-       ipv6_addr_copy(&hdr->saddr, &fl6->saddr);
-       ipv6_addr_copy(&hdr->daddr, first_hop);
+       hdr->saddr = fl6->saddr;
+       hdr->daddr = *first_hop;
 
        skb->priority = sk->sk_priority;
        skb->mark = sk->sk_mark;
@@ -290,8 +290,8 @@ int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev,
        hdr->nexthdr = proto;
        hdr->hop_limit = np->hop_limit;
 
-       ipv6_addr_copy(&hdr->saddr, saddr);
-       ipv6_addr_copy(&hdr->daddr, daddr);
+       hdr->saddr = *saddr;
+       hdr->daddr = *daddr;
 
        return 0;
 }
@@ -1063,7 +1063,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
        if (err)
                return ERR_PTR(err);
        if (final_dst)
-               ipv6_addr_copy(&fl6->daddr, final_dst);
+               fl6->daddr = *final_dst;
        if (can_sleep)
                fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP;
 
@@ -1099,7 +1099,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
        if (err)
                return ERR_PTR(err);
        if (final_dst)
-               ipv6_addr_copy(&fl6->daddr, final_dst);
+               fl6->daddr = *final_dst;
        if (can_sleep)
                fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP;
 
@@ -1592,7 +1592,7 @@ int ip6_push_pending_frames(struct sock *sk)
        if (np->pmtudisc < IPV6_PMTUDISC_DO)
                skb->local_df = 1;
 
-       ipv6_addr_copy(final_dst, &fl6->daddr);
+       *final_dst = fl6->daddr;
        __skb_pull(skb, skb_network_header_len(skb));
        if (opt && opt->opt_flen)
                ipv6_push_frag_opts(skb, opt, &proto);
@@ -1608,8 +1608,8 @@ int ip6_push_pending_frames(struct sock *sk)
 
        hdr->hop_limit = np->cork.hop_limit;
        hdr->nexthdr = proto;
-       ipv6_addr_copy(&hdr->saddr, &fl6->saddr);
-       ipv6_addr_copy(&hdr->daddr, final_dst);
+       hdr->saddr = fl6->saddr;
+       hdr->daddr = *final_dst;
 
        skb->priority = sk->sk_priority;
        skb->mark = sk->sk_mark;
index 83f0e31c5fbd65663c859dff90e5a00b81bd8a4b..f5f98f558acbcb8b7e3d0f2096aec65bb08612d3 100644 (file)
@@ -979,8 +979,8 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
        ipv6_change_dsfield(ipv6h, ~INET_ECN_MASK, dsfield);
        ipv6h->hop_limit = t->parms.hop_limit;
        ipv6h->nexthdr = proto;
-       ipv6_addr_copy(&ipv6h->saddr, &fl6->saddr);
-       ipv6_addr_copy(&ipv6h->daddr, &fl6->daddr);
+       ipv6h->saddr = fl6->saddr;
+       ipv6h->daddr = fl6->daddr;
        nf_reset(skb);
        pkt_len = skb->len;
        err = ip6_local_out(skb);
@@ -1155,8 +1155,8 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
        memcpy(dev->broadcast, &p->raddr, sizeof(struct in6_addr));
 
        /* Set up flowi template */
-       ipv6_addr_copy(&fl6->saddr, &p->laddr);
-       ipv6_addr_copy(&fl6->daddr, &p->raddr);
+       fl6->saddr = p->laddr;
+       fl6->daddr = p->raddr;
        fl6->flowi6_oif = p->link;
        fl6->flowlabel = 0;
 
@@ -1212,8 +1212,8 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
 static int
 ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p)
 {
-       ipv6_addr_copy(&t->parms.laddr, &p->laddr);
-       ipv6_addr_copy(&t->parms.raddr, &p->raddr);
+       t->parms.laddr = p->laddr;
+       t->parms.raddr = p->raddr;
        t->parms.flags = p->flags;
        t->parms.hop_limit = p->hop_limit;
        t->parms.encap_limit = p->encap_limit;
index 449a9185b8f228531ae0e10949fa755b2e3b655a..c7e95c8c579f6e71848e3857d18392e5983199c3 100644 (file)
@@ -1105,8 +1105,8 @@ static int ip6mr_cache_report(struct mr6_table *mrt, struct sk_buff *pkt,
                msg->im6_msgtype = MRT6MSG_WHOLEPKT;
                msg->im6_mif = mrt->mroute_reg_vif_num;
                msg->im6_pad = 0;
-               ipv6_addr_copy(&msg->im6_src, &ipv6_hdr(pkt)->saddr);
-               ipv6_addr_copy(&msg->im6_dst, &ipv6_hdr(pkt)->daddr);
+               msg->im6_src = ipv6_hdr(pkt)->saddr;
+               msg->im6_dst = ipv6_hdr(pkt)->daddr;
 
                skb->ip_summed = CHECKSUM_UNNECESSARY;
        } else
@@ -1131,8 +1131,8 @@ static int ip6mr_cache_report(struct mr6_table *mrt, struct sk_buff *pkt,
        msg->im6_msgtype = assert;
        msg->im6_mif = mifi;
        msg->im6_pad = 0;
-       ipv6_addr_copy(&msg->im6_src, &ipv6_hdr(pkt)->saddr);
-       ipv6_addr_copy(&msg->im6_dst, &ipv6_hdr(pkt)->daddr);
+       msg->im6_src = ipv6_hdr(pkt)->saddr;
+       msg->im6_dst = ipv6_hdr(pkt)->daddr;
 
        skb_dst_set(skb, dst_clone(skb_dst(pkt)));
        skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -2181,8 +2181,8 @@ int ip6mr_get_route(struct net *net,
                iph->payload_len = 0;
                iph->nexthdr = IPPROTO_NONE;
                iph->hop_limit = 0;
-               ipv6_addr_copy(&iph->saddr, &rt->rt6i_src.addr);
-               ipv6_addr_copy(&iph->daddr, &rt->rt6i_dst.addr);
+               iph->saddr = rt->rt6i_src.addr;
+               iph->daddr = rt->rt6i_dst.addr;
 
                err = ip6mr_cache_unresolved(mrt, vif, skb2);
                read_unlock(&mrt_lock);
index c99e3ee9781f246f82185e8a0e246e02a258cf82..29993b7079a5394519298946aaf7ad8610e5b327 100644 (file)
@@ -435,7 +435,7 @@ sticky_done:
                        goto e_inval;
 
                np->sticky_pktinfo.ipi6_ifindex = pkt.ipi6_ifindex;
-               ipv6_addr_copy(&np->sticky_pktinfo.ipi6_addr, &pkt.ipi6_addr);
+               np->sticky_pktinfo.ipi6_addr = pkt.ipi6_addr;
                retv = 0;
                break;
        }
@@ -980,8 +980,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
                                struct in6_pktinfo src_info;
                                src_info.ipi6_ifindex = np->mcast_oif ? np->mcast_oif :
                                        np->sticky_pktinfo.ipi6_ifindex;
-                               np->mcast_oif? ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr) :
-                                       ipv6_addr_copy(&src_info.ipi6_addr, &(np->sticky_pktinfo.ipi6_addr));
+                               src_info.ipi6_addr = np->mcast_oif ? np->daddr : np->sticky_pktinfo.ipi6_addr;
                                put_cmsg(&msg, SOL_IPV6, IPV6_PKTINFO, sizeof(src_info), &src_info);
                        }
                        if (np->rxopt.bits.rxhlim) {
@@ -992,8 +991,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
                                struct in6_pktinfo src_info;
                                src_info.ipi6_ifindex = np->mcast_oif ? np->mcast_oif :
                                        np->sticky_pktinfo.ipi6_ifindex;
-                               np->mcast_oif? ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr) :
-                                       ipv6_addr_copy(&src_info.ipi6_addr, &(np->sticky_pktinfo.ipi6_addr));
+                               src_info.ipi6_addr = np->mcast_oif ? np->daddr : np->sticky_pktinfo.ipi6_addr;
                                put_cmsg(&msg, SOL_IPV6, IPV6_2292PKTINFO, sizeof(src_info), &src_info);
                        }
                        if (np->rxopt.bits.rxohlim) {
index 7b94bebb73b198e8abdedd1de88bed78b3104e10..6cc4d1fb8c132fb680353d70cac47c17598c326b 100644 (file)
@@ -155,7 +155,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
                return -ENOMEM;
 
        mc_lst->next = NULL;
-       ipv6_addr_copy(&mc_lst->addr, addr);
+       mc_lst->addr = *addr;
 
        rcu_read_lock();
        if (ifindex == 0) {
@@ -858,7 +858,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr)
 
        setup_timer(&mc->mca_timer, igmp6_timer_handler, (unsigned long)mc);
 
-       ipv6_addr_copy(&mc->mca_addr, addr);
+       mc->mca_addr = *addr;
        mc->idev = idev; /* (reference taken) */
        mc->mca_users = 1;
        /* mca_stamp should be updated upon changes */
@@ -1776,7 +1776,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
        hdr = (struct mld_msg *) skb_put(skb, sizeof(struct mld_msg));
        memset(hdr, 0, sizeof(struct mld_msg));
        hdr->mld_type = type;
-       ipv6_addr_copy(&hdr->mld_mca, addr);
+       hdr->mld_mca = *addr;
 
        hdr->mld_cksum = csum_ipv6_magic(saddr, snd_addr, len,
                                         IPPROTO_ICMPV6,
index 43242e6e610301c2a662932f3f910ab6ed6e573d..7e1e0fbfef21f1f17f076d2445e62e5d2cd303af 100644 (file)
@@ -195,8 +195,8 @@ static inline int mip6_report_rl_allow(struct timeval *stamp,
                mip6_report_rl.stamp.tv_sec = stamp->tv_sec;
                mip6_report_rl.stamp.tv_usec = stamp->tv_usec;
                mip6_report_rl.iif = iif;
-               ipv6_addr_copy(&mip6_report_rl.src, src);
-               ipv6_addr_copy(&mip6_report_rl.dst, dst);
+               mip6_report_rl.src = *src;
+               mip6_report_rl.dst = *dst;
                allow = 1;
        }
        spin_unlock_bh(&mip6_report_rl.lock);
index d699ddcad4cedcfba34ff222ff244c0acf943e62..a4769881c5b5eea69d4a1c00fd9012a85330ad01 100644 (file)
@@ -481,7 +481,7 @@ struct sk_buff *ndisc_build_skb(struct net_device *dev,
 
        opt = skb_transport_header(skb) + sizeof(struct icmp6hdr);
        if (target) {
-               ipv6_addr_copy((struct in6_addr *)opt, target);
+               *(struct in6_addr *)opt = *target;
                opt += sizeof(*target);
        }
 
@@ -1622,9 +1622,9 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
         */
 
        addrp = (struct in6_addr *)(icmph + 1);
-       ipv6_addr_copy(addrp, target);
+       *addrp = *target;
        addrp++;
-       ipv6_addr_copy(addrp, &ipv6_hdr(skb)->daddr);
+       *addrp = ipv6_hdr(skb)->daddr;
 
        opt = (u8*) (addrp + 1);
 
index a5a4c5dd53961cf1b2432c8317592d1099eafda2..b5a2aa58a03acf828fd0eb0247dfafef09335969 100644 (file)
@@ -93,8 +93,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_TCP;
-       ipv6_addr_copy(&fl6.saddr, &oip6h->daddr);
-       ipv6_addr_copy(&fl6.daddr, &oip6h->saddr);
+       fl6.saddr = oip6h->daddr;
+       fl6.daddr = oip6h->saddr;
        fl6.fl6_sport = otcph.dest;
        fl6.fl6_dport = otcph.source;
        security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
@@ -129,8 +129,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
        *(__be32 *)ip6h =  htonl(0x60000000 | (tclass << 20));
        ip6h->hop_limit = ip6_dst_hoplimit(dst);
        ip6h->nexthdr = IPPROTO_TCP;
-       ipv6_addr_copy(&ip6h->saddr, &oip6h->daddr);
-       ipv6_addr_copy(&ip6h->daddr, &oip6h->saddr);
+       ip6h->saddr = oip6h->daddr;
+       ip6h->daddr = oip6h->saddr;
 
        tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
        /* Truncate to length (no data) */
index a1aa869a9ce7ef9130b1f434432e0aba776eb867..a4894f4f1944e600d93a1f2a9cde719cfe528bb0 100644 (file)
@@ -299,9 +299,9 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
        }
 
        inet->inet_rcv_saddr = inet->inet_saddr = v4addr;
-       ipv6_addr_copy(&np->rcv_saddr, &addr->sin6_addr);
+       np->rcv_saddr = addr->sin6_addr;
        if (!(addr_type & IPV6_ADDR_MULTICAST))
-               ipv6_addr_copy(&np->saddr, &addr->sin6_addr);
+               np->saddr = addr->sin6_addr;
        err = 0;
 out_unlock:
        rcu_read_unlock();
@@ -495,7 +495,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
        if (sin6) {
                sin6->sin6_family = AF_INET6;
                sin6->sin6_port = 0;
-               ipv6_addr_copy(&sin6->sin6_addr, &ipv6_hdr(skb)->saddr);
+               sin6->sin6_addr = ipv6_hdr(skb)->saddr;
                sin6->sin6_flowinfo = 0;
                sin6->sin6_scope_id = 0;
                if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
@@ -846,11 +846,11 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
                goto out;
 
        if (!ipv6_addr_any(daddr))
-               ipv6_addr_copy(&fl6.daddr, daddr);
+               fl6.daddr = *daddr;
        else
                fl6.daddr.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
        if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
-               ipv6_addr_copy(&fl6.saddr, &np->saddr);
+               fl6.saddr = np->saddr;
 
        final_p = fl6_update_dst(&fl6, opt, &final);
 
index dfb164e9051aef20af12cba8072dae4dfdb058e5..b69fae76a6f1c18fa326a828b7b47fa8ade3b94c 100644 (file)
@@ -153,8 +153,8 @@ void ip6_frag_init(struct inet_frag_queue *q, void *a)
 
        fq->id = arg->id;
        fq->user = arg->user;
-       ipv6_addr_copy(&fq->saddr, arg->src);
-       ipv6_addr_copy(&fq->daddr, arg->dst);
+       fq->saddr = *arg->src;
+       fq->daddr = *arg->dst;
 }
 EXPORT_SYMBOL(ip6_frag_init);
 
index 05c89be04c9f0ac9a6e3768503448c822a5205bf..2897403fdaff027b0e974df0b4c8643c3bbbdede 100644 (file)
@@ -729,14 +729,14 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort,
                        if (rt->rt6i_dst.plen != 128 &&
                            ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
                                rt->rt6i_flags |= RTF_ANYCAST;
-                       ipv6_addr_copy(&rt->rt6i_gateway, daddr);
+                       rt->rt6i_gateway = *daddr;
                }
 
                rt->rt6i_flags |= RTF_CACHE;
 
 #ifdef CONFIG_IPV6_SUBTREES
                if (rt->rt6i_src.plen && saddr) {
-                       ipv6_addr_copy(&rt->rt6i_src.addr, saddr);
+                       rt->rt6i_src.addr = *saddr;
                        rt->rt6i_src.plen = 128;
                }
 #endif
@@ -932,7 +932,7 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori
                        in6_dev_hold(rt->rt6i_idev);
                rt->rt6i_expires = 0;
 
-               ipv6_addr_copy(&rt->rt6i_gateway, &ort->rt6i_gateway);
+               rt->rt6i_gateway = ort->rt6i_gateway;
                rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
                rt->rt6i_metric = 0;
 
@@ -1087,7 +1087,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
        rt->dst.output  = ip6_output;
        dst_set_neighbour(&rt->dst, neigh);
        atomic_set(&rt->dst.__refcnt, 1);
-       ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
+       rt->rt6i_dst.addr = *addr;
        rt->rt6i_dst.plen = 128;
        rt->rt6i_idev     = idev;
        dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
@@ -1324,7 +1324,7 @@ int ip6_route_add(struct fib6_config *cfg)
                int gwa_type;
 
                gw_addr = &cfg->fc_gateway;
-               ipv6_addr_copy(&rt->rt6i_gateway, gw_addr);
+               rt->rt6i_gateway = *gw_addr;
                gwa_type = ipv6_addr_type(gw_addr);
 
                if (gwa_type != (IPV6_ADDR_LINKLOCAL|IPV6_ADDR_UNICAST)) {
@@ -1378,7 +1378,7 @@ int ip6_route_add(struct fib6_config *cfg)
                        err = -EINVAL;
                        goto out;
                }
-               ipv6_addr_copy(&rt->rt6i_prefsrc.addr, &cfg->fc_prefsrc);
+               rt->rt6i_prefsrc.addr = cfg->fc_prefsrc;
                rt->rt6i_prefsrc.plen = 128;
        } else
                rt->rt6i_prefsrc.plen = 0;
@@ -1575,7 +1575,7 @@ static struct rt6_info *ip6_route_redirect(const struct in6_addr *dest,
                },
        };
 
-       ipv6_addr_copy(&rdfl.gateway, gateway);
+       rdfl.gateway = *gateway;
 
        if (rt6_need_strict(dest))
                flags |= RT6_LOOKUP_F_IFACE;
@@ -1631,7 +1631,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
        if (on_link)
                nrt->rt6i_flags &= ~RTF_GATEWAY;
 
-       ipv6_addr_copy(&nrt->rt6i_gateway, (struct in6_addr*)neigh->primary_key);
+       nrt->rt6i_gateway = *(struct in6_addr *)neigh->primary_key;
        dst_set_neighbour(&nrt->dst, neigh_clone(neigh));
 
        if (ip6_ins_rt(nrt))
@@ -1777,7 +1777,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort,
                rt->dst.output = ort->dst.output;
                rt->dst.flags |= DST_HOST;
 
-               ipv6_addr_copy(&rt->rt6i_dst.addr, dest);
+               rt->rt6i_dst.addr = *dest;
                rt->rt6i_dst.plen = 128;
                dst_copy_metrics(&rt->dst, &ort->dst);
                rt->dst.error = ort->dst.error;
@@ -1787,7 +1787,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort,
                rt->dst.lastuse = jiffies;
                rt->rt6i_expires = 0;
 
-               ipv6_addr_copy(&rt->rt6i_gateway, &ort->rt6i_gateway);
+               rt->rt6i_gateway = ort->rt6i_gateway;
                rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
                rt->rt6i_metric = 0;
 
@@ -1850,8 +1850,8 @@ static struct rt6_info *rt6_add_route_info(struct net *net,
                .fc_nlinfo.nl_net = net,
        };
 
-       ipv6_addr_copy(&cfg.fc_dst, prefix);
-       ipv6_addr_copy(&cfg.fc_gateway, gwaddr);
+       cfg.fc_dst = *prefix;
+       cfg.fc_gateway = *gwaddr;
 
        /* We should treat it as a default route if prefix length is 0. */
        if (!prefixlen)
@@ -1900,7 +1900,7 @@ struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr,
                .fc_nlinfo.nl_net = dev_net(dev),
        };
 
-       ipv6_addr_copy(&cfg.fc_gateway, gwaddr);
+       cfg.fc_gateway = *gwaddr;
 
        ip6_route_add(&cfg);
 
@@ -1946,9 +1946,9 @@ static void rtmsg_to_fib6_config(struct net *net,
 
        cfg->fc_nlinfo.nl_net = net;
 
-       ipv6_addr_copy(&cfg->fc_dst, &rtmsg->rtmsg_dst);
-       ipv6_addr_copy(&cfg->fc_src, &rtmsg->rtmsg_src);
-       ipv6_addr_copy(&cfg->fc_gateway, &rtmsg->rtmsg_gateway);
+       cfg->fc_dst = rtmsg->rtmsg_dst;
+       cfg->fc_src = rtmsg->rtmsg_src;
+       cfg->fc_gateway = rtmsg->rtmsg_gateway;
 }
 
 int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg)
@@ -2082,7 +2082,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
        }
        dst_set_neighbour(&rt->dst, neigh);
 
-       ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
+       rt->rt6i_dst.addr = *addr;
        rt->rt6i_dst.plen = 128;
        rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL);
 
@@ -2100,7 +2100,7 @@ int ip6_route_get_saddr(struct net *net,
        struct inet6_dev *idev = ip6_dst_idev((struct dst_entry*)rt);
        int err = 0;
        if (rt->rt6i_prefsrc.plen)
-               ipv6_addr_copy(saddr, &rt->rt6i_prefsrc.addr);
+               *saddr = rt->rt6i_prefsrc.addr;
        else
                err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL,
                                         daddr, prefs, saddr);
@@ -2439,7 +2439,7 @@ static int rt6_fill_node(struct net *net,
 
        if (rt->rt6i_prefsrc.plen) {
                struct in6_addr saddr_buf;
-               ipv6_addr_copy(&saddr_buf, &rt->rt6i_prefsrc.addr);
+               saddr_buf = rt->rt6i_prefsrc.addr;
                NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf);
        }
 
@@ -2513,14 +2513,14 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
                if (nla_len(tb[RTA_SRC]) < sizeof(struct in6_addr))
                        goto errout;
 
-               ipv6_addr_copy(&fl6.saddr, nla_data(tb[RTA_SRC]));
+               fl6.saddr = *(struct in6_addr *)nla_data(tb[RTA_SRC]);
        }
 
        if (tb[RTA_DST]) {
                if (nla_len(tb[RTA_DST]) < sizeof(struct in6_addr))
                        goto errout;
 
-               ipv6_addr_copy(&fl6.daddr, nla_data(tb[RTA_DST]));
+               fl6.daddr = *(struct in6_addr *)nla_data(tb[RTA_DST]);
        }
 
        if (tb[RTA_IIF])
index cec09382282d30e0bd0f606c7caae125ea59f1dc..50968f226e75e8b573dbea9fd31f6b246f774865 100644 (file)
@@ -914,7 +914,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
                                goto done;
 #ifdef CONFIG_IPV6_SIT_6RD
                } else {
-                       ipv6_addr_copy(&ip6rd.prefix, &t->ip6rd.prefix);
+                       ip6rd.prefix = t->ip6rd.prefix;
                        ip6rd.relay_prefix = t->ip6rd.relay_prefix;
                        ip6rd.prefixlen = t->ip6rd.prefixlen;
                        ip6rd.relay_prefixlen = t->ip6rd.relay_prefixlen;
@@ -1082,7 +1082,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
                        if (relay_prefix != ip6rd.relay_prefix)
                                goto done;
 
-                       ipv6_addr_copy(&t->ip6rd.prefix, &prefix);
+                       t->ip6rd.prefix = prefix;
                        t->ip6rd.relay_prefix = relay_prefix;
                        t->ip6rd.prefixlen = ip6rd.prefixlen;
                        t->ip6rd.relay_prefixlen = ip6rd.relay_prefixlen;
index 5a0d6648bbbc79107baca7a39358463ab31d02ea..8e951d8d3b814e6eefc2583ee054f5a85b75ba91 100644 (file)
@@ -200,8 +200,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
        req->mss = mss;
        ireq->rmt_port = th->source;
        ireq->loc_port = th->dest;
-       ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
-       ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
+       ireq6->rmt_addr = ipv6_hdr(skb)->saddr;
+       ireq6->loc_addr = ipv6_hdr(skb)->daddr;
        if (ipv6_opt_accepted(sk, skb) ||
            np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
            np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
@@ -237,9 +237,9 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
                struct flowi6 fl6;
                memset(&fl6, 0, sizeof(fl6));
                fl6.flowi6_proto = IPPROTO_TCP;
-               ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
+               fl6.daddr = ireq6->rmt_addr;
                final_p = fl6_update_dst(&fl6, np->opt, &final);
-               ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
+               fl6.saddr = ireq6->loc_addr;
                fl6.flowi6_oif = sk->sk_bound_dev_if;
                fl6.flowi6_mark = sk->sk_mark;
                fl6.fl6_dport = inet_rsk(req)->rmt_port;
index 36131d122a6f3f9007776ff343a9197bd0430b0a..fd98dd010fcbc3d7881dec9ec664c2800edf1c2c 100644 (file)
@@ -153,7 +153,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                        flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
                        if (flowlabel == NULL)
                                return -EINVAL;
-                       ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
+                       usin->sin6_addr = flowlabel->dst;
                        fl6_sock_release(flowlabel);
                }
        }
@@ -195,7 +195,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                tp->write_seq = 0;
        }
 
-       ipv6_addr_copy(&np->daddr, &usin->sin6_addr);
+       np->daddr = usin->sin6_addr;
        np->flow_label = fl6.flowlabel;
 
        /*
@@ -244,9 +244,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
                saddr = &np->rcv_saddr;
 
        fl6.flowi6_proto = IPPROTO_TCP;
-       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-       ipv6_addr_copy(&fl6.saddr,
-                      (saddr ? saddr : &np->saddr));
+       fl6.daddr = np->daddr;
+       fl6.saddr = saddr ? *saddr : np->saddr;
        fl6.flowi6_oif = sk->sk_bound_dev_if;
        fl6.flowi6_mark = sk->sk_mark;
        fl6.fl6_dport = usin->sin6_port;
@@ -264,11 +263,11 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
 
        if (saddr == NULL) {
                saddr = &fl6.saddr;
-               ipv6_addr_copy(&np->rcv_saddr, saddr);
+               np->rcv_saddr = *saddr;
        }
 
        /* set the source address */
-       ipv6_addr_copy(&np->saddr, saddr);
+       np->saddr = *saddr;
        inet->inet_rcv_saddr = LOOPBACK4_IPV6;
 
        sk->sk_gso_type = SKB_GSO_TCPV6;
@@ -398,8 +397,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
                         */
                        memset(&fl6, 0, sizeof(fl6));
                        fl6.flowi6_proto = IPPROTO_TCP;
-                       ipv6_addr_copy(&fl6.daddr, &np->daddr);
-                       ipv6_addr_copy(&fl6.saddr, &np->saddr);
+                       fl6.daddr = np->daddr;
+                       fl6.saddr = np->saddr;
                        fl6.flowi6_oif = sk->sk_bound_dev_if;
                        fl6.flowi6_mark = sk->sk_mark;
                        fl6.fl6_dport = inet->inet_dport;
@@ -489,8 +488,8 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
 
        memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_proto = IPPROTO_TCP;
-       ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
-       ipv6_addr_copy(&fl6.saddr, &treq->loc_addr);
+       fl6.daddr = treq->rmt_addr;
+       fl6.saddr = treq->loc_addr;
        fl6.flowlabel = 0;
        fl6.flowi6_oif = treq->iif;
        fl6.flowi6_mark = sk->sk_mark;
@@ -512,7 +511,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
        if (skb) {
                __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr);
 
-               ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
+               fl6.daddr = treq->rmt_addr;
                err = ip6_xmit(sk, skb, &fl6, opt, np->tclass);
                err = net_xmit_eval(err);
        }
@@ -617,8 +616,7 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer,
                        tp->md5sig_info->alloced6++;
                }
 
-               ipv6_addr_copy(&tp->md5sig_info->keys6[tp->md5sig_info->entries6].addr,
-                              peer);
+               tp->md5sig_info->keys6[tp->md5sig_info->entries6].addr = *peer;
                tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.key = newkey;
                tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.keylen = newkeylen;
 
@@ -750,8 +748,8 @@ static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp,
 
        bp = &hp->md5_blk.ip6;
        /* 1. TCP pseudo-header (RFC2460) */
-       ipv6_addr_copy(&bp->saddr, saddr);
-       ipv6_addr_copy(&bp->daddr, daddr);
+       bp->saddr = *saddr;
+       bp->daddr = *daddr;
        bp->protocol = cpu_to_be32(IPPROTO_TCP);
        bp->len = cpu_to_be32(nbytes);
 
@@ -1039,8 +1037,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
 #endif
 
        memset(&fl6, 0, sizeof(fl6));
-       ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->saddr);
-       ipv6_addr_copy(&fl6.saddr, &ipv6_hdr(skb)->daddr);
+       fl6.daddr = ipv6_hdr(skb)->saddr;
+       fl6.saddr = ipv6_hdr(skb)->daddr;
 
        buff->ip_summed = CHECKSUM_PARTIAL;
        buff->csum = 0;
@@ -1250,8 +1248,8 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
        tcp_openreq_init(req, &tmp_opt, skb);
 
        treq = inet6_rsk(req);
-       ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr);
-       ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr);
+       treq->rmt_addr = ipv6_hdr(skb)->saddr;
+       treq->loc_addr = ipv6_hdr(skb)->daddr;
        if (!want_cookie || tmp_opt.tstamp_ok)
                TCP_ECN_create_request(req, tcp_hdr(skb));
 
@@ -1380,7 +1378,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 
                ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr);
 
-               ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr);
+               newnp->rcv_saddr = newnp->saddr;
 
                inet_csk(newsk)->icsk_af_ops = &ipv6_mapped;
                newsk->sk_backlog_rcv = tcp_v4_do_rcv;
@@ -1444,9 +1442,9 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 
        memcpy(newnp, np, sizeof(struct ipv6_pinfo));
 
-       ipv6_addr_copy(&newnp->daddr, &treq->rmt_addr);
-       ipv6_addr_copy(&newnp->saddr, &treq->loc_addr);
-       ipv6_addr_copy(&newnp->rcv_saddr, &treq->loc_addr);
+       newnp->daddr = treq->rmt_addr;
+       newnp->saddr = treq->loc_addr;
+       newnp->rcv_saddr = treq->loc_addr;
        newsk->sk_bound_dev_if = treq->iif;
 
        /* Now IPv6 options...
index ccfb0451b1c310ba04520468dac7efdb8dc5fc4e..84ec9db86ee07f1388c6ef9c0c9576558fd66bee 100644 (file)
@@ -417,8 +417,7 @@ try_again:
                        ipv6_addr_set_v4mapped(ip_hdr(skb)->saddr,
                                               &sin6->sin6_addr);
                else {
-                       ipv6_addr_copy(&sin6->sin6_addr,
-                                      &ipv6_hdr(skb)->saddr);
+                       sin6->sin6_addr = ipv6_hdr(skb)->saddr;
                        if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
                                sin6->sin6_scope_id = IP6CB(skb)->iif;
                }
@@ -1115,11 +1114,11 @@ do_udp_sendmsg:
 
        fl6.flowi6_proto = sk->sk_protocol;
        if (!ipv6_addr_any(daddr))
-               ipv6_addr_copy(&fl6.daddr, daddr);
+               fl6.daddr = *daddr;
        else
                fl6.daddr.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
        if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
-               ipv6_addr_copy(&fl6.saddr, &np->saddr);
+               fl6.saddr = np->saddr;
        fl6.fl6_sport = inet->inet_sport;
 
        final_p = fl6_update_dst(&fl6, opt, &final);
index 3437d7d4eed6dcff351adcd7645dffd919c3477e..a81ce9450750f87a207499e888814a76009c0286 100644 (file)
@@ -72,8 +72,8 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb)
                top_iph->nexthdr = IPPROTO_BEETPH;
        }
 
-       ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
-       ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
+       top_iph->saddr = *(struct in6_addr *)&x->props.saddr;
+       top_iph->daddr = *(struct in6_addr *)&x->id.daddr;
        return 0;
 }
 
@@ -99,8 +99,8 @@ static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
        ip6h = ipv6_hdr(skb);
        ip6h->payload_len = htons(skb->len - size);
-       ipv6_addr_copy(&ip6h->daddr, (struct in6_addr *) &x->sel.daddr.a6);
-       ipv6_addr_copy(&ip6h->saddr, (struct in6_addr *) &x->sel.saddr.a6);
+       ip6h->daddr = *(struct in6_addr *)&x->sel.daddr.a6;
+       ip6h->saddr = *(struct in6_addr *)&x->sel.saddr.a6;
        err = 0;
 out:
        return err;
index 4d6edff0498f6a1e55e2301aa958d0fde5556baa..261e6e6f487e818eba1e670bace7f031efd60631 100644 (file)
@@ -55,8 +55,8 @@ static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
                dsfield &= ~INET_ECN_MASK;
        ipv6_change_dsfield(top_iph, 0, dsfield);
        top_iph->hop_limit = ip6_dst_hoplimit(dst->child);
-       ipv6_addr_copy(&top_iph->saddr, (const struct in6_addr *)&x->props.saddr);
-       ipv6_addr_copy(&top_iph->daddr, (const struct in6_addr *)&x->id.daddr);
+       top_iph->saddr = *(struct in6_addr *)&x->props.saddr;
+       top_iph->daddr = *(struct in6_addr *)&x->id.daddr;
        return 0;
 }
 
index faae41737fca3ddc77c0e125ed854ae1b580d609..4eeff89c1aaa7d44d8b6369583b0b9e1c15317e9 100644 (file)
@@ -49,7 +49,7 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
        struct sock *sk = skb->sk;
 
        fl6.flowi6_oif = sk->sk_bound_dev_if;
-       ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->daddr);
+       fl6.daddr = ipv6_hdr(skb)->daddr;
 
        ipv6_local_rxpmtu(sk, &fl6, mtu);
 }
@@ -60,7 +60,7 @@ static void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
        struct sock *sk = skb->sk;
 
        fl6.fl6_dport = inet_sk(sk)->inet_dport;
-       ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->daddr);
+       fl6.daddr = ipv6_hdr(skb)->daddr;
 
        ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
 }
index d879f7efbd10b676be5887ab6460cfb8bee881d9..8ea65e032733731d15b7579a1047f56d307cbbe3 100644 (file)
@@ -132,8 +132,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
        memset(fl6, 0, sizeof(struct flowi6));
        fl6->flowi6_mark = skb->mark;
 
-       ipv6_addr_copy(&fl6->daddr, reverse ? &hdr->saddr : &hdr->daddr);
-       ipv6_addr_copy(&fl6->saddr, reverse ? &hdr->daddr : &hdr->saddr);
+       fl6->daddr = reverse ? hdr->saddr : hdr->daddr;
+       fl6->saddr = reverse ? hdr->daddr : hdr->saddr;
 
        while (nh + offset + 1 < skb->data ||
               pskb_may_pull(skb, nh + offset + 1 - skb->data)) {
index f2d72b8a3faa14e0cf8f7c179d86f4d33e88b961..3f2f7c4ab7210d5948c22a6e417bc0046b1631b0 100644 (file)
@@ -27,8 +27,8 @@ __xfrm6_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
 
        /* Initialize temporary selector matching only
         * to current session. */
-       ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl6->daddr);
-       ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl6->saddr);
+       *(struct in6_addr *)&sel->daddr = fl6->daddr;
+       *(struct in6_addr *)&sel->saddr = fl6->saddr;
        sel->dport = xfrm_flowi_dport(fl, &fl6->uli);
        sel->dport_mask = htons(0xffff);
        sel->sport = xfrm_flowi_sport(fl, &fl6->uli);
index 1e733e9073d0014cf4cfc5e3a6800624159008c2..bfc0bef170cb2229148441a18c4ab110b8a12c56 100644 (file)
@@ -712,7 +712,7 @@ static unsigned int pfkey_sockaddr_fill(const xfrm_address_t *xaddr, __be16 port
                sin6->sin6_family = AF_INET6;
                sin6->sin6_port = port;
                sin6->sin6_flowinfo = 0;
-               ipv6_addr_copy(&sin6->sin6_addr, (const struct in6_addr *)xaddr->a6);
+               sin6->sin6_addr = *(struct in6_addr *)xaddr->a6;
                sin6->sin6_scope_id = 0;
                return 128;
            }
index f2d576e6b76972ad6f1a3d90127677dc41d253bf..4015fcaf87bc9556726e5a73b1ebaae1ab29595c 100644 (file)
@@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_ip6_elem *elem)
 static inline void
 hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src)
 {
-       ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
+       dst->ip.in6 = src->ip.in6;
 }
 
 static inline void
index 60d016541c586b102f8e97686bbb49db8a9329eb..28988196775e67a39bcf954e004068d2de456db5 100644 (file)
@@ -267,7 +267,7 @@ static inline void
 hash_net6_data_copy(struct hash_net6_elem *dst,
                    const struct hash_net6_elem *src)
 {
-       ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
+       dst->ip.in6 = src->ip.in6;
        dst->cidr = src->cidr;
 }
 
index 093cc327020fba6f09a6b4bfcabfc9386d892d02..611c3359b94d9fcc6336bb456c97d4106f6c7892 100644 (file)
@@ -983,7 +983,7 @@ static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related,
        if (!cp)
                return NF_ACCEPT;
 
-       ipv6_addr_copy(&snet.in6, &iph->saddr);
+       snet.in6 = iph->saddr;
        return handle_response_icmp(AF_INET6, skb, &snet, cih->nexthdr, cp,
                                    pp, offset, sizeof(struct ipv6hdr));
 }
index 3cdd479f9b5d179292182bb2711ec243b57736ee..bcf5563e483733eaba8a16956835a28366ea613f 100644 (file)
@@ -603,9 +603,9 @@ sloop:
 #ifdef CONFIG_IP_VS_IPV6
        if (cp->af == AF_INET6) {
                p += sizeof(struct ip_vs_sync_v6);
-               ipv6_addr_copy(&s->v6.caddr, &cp->caddr.in6);
-               ipv6_addr_copy(&s->v6.vaddr, &cp->vaddr.in6);
-               ipv6_addr_copy(&s->v6.daddr, &cp->daddr.in6);
+               s->v6.caddr = cp->caddr.in6;
+               s->v6.vaddr = cp->vaddr.in6;
+               s->v6.daddr = cp->daddr.in6;
        } else
 #endif
        {
index aa2d7206ee8a064a5fbc57e88f655fb42e7fe21f..38a576d05b4be5deed6496a9097972c407653544 100644 (file)
@@ -235,7 +235,7 @@ __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr,
                        goto out_err;
                }
        }
-       ipv6_addr_copy(ret_saddr, &fl6.saddr);
+       *ret_saddr = fl6.saddr;
        return dst;
 
 out_err:
@@ -279,7 +279,7 @@ __ip_vs_get_out_rt_v6(struct sk_buff *skb, struct ip_vs_dest *dest,
                                  atomic_read(&rt->dst.__refcnt));
                }
                if (ret_saddr)
-                       ipv6_addr_copy(ret_saddr, &dest->dst_saddr.in6);
+                       *ret_saddr = dest->dst_saddr.in6;
                spin_unlock(&dest->dst_lock);
        } else {
                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,
        /* mangle the packet */
        if (pp->dnat_handler && !pp->dnat_handler(skb, pp, cp))
                goto tx_error;
-       ipv6_addr_copy(&ipv6_hdr(skb)->daddr, &cp->daddr.in6);
+       ipv6_hdr(skb)->daddr = cp->daddr.in6;
 
        if (!local || !skb->dev) {
                /* 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,
        be16_add_cpu(&iph->payload_len, sizeof(*old_iph));
        iph->priority           =       old_iph->priority;
        memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl));
-       ipv6_addr_copy(&iph->daddr, &cp->daddr.in6);
-       ipv6_addr_copy(&iph->saddr, &saddr);
+       iph->daddr = cp->daddr.in6;
+       iph->saddr = saddr;
        iph->hop_limit          =       old_iph->hop_limit;
 
        /* Another hack: avoid icmp_send in ip_fragment */
index f03c2d4539f6b8517530c899b2bc2419e4f80f88..f9368f33e7afe45dcaa23e47da50248d03c39a40 100644 (file)
@@ -750,10 +750,10 @@ static int callforward_do_filter(const union nf_inet_addr *src,
                struct rt6_info *rt1, *rt2;
 
                memset(&fl1, 0, sizeof(fl1));
-               ipv6_addr_copy(&fl1.daddr, &src->in6);
+               fl1.daddr = src->in6;
 
                memset(&fl2, 0, sizeof(fl2));
-               ipv6_addr_copy(&fl2.daddr, &dst->in6);
+               fl2.daddr = dst->in6;
                if (!afinfo->route(&init_net, (struct dst_entry **)&rt1,
                                   flowi6_to_flowi(&fl1), false)) {
                        if (!afinfo->route(&init_net, (struct dst_entry **)&rt2,
index 9e63b43faeed030b5b51118f54722bc68cd2997d..3ecade3966d5f7474704b705ff2f08614299b5f1 100644 (file)
@@ -161,7 +161,7 @@ static u_int32_t tcpmss_reverse_mtu(const struct sk_buff *skb,
                struct flowi6 *fl6 = &fl.u.ip6;
 
                memset(fl6, 0, sizeof(*fl6));
-               ipv6_addr_copy(&fl6->daddr, &ipv6_hdr(skb)->saddr);
+               fl6->daddr = ipv6_hdr(skb)->saddr;
        }
        rcu_read_lock();
        ai = nf_get_afinfo(family);
index b77d383cec7818387d3703ba01b79b0c74bf5f52..c047de2046adc6e3af8efcaad8fa1d3299db47d6 100644 (file)
@@ -42,7 +42,7 @@ static u32 match_lookup_rt6(struct net *net, const struct net_device *dev,
        int route_err;
 
        memset(&flow, 0, sizeof(flow));
-       ipv6_addr_copy(&flow.daddr, addr);
+       flow.daddr = *addr;
        if (dev)
                flow.flowi6_oif = dev->ifindex;
 
index 9c24de10a6579b78e452e47912c56e5d894e58ea..8ed67dccf11dbd09df8ff276aed9a4e2bfbca9cd 100644 (file)
@@ -155,12 +155,12 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
                        if (map6 == NULL)
                                goto cfg_unlbl_map_add_failure;
                        map6->type = NETLBL_NLTYPE_UNLABELED;
-                       ipv6_addr_copy(&map6->list.addr, addr6);
+                       map6->list.addr = *addr6;
                        map6->list.addr.s6_addr32[0] &= mask6->s6_addr32[0];
                        map6->list.addr.s6_addr32[1] &= mask6->s6_addr32[1];
                        map6->list.addr.s6_addr32[2] &= mask6->s6_addr32[2];
                        map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3];
-                       ipv6_addr_copy(&map6->list.mask, mask6);
+                       map6->list.mask = *mask6;
                        map6->list.valid = 1;
                        ret_val = netlbl_af4list_add(&map4->list,
                                                     &addrmap->list4);
index bfa55586977572e668d2a53004513358ce9efcf0..9879300beefdeca345afe7a7873b3384b7a0d959 100644 (file)
@@ -216,12 +216,12 @@ static int netlbl_mgmt_add_common(struct genl_info *info,
                        ret_val = -ENOMEM;
                        goto add_failure;
                }
-               ipv6_addr_copy(&map->list.addr, addr);
+               map->list.addr = *addr;
                map->list.addr.s6_addr32[0] &= mask->s6_addr32[0];
                map->list.addr.s6_addr32[1] &= mask->s6_addr32[1];
                map->list.addr.s6_addr32[2] &= mask->s6_addr32[2];
                map->list.addr.s6_addr32[3] &= mask->s6_addr32[3];
-               ipv6_addr_copy(&map->list.mask, mask);
+               map->list.mask = *mask;
                map->list.valid = 1;
                map->type = entry->type;
 
index e251c2c88521dac541700d7ce1b318ae9f5f23b6..049ccd2447d7ff2fdba13fd3031b2247b1a25eef 100644 (file)
@@ -300,12 +300,12 @@ static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface,
        if (entry == NULL)
                return -ENOMEM;
 
-       ipv6_addr_copy(&entry->list.addr, addr);
+       entry->list.addr = *addr;
        entry->list.addr.s6_addr32[0] &= mask->s6_addr32[0];
        entry->list.addr.s6_addr32[1] &= mask->s6_addr32[1];
        entry->list.addr.s6_addr32[2] &= mask->s6_addr32[2];
        entry->list.addr.s6_addr32[3] &= mask->s6_addr32[3];
-       ipv6_addr_copy(&entry->list.mask, mask);
+       entry->list.mask = *mask;
        entry->list.valid = 1;
        entry->secid = secid;
 
index 810427833bcdc9096e0105bfdb1c731fd71baf31..91f479121c55b830591c1ef338cbe24c154f2773 100644 (file)
@@ -107,7 +107,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
                if (addr) {
                        addr->a.v6.sin6_family = AF_INET6;
                        addr->a.v6.sin6_port = 0;
-                       ipv6_addr_copy(&addr->a.v6.sin6_addr, &ifa->addr);
+                       addr->a.v6.sin6_addr = ifa->addr;
                        addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex;
                        addr->valid = 1;
                        spin_lock_bh(&sctp_local_addr_lock);
@@ -219,8 +219,8 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
        /* Fill in the dest address from the route entry passed with the skb
         * and the source address from the transport.
         */
-       ipv6_addr_copy(&fl6.daddr, &transport->ipaddr.v6.sin6_addr);
-       ipv6_addr_copy(&fl6.saddr, &transport->saddr.v6.sin6_addr);
+       fl6.daddr = transport->ipaddr.v6.sin6_addr;
+       fl6.saddr = transport->saddr.v6.sin6_addr;
 
        fl6.flowlabel = np->flow_label;
        IP6_ECN_flow_xmit(sk, fl6.flowlabel);
@@ -231,7 +231,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
 
        if (np->opt && np->opt->srcrt) {
                struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
-               ipv6_addr_copy(&fl6.daddr, rt0->addr);
+               fl6.daddr = *rt0->addr;
        }
 
        SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n",
@@ -265,7 +265,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
        sctp_scope_t scope;
 
        memset(fl6, 0, sizeof(struct flowi6));
-       ipv6_addr_copy(&fl6->daddr, &daddr->v6.sin6_addr);
+       fl6->daddr = daddr->v6.sin6_addr;
        fl6->fl6_dport = daddr->v6.sin6_port;
        fl6->flowi6_proto = IPPROTO_SCTP;
        if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
@@ -277,7 +277,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
                fl6->fl6_sport = htons(asoc->base.bind_addr.port);
 
        if (saddr) {
-               ipv6_addr_copy(&fl6->saddr, &saddr->v6.sin6_addr);
+               fl6->saddr = saddr->v6.sin6_addr;
                fl6->fl6_sport = saddr->v6.sin6_port;
                SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl6->saddr);
        }
@@ -334,7 +334,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
        }
        rcu_read_unlock();
        if (baddr) {
-               ipv6_addr_copy(&fl6->saddr, &baddr->v6.sin6_addr);
+               fl6->saddr = baddr->v6.sin6_addr;
                fl6->fl6_sport = baddr->v6.sin6_port;
                dst = ip6_dst_lookup_flow(sk, fl6, NULL, false);
        }
@@ -375,7 +375,7 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk,
 
        if (t->dst) {
                saddr->v6.sin6_family = AF_INET6;
-               ipv6_addr_copy(&saddr->v6.sin6_addr, &fl6->saddr);
+               saddr->v6.sin6_addr = fl6->saddr;
        }
 }
 
@@ -400,7 +400,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
                if (addr) {
                        addr->a.v6.sin6_family = AF_INET6;
                        addr->a.v6.sin6_port = 0;
-                       ipv6_addr_copy(&addr->a.v6.sin6_addr, &ifp->addr);
+                       addr->a.v6.sin6_addr = ifp->addr;
                        addr->a.v6.sin6_scope_id = dev->ifindex;
                        addr->valid = 1;
                        INIT_LIST_HEAD(&addr->list);
@@ -416,7 +416,6 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
 static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb,
                             int is_saddr)
 {
-       void *from;
        __be16 *port;
        struct sctphdr *sh;
 
@@ -428,12 +427,11 @@ static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb,
        sh = sctp_hdr(skb);
        if (is_saddr) {
                *port  = sh->source;
-               from = &ipv6_hdr(skb)->saddr;
+               addr->v6.sin6_addr = ipv6_hdr(skb)->saddr;
        } else {
                *port = sh->dest;
-               from = &ipv6_hdr(skb)->daddr;
+               addr->v6.sin6_addr = ipv6_hdr(skb)->daddr;
        }
-       ipv6_addr_copy(&addr->v6.sin6_addr, from);
 }
 
 /* Initialize an sctp_addr from a socket. */
@@ -441,7 +439,7 @@ static void sctp_v6_from_sk(union sctp_addr *addr, struct sock *sk)
 {
        addr->v6.sin6_family = AF_INET6;
        addr->v6.sin6_port = 0;
-       ipv6_addr_copy(&addr->v6.sin6_addr, &inet6_sk(sk)->rcv_saddr);
+       addr->v6.sin6_addr = inet6_sk(sk)->rcv_saddr;
 }
 
 /* Initialize sk->sk_rcv_saddr from sctp_addr. */
@@ -454,7 +452,7 @@ static void sctp_v6_to_sk_saddr(union sctp_addr *addr, struct sock *sk)
                inet6_sk(sk)->rcv_saddr.s6_addr32[3] =
                        addr->v4.sin_addr.s_addr;
        } else {
-               ipv6_addr_copy(&inet6_sk(sk)->rcv_saddr, &addr->v6.sin6_addr);
+               inet6_sk(sk)->rcv_saddr = addr->v6.sin6_addr;
        }
 }
 
@@ -467,7 +465,7 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
                inet6_sk(sk)->daddr.s6_addr32[2] = htonl(0x0000ffff);
                inet6_sk(sk)->daddr.s6_addr32[3] = addr->v4.sin_addr.s_addr;
        } else {
-               ipv6_addr_copy(&inet6_sk(sk)->daddr, &addr->v6.sin6_addr);
+               inet6_sk(sk)->daddr = addr->v6.sin6_addr;
        }
 }
 
@@ -479,7 +477,7 @@ static void sctp_v6_from_addr_param(union sctp_addr *addr,
        addr->v6.sin6_family = AF_INET6;
        addr->v6.sin6_port = port;
        addr->v6.sin6_flowinfo = 0; /* BUG */
-       ipv6_addr_copy(&addr->v6.sin6_addr, &param->v6.addr);
+       addr->v6.sin6_addr = param->v6.addr;
        addr->v6.sin6_scope_id = iif;
 }
 
@@ -493,7 +491,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr,
 
        param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS;
        param->v6.param_hdr.length = htons(length);
-       ipv6_addr_copy(&param->v6.addr, &addr->v6.sin6_addr);
+       param->v6.addr = addr->v6.sin6_addr;
 
        return length;
 }
@@ -504,7 +502,7 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
 {
        addr->sa.sa_family = AF_INET6;
        addr->v6.sin6_port = port;
-       ipv6_addr_copy(&addr->v6.sin6_addr, saddr);
+       addr->v6.sin6_addr = *saddr;
 }
 
 /* Compare addresses exactly.
@@ -759,7 +757,7 @@ static void sctp_inet6_event_msgname(struct sctp_ulpevent *event,
                }
 
                sin6from = &asoc->peer.primary_addr.v6;
-               ipv6_addr_copy(&sin6->sin6_addr, &sin6from->sin6_addr);
+               sin6->sin6_addr = sin6from->sin6_addr;
                if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
                        sin6->sin6_scope_id = sin6from->sin6_scope_id;
        }
@@ -787,7 +785,7 @@ static void sctp_inet6_skb_msgname(struct sk_buff *skb, char *msgname,
                }
 
                /* Otherwise, just copy the v6 address. */
-               ipv6_addr_copy(&sin6->sin6_addr, &ipv6_hdr(skb)->saddr);
+               sin6->sin6_addr = ipv6_hdr(skb)->saddr;
                if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) {
                        struct sctp_ulpevent *ev = sctp_skb2event(skb);
                        sin6->sin6_scope_id = ev->iif;
index 13bf5fcdbff1b9f80d2d0c6288ab98762d499e74..d56c07a3d435034a5cd90acea24db8812764df19 100644 (file)
@@ -804,7 +804,7 @@ static int sctp_send_asconf_del_ip(struct sock              *sk,
                                struct sockaddr_in6 *sin6;
 
                                sin6 = (struct sockaddr_in6 *)addrs;
-                               ipv6_addr_copy(&asoc->asconf_addr_del_pending->v6.sin6_addr, &sin6->sin6_addr);
+                               asoc->asconf_addr_del_pending->v6.sin6_addr = sin6->sin6_addr;
                        }
                        SCTP_DEBUG_PRINTK_IPADDR("send_asconf_del_ip: keep the last address asoc: %p ",
                            " at %p\n", asoc, asoc->asconf_addr_del_pending,
index ce136323da8b1540f8618348b851c86d7b8a6369..fe258fc37f50de5ab1eb64d8ea162f40904ec584 100644 (file)
@@ -134,7 +134,7 @@ static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
        struct ip_map *item = container_of(citem, struct ip_map, h);
 
        strcpy(new->m_class, item->m_class);
-       ipv6_addr_copy(&new->m_addr, &item->m_addr);
+       new->m_addr = item->m_addr;
 }
 static void update(struct cache_head *cnew, struct cache_head *citem)
 {
@@ -274,7 +274,7 @@ static int ip_map_show(struct seq_file *m,
        }
        im = container_of(h, struct ip_map, h);
        /* class addr domain */
-       ipv6_addr_copy(&addr, &im->m_addr);
+       addr = im->m_addr;
 
        if (test_bit(CACHE_VALID, &h->flags) &&
            !test_bit(CACHE_NEGATIVE, &h->flags))
@@ -297,7 +297,7 @@ static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class,
        struct cache_head *ch;
 
        strcpy(ip.m_class, class);
-       ipv6_addr_copy(&ip.m_addr, addr);
+       ip.m_addr = *addr;
        ch = sunrpc_cache_lookup(cd, &ip.h,
                                 hash_str(class, IP_HASHBITS) ^
                                 hash_ip6(*addr));
index 71bed1c1c77a168da2299a1a009fa27e83253b1e..4653286fcc9e685e1d1999c532325ce48870d4f8 100644 (file)
@@ -157,7 +157,7 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
                        cmh->cmsg_level = SOL_IPV6;
                        cmh->cmsg_type = IPV6_PKTINFO;
                        pki->ipi6_ifindex = daddr->sin6_scope_id;
-                       ipv6_addr_copy(&pki->ipi6_addr, &daddr->sin6_addr);
+                       pki->ipi6_addr = daddr->sin6_addr;
                        cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
                }
                break;
@@ -523,7 +523,7 @@ static int svc_udp_get_dest_address6(struct svc_rqst *rqstp,
                return 0;
 
        daddr->sin6_family = AF_INET6;
-       ipv6_addr_copy(&daddr->sin6_addr, &pki->ipi6_addr);
+       daddr->sin6_addr = pki->ipi6_addr;
        daddr->sin6_scope_id = pki->ipi6_ifindex;
        return 1;
 }
index 9414b9c5b1e4284b9ed90e9fe3ff39cdfc07e2ce..5b228f97d4b3308a950ae857828e04e90df86848 100644 (file)
@@ -1035,16 +1035,12 @@ static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m,
                        break;
 
                case AF_INET6:
-                       ipv6_addr_copy((struct in6_addr *)x->sel.daddr.a6,
-                                      (const struct in6_addr *)daddr);
-                       ipv6_addr_copy((struct in6_addr *)x->sel.saddr.a6,
-                                      (const struct in6_addr *)saddr);
+                       *(struct in6_addr *)x->sel.daddr.a6 = *(struct in6_addr *)daddr;
+                       *(struct in6_addr *)x->sel.saddr.a6 = *(struct in6_addr *)saddr;
                        x->sel.prefixlen_d = 128;
                        x->sel.prefixlen_s = 128;
-                       ipv6_addr_copy((struct in6_addr *)x->props.saddr.a6,
-                                      (const struct in6_addr *)saddr);
-                       ipv6_addr_copy((struct in6_addr *)x->id.daddr.a6,
-                                      (const struct in6_addr *)daddr);
+                       *(struct in6_addr *)x->props.saddr.a6 = *(struct in6_addr *)saddr;
+                       *(struct in6_addr *)x->id.daddr.a6 = *(struct in6_addr *)daddr;
                        break;
                }
 
index 893af8a2fa1e994c518b7649ddc9d29b61c8681a..199616bb68d32839fcc4e301686cd64b21bb4269 100644 (file)
@@ -118,8 +118,8 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb,
        ip6 = ipv6_hdr(skb);
        if (ip6 == NULL)
                return -EINVAL;
-       ipv6_addr_copy(&ad->u.net.v6info.saddr, &ip6->saddr);
-       ipv6_addr_copy(&ad->u.net.v6info.daddr, &ip6->daddr);
+       ad->u.net.v6info.saddr = ip6->saddr;
+       ad->u.net.v6info.daddr = ip6->daddr;
        ret = 0;
        /* IPv6 can have several extension header before the Transport header
         * skip them */
index 1126c10a5e821d1d835aa0aa7d83dfba5a04028f..7e6c2564e741ba496ce21589b7740be638cb3a01 100644 (file)
@@ -3567,8 +3567,8 @@ static int selinux_parse_skb_ipv6(struct sk_buff *skb,
        if (ip6 == NULL)
                goto out;
 
-       ipv6_addr_copy(&ad->u.net.v6info.saddr, &ip6->saddr);
-       ipv6_addr_copy(&ad->u.net.v6info.daddr, &ip6->daddr);
+       ad->u.net.v6info.saddr = ip6->saddr;
+       ad->u.net.v6info.daddr = ip6->daddr;
        ret = 0;
 
        nexthdr = ip6->nexthdr;
@@ -3871,7 +3871,7 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
                if (family == PF_INET)
                        ad.u.net.v4info.saddr = addr4->sin_addr.s_addr;
                else
-                       ipv6_addr_copy(&ad.u.net.v6info.saddr, &addr6->sin6_addr);
+                       ad.u.net.v6info.saddr = addr6->sin6_addr;
 
                err = avc_has_perm(sksec->sid, sid,
                                   sksec->sclass, node_perm, &ad);
index 3bf46abaa688cbb7735f1d47cf3d33348f9b019a..86365857c0887b8bd4551c0dc7667c0fba9bf9e2 100644 (file)
@@ -220,7 +220,7 @@ static int sel_netnode_sid_slow(void *addr, u16 family, u32 *sid)
        case PF_INET6:
                ret = security_node_sid(PF_INET6,
                                        addr, sizeof(struct in6_addr), sid);
-               ipv6_addr_copy(&new->nsec.addr.ipv6, addr);
+               new->nsec.addr.ipv6 = *(struct in6_addr *)addr;
                break;
        default:
                BUG();