diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2011-11-20 22:39:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-22 16:43:32 -0500 |
commit | 4e3fd7a06dc20b2d8ec6892233ad2012968fe7b6 (patch) | |
tree | da3fbec7672ac6b967dfa31cec6c88f468a57fa2 /net/ipv6/route.c | |
parent | 40ba84993d66469d336099c5af74c3da5b73e28d (diff) |
net: remove ipv6_addr_copy()
C assignment can handle struct in6_addr copying.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 05c89be04c9f..2897403fdaff 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -729,14 +729,14 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort, | |||
729 | if (rt->rt6i_dst.plen != 128 && | 729 | if (rt->rt6i_dst.plen != 128 && |
730 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) | 730 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) |
731 | rt->rt6i_flags |= RTF_ANYCAST; | 731 | rt->rt6i_flags |= RTF_ANYCAST; |
732 | ipv6_addr_copy(&rt->rt6i_gateway, daddr); | 732 | rt->rt6i_gateway = *daddr; |
733 | } | 733 | } |
734 | 734 | ||
735 | rt->rt6i_flags |= RTF_CACHE; | 735 | rt->rt6i_flags |= RTF_CACHE; |
736 | 736 | ||
737 | #ifdef CONFIG_IPV6_SUBTREES | 737 | #ifdef CONFIG_IPV6_SUBTREES |
738 | if (rt->rt6i_src.plen && saddr) { | 738 | if (rt->rt6i_src.plen && saddr) { |
739 | ipv6_addr_copy(&rt->rt6i_src.addr, saddr); | 739 | rt->rt6i_src.addr = *saddr; |
740 | rt->rt6i_src.plen = 128; | 740 | rt->rt6i_src.plen = 128; |
741 | } | 741 | } |
742 | #endif | 742 | #endif |
@@ -932,7 +932,7 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori | |||
932 | in6_dev_hold(rt->rt6i_idev); | 932 | in6_dev_hold(rt->rt6i_idev); |
933 | rt->rt6i_expires = 0; | 933 | rt->rt6i_expires = 0; |
934 | 934 | ||
935 | ipv6_addr_copy(&rt->rt6i_gateway, &ort->rt6i_gateway); | 935 | rt->rt6i_gateway = ort->rt6i_gateway; |
936 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; | 936 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; |
937 | rt->rt6i_metric = 0; | 937 | rt->rt6i_metric = 0; |
938 | 938 | ||
@@ -1087,7 +1087,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | |||
1087 | rt->dst.output = ip6_output; | 1087 | rt->dst.output = ip6_output; |
1088 | dst_set_neighbour(&rt->dst, neigh); | 1088 | dst_set_neighbour(&rt->dst, neigh); |
1089 | atomic_set(&rt->dst.__refcnt, 1); | 1089 | atomic_set(&rt->dst.__refcnt, 1); |
1090 | ipv6_addr_copy(&rt->rt6i_dst.addr, addr); | 1090 | rt->rt6i_dst.addr = *addr; |
1091 | rt->rt6i_dst.plen = 128; | 1091 | rt->rt6i_dst.plen = 128; |
1092 | rt->rt6i_idev = idev; | 1092 | rt->rt6i_idev = idev; |
1093 | dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255); | 1093 | dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255); |
@@ -1324,7 +1324,7 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1324 | int gwa_type; | 1324 | int gwa_type; |
1325 | 1325 | ||
1326 | gw_addr = &cfg->fc_gateway; | 1326 | gw_addr = &cfg->fc_gateway; |
1327 | ipv6_addr_copy(&rt->rt6i_gateway, gw_addr); | 1327 | rt->rt6i_gateway = *gw_addr; |
1328 | gwa_type = ipv6_addr_type(gw_addr); | 1328 | gwa_type = ipv6_addr_type(gw_addr); |
1329 | 1329 | ||
1330 | if (gwa_type != (IPV6_ADDR_LINKLOCAL|IPV6_ADDR_UNICAST)) { | 1330 | if (gwa_type != (IPV6_ADDR_LINKLOCAL|IPV6_ADDR_UNICAST)) { |
@@ -1378,7 +1378,7 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1378 | err = -EINVAL; | 1378 | err = -EINVAL; |
1379 | goto out; | 1379 | goto out; |
1380 | } | 1380 | } |
1381 | ipv6_addr_copy(&rt->rt6i_prefsrc.addr, &cfg->fc_prefsrc); | 1381 | rt->rt6i_prefsrc.addr = cfg->fc_prefsrc; |
1382 | rt->rt6i_prefsrc.plen = 128; | 1382 | rt->rt6i_prefsrc.plen = 128; |
1383 | } else | 1383 | } else |
1384 | rt->rt6i_prefsrc.plen = 0; | 1384 | rt->rt6i_prefsrc.plen = 0; |
@@ -1575,7 +1575,7 @@ static struct rt6_info *ip6_route_redirect(const struct in6_addr *dest, | |||
1575 | }, | 1575 | }, |
1576 | }; | 1576 | }; |
1577 | 1577 | ||
1578 | ipv6_addr_copy(&rdfl.gateway, gateway); | 1578 | rdfl.gateway = *gateway; |
1579 | 1579 | ||
1580 | if (rt6_need_strict(dest)) | 1580 | if (rt6_need_strict(dest)) |
1581 | flags |= RT6_LOOKUP_F_IFACE; | 1581 | flags |= RT6_LOOKUP_F_IFACE; |
@@ -1631,7 +1631,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src, | |||
1631 | if (on_link) | 1631 | if (on_link) |
1632 | nrt->rt6i_flags &= ~RTF_GATEWAY; | 1632 | nrt->rt6i_flags &= ~RTF_GATEWAY; |
1633 | 1633 | ||
1634 | ipv6_addr_copy(&nrt->rt6i_gateway, (struct in6_addr*)neigh->primary_key); | 1634 | nrt->rt6i_gateway = *(struct in6_addr *)neigh->primary_key; |
1635 | dst_set_neighbour(&nrt->dst, neigh_clone(neigh)); | 1635 | dst_set_neighbour(&nrt->dst, neigh_clone(neigh)); |
1636 | 1636 | ||
1637 | if (ip6_ins_rt(nrt)) | 1637 | if (ip6_ins_rt(nrt)) |
@@ -1777,7 +1777,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, | |||
1777 | rt->dst.output = ort->dst.output; | 1777 | rt->dst.output = ort->dst.output; |
1778 | rt->dst.flags |= DST_HOST; | 1778 | rt->dst.flags |= DST_HOST; |
1779 | 1779 | ||
1780 | ipv6_addr_copy(&rt->rt6i_dst.addr, dest); | 1780 | rt->rt6i_dst.addr = *dest; |
1781 | rt->rt6i_dst.plen = 128; | 1781 | rt->rt6i_dst.plen = 128; |
1782 | dst_copy_metrics(&rt->dst, &ort->dst); | 1782 | dst_copy_metrics(&rt->dst, &ort->dst); |
1783 | rt->dst.error = ort->dst.error; | 1783 | rt->dst.error = ort->dst.error; |
@@ -1787,7 +1787,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, | |||
1787 | rt->dst.lastuse = jiffies; | 1787 | rt->dst.lastuse = jiffies; |
1788 | rt->rt6i_expires = 0; | 1788 | rt->rt6i_expires = 0; |
1789 | 1789 | ||
1790 | ipv6_addr_copy(&rt->rt6i_gateway, &ort->rt6i_gateway); | 1790 | rt->rt6i_gateway = ort->rt6i_gateway; |
1791 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; | 1791 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; |
1792 | rt->rt6i_metric = 0; | 1792 | rt->rt6i_metric = 0; |
1793 | 1793 | ||
@@ -1850,8 +1850,8 @@ static struct rt6_info *rt6_add_route_info(struct net *net, | |||
1850 | .fc_nlinfo.nl_net = net, | 1850 | .fc_nlinfo.nl_net = net, |
1851 | }; | 1851 | }; |
1852 | 1852 | ||
1853 | ipv6_addr_copy(&cfg.fc_dst, prefix); | 1853 | cfg.fc_dst = *prefix; |
1854 | ipv6_addr_copy(&cfg.fc_gateway, gwaddr); | 1854 | cfg.fc_gateway = *gwaddr; |
1855 | 1855 | ||
1856 | /* We should treat it as a default route if prefix length is 0. */ | 1856 | /* We should treat it as a default route if prefix length is 0. */ |
1857 | if (!prefixlen) | 1857 | if (!prefixlen) |
@@ -1900,7 +1900,7 @@ struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr, | |||
1900 | .fc_nlinfo.nl_net = dev_net(dev), | 1900 | .fc_nlinfo.nl_net = dev_net(dev), |
1901 | }; | 1901 | }; |
1902 | 1902 | ||
1903 | ipv6_addr_copy(&cfg.fc_gateway, gwaddr); | 1903 | cfg.fc_gateway = *gwaddr; |
1904 | 1904 | ||
1905 | ip6_route_add(&cfg); | 1905 | ip6_route_add(&cfg); |
1906 | 1906 | ||
@@ -1946,9 +1946,9 @@ static void rtmsg_to_fib6_config(struct net *net, | |||
1946 | 1946 | ||
1947 | cfg->fc_nlinfo.nl_net = net; | 1947 | cfg->fc_nlinfo.nl_net = net; |
1948 | 1948 | ||
1949 | ipv6_addr_copy(&cfg->fc_dst, &rtmsg->rtmsg_dst); | 1949 | cfg->fc_dst = rtmsg->rtmsg_dst; |
1950 | ipv6_addr_copy(&cfg->fc_src, &rtmsg->rtmsg_src); | 1950 | cfg->fc_src = rtmsg->rtmsg_src; |
1951 | ipv6_addr_copy(&cfg->fc_gateway, &rtmsg->rtmsg_gateway); | 1951 | cfg->fc_gateway = rtmsg->rtmsg_gateway; |
1952 | } | 1952 | } |
1953 | 1953 | ||
1954 | int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg) | 1954 | 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, | |||
2082 | } | 2082 | } |
2083 | dst_set_neighbour(&rt->dst, neigh); | 2083 | dst_set_neighbour(&rt->dst, neigh); |
2084 | 2084 | ||
2085 | ipv6_addr_copy(&rt->rt6i_dst.addr, addr); | 2085 | rt->rt6i_dst.addr = *addr; |
2086 | rt->rt6i_dst.plen = 128; | 2086 | rt->rt6i_dst.plen = 128; |
2087 | rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL); | 2087 | rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL); |
2088 | 2088 | ||
@@ -2100,7 +2100,7 @@ int ip6_route_get_saddr(struct net *net, | |||
2100 | struct inet6_dev *idev = ip6_dst_idev((struct dst_entry*)rt); | 2100 | struct inet6_dev *idev = ip6_dst_idev((struct dst_entry*)rt); |
2101 | int err = 0; | 2101 | int err = 0; |
2102 | if (rt->rt6i_prefsrc.plen) | 2102 | if (rt->rt6i_prefsrc.plen) |
2103 | ipv6_addr_copy(saddr, &rt->rt6i_prefsrc.addr); | 2103 | *saddr = rt->rt6i_prefsrc.addr; |
2104 | else | 2104 | else |
2105 | err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL, | 2105 | err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL, |
2106 | daddr, prefs, saddr); | 2106 | daddr, prefs, saddr); |
@@ -2439,7 +2439,7 @@ static int rt6_fill_node(struct net *net, | |||
2439 | 2439 | ||
2440 | if (rt->rt6i_prefsrc.plen) { | 2440 | if (rt->rt6i_prefsrc.plen) { |
2441 | struct in6_addr saddr_buf; | 2441 | struct in6_addr saddr_buf; |
2442 | ipv6_addr_copy(&saddr_buf, &rt->rt6i_prefsrc.addr); | 2442 | saddr_buf = rt->rt6i_prefsrc.addr; |
2443 | NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf); | 2443 | NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf); |
2444 | } | 2444 | } |
2445 | 2445 | ||
@@ -2513,14 +2513,14 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2513 | if (nla_len(tb[RTA_SRC]) < sizeof(struct in6_addr)) | 2513 | if (nla_len(tb[RTA_SRC]) < sizeof(struct in6_addr)) |
2514 | goto errout; | 2514 | goto errout; |
2515 | 2515 | ||
2516 | ipv6_addr_copy(&fl6.saddr, nla_data(tb[RTA_SRC])); | 2516 | fl6.saddr = *(struct in6_addr *)nla_data(tb[RTA_SRC]); |
2517 | } | 2517 | } |
2518 | 2518 | ||
2519 | if (tb[RTA_DST]) { | 2519 | if (tb[RTA_DST]) { |
2520 | if (nla_len(tb[RTA_DST]) < sizeof(struct in6_addr)) | 2520 | if (nla_len(tb[RTA_DST]) < sizeof(struct in6_addr)) |
2521 | goto errout; | 2521 | goto errout; |
2522 | 2522 | ||
2523 | ipv6_addr_copy(&fl6.daddr, nla_data(tb[RTA_DST])); | 2523 | fl6.daddr = *(struct in6_addr *)nla_data(tb[RTA_DST]); |
2524 | } | 2524 | } |
2525 | 2525 | ||
2526 | if (tb[RTA_IIF]) | 2526 | if (tb[RTA_IIF]) |