diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-10 02:42:10 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-12 00:43:18 -0400 |
commit | 9acd9f3ae92d0dc0ca7504fb48c1040e8bbc39fe (patch) | |
tree | 8438f08bc6b8642d1d373f07607e8e117e01aaa6 /net | |
parent | dfd982baff01c18e3e1717c97fdac79c28f105ce (diff) |
[IPV6]: Make address arguments const.
- net/ipv6/addrconf.c:
ipv6_get_ifaddr(), ipv6_dev_get_saddr()
- net/ipv6/mcast.c:
ipv6_sock_mc_join(), ipv6_sock_mc_drop(),
inet6_mc_check(),
ipv6_dev_mc_inc(), __ipv6_dev_mc_dec(), ipv6_dev_mc_dec(),
ipv6_chk_mcast_addr()
- net/ipv6/route.c:
rt6_lookup(), icmp6_dst_alloc()
- net/ipv6/ip6_output.c:
ip6_nd_hdr()
- net/ipv6/ndisc.c:
ndisc_send_ns(), ndisc_send_rs(), ndisc_send_redirect(),
ndisc_get_neigh(), __ndisc_send()
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/addrconf.c | 6 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 20 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 22 | ||||
-rw-r--r-- | net/ipv6/route.c | 6 |
5 files changed, 28 insertions, 28 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d15f3e095e7e..4048c2b73b0b 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -940,7 +940,7 @@ struct ipv6_saddr_score { | |||
940 | }; | 940 | }; |
941 | 941 | ||
942 | struct ipv6_saddr_dst { | 942 | struct ipv6_saddr_dst { |
943 | struct in6_addr *addr; | 943 | const struct in6_addr *addr; |
944 | int ifindex; | 944 | int ifindex; |
945 | int scope; | 945 | int scope; |
946 | int label; | 946 | int label; |
@@ -1074,7 +1074,7 @@ out: | |||
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | int ipv6_dev_get_saddr(struct net_device *dst_dev, | 1076 | int ipv6_dev_get_saddr(struct net_device *dst_dev, |
1077 | struct in6_addr *daddr, unsigned int prefs, | 1077 | const struct in6_addr *daddr, unsigned int prefs, |
1078 | struct in6_addr *saddr) | 1078 | struct in6_addr *saddr) |
1079 | { | 1079 | { |
1080 | struct ipv6_saddr_score scores[2], | 1080 | struct ipv6_saddr_score scores[2], |
@@ -1309,7 +1309,7 @@ int ipv6_chk_prefix(struct in6_addr *addr, struct net_device *dev) | |||
1309 | 1309 | ||
1310 | EXPORT_SYMBOL(ipv6_chk_prefix); | 1310 | EXPORT_SYMBOL(ipv6_chk_prefix); |
1311 | 1311 | ||
1312 | struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr, | 1312 | struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, const struct in6_addr *addr, |
1313 | struct net_device *dev, int strict) | 1313 | struct net_device *dev, int strict) |
1314 | { | 1314 | { |
1315 | struct inet6_ifaddr * ifp; | 1315 | struct inet6_ifaddr * ifp; |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index c0dbe549cc42..0af2e055f883 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -286,7 +286,7 @@ EXPORT_SYMBOL(ip6_xmit); | |||
286 | */ | 286 | */ |
287 | 287 | ||
288 | int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev, | 288 | int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev, |
289 | struct in6_addr *saddr, struct in6_addr *daddr, | 289 | const struct in6_addr *saddr, const struct in6_addr *daddr, |
290 | int proto, int len) | 290 | int proto, int len) |
291 | { | 291 | { |
292 | struct ipv6_pinfo *np = inet6_sk(sk); | 292 | struct ipv6_pinfo *np = inet6_sk(sk); |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 2e6a53f3cc38..0a0132a1c443 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -127,8 +127,6 @@ static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; | |||
127 | /* Big mc list lock for all the sockets */ | 127 | /* Big mc list lock for all the sockets */ |
128 | static DEFINE_RWLOCK(ipv6_sk_mc_lock); | 128 | static DEFINE_RWLOCK(ipv6_sk_mc_lock); |
129 | 129 | ||
130 | int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr); | ||
131 | |||
132 | static void igmp6_join_group(struct ifmcaddr6 *ma); | 130 | static void igmp6_join_group(struct ifmcaddr6 *ma); |
133 | static void igmp6_leave_group(struct ifmcaddr6 *ma); | 131 | static void igmp6_leave_group(struct ifmcaddr6 *ma); |
134 | static void igmp6_timer_handler(unsigned long data); | 132 | static void igmp6_timer_handler(unsigned long data); |
@@ -177,7 +175,7 @@ int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF; | |||
177 | * socket join on multicast group | 175 | * socket join on multicast group |
178 | */ | 176 | */ |
179 | 177 | ||
180 | int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr) | 178 | int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr) |
181 | { | 179 | { |
182 | struct net_device *dev = NULL; | 180 | struct net_device *dev = NULL; |
183 | struct ipv6_mc_socklist *mc_lst; | 181 | struct ipv6_mc_socklist *mc_lst; |
@@ -252,7 +250,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr) | |||
252 | /* | 250 | /* |
253 | * socket leave on multicast group | 251 | * socket leave on multicast group |
254 | */ | 252 | */ |
255 | int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr) | 253 | int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr) |
256 | { | 254 | { |
257 | struct ipv6_pinfo *np = inet6_sk(sk); | 255 | struct ipv6_pinfo *np = inet6_sk(sk); |
258 | struct ipv6_mc_socklist *mc_lst, **lnk; | 256 | struct ipv6_mc_socklist *mc_lst, **lnk; |
@@ -664,8 +662,8 @@ done: | |||
664 | return err; | 662 | return err; |
665 | } | 663 | } |
666 | 664 | ||
667 | int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, | 665 | int inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr, |
668 | struct in6_addr *src_addr) | 666 | const struct in6_addr *src_addr) |
669 | { | 667 | { |
670 | struct ipv6_pinfo *np = inet6_sk(sk); | 668 | struct ipv6_pinfo *np = inet6_sk(sk); |
671 | struct ipv6_mc_socklist *mc; | 669 | struct ipv6_mc_socklist *mc; |
@@ -871,7 +869,7 @@ static void mld_clear_delrec(struct inet6_dev *idev) | |||
871 | /* | 869 | /* |
872 | * device multicast group inc (add if not found) | 870 | * device multicast group inc (add if not found) |
873 | */ | 871 | */ |
874 | int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) | 872 | int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr) |
875 | { | 873 | { |
876 | struct ifmcaddr6 *mc; | 874 | struct ifmcaddr6 *mc; |
877 | struct inet6_dev *idev; | 875 | struct inet6_dev *idev; |
@@ -942,7 +940,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) | |||
942 | /* | 940 | /* |
943 | * device multicast group del | 941 | * device multicast group del |
944 | */ | 942 | */ |
945 | int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr) | 943 | int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr) |
946 | { | 944 | { |
947 | struct ifmcaddr6 *ma, **map; | 945 | struct ifmcaddr6 *ma, **map; |
948 | 946 | ||
@@ -967,7 +965,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr) | |||
967 | return -ENOENT; | 965 | return -ENOENT; |
968 | } | 966 | } |
969 | 967 | ||
970 | int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr) | 968 | int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr) |
971 | { | 969 | { |
972 | struct inet6_dev *idev = in6_dev_get(dev); | 970 | struct inet6_dev *idev = in6_dev_get(dev); |
973 | int err; | 971 | int err; |
@@ -1012,8 +1010,8 @@ int ipv6_is_mld(struct sk_buff *skb, int nexthdr) | |||
1012 | /* | 1010 | /* |
1013 | * check if the interface/address pair is valid | 1011 | * check if the interface/address pair is valid |
1014 | */ | 1012 | */ |
1015 | int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, | 1013 | int ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group, |
1016 | struct in6_addr *src_addr) | 1014 | const struct in6_addr *src_addr) |
1017 | { | 1015 | { |
1018 | struct inet6_dev *idev; | 1016 | struct inet6_dev *idev; |
1019 | struct ifmcaddr6 *mc; | 1017 | struct ifmcaddr6 *mc; |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index b3295d82fece..5b9ad5e2f56d 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -442,8 +442,9 @@ static void pndisc_destructor(struct pneigh_entry *n) | |||
442 | */ | 442 | */ |
443 | static void __ndisc_send(struct net_device *dev, | 443 | static void __ndisc_send(struct net_device *dev, |
444 | struct neighbour *neigh, | 444 | struct neighbour *neigh, |
445 | struct in6_addr *daddr, struct in6_addr *saddr, | 445 | const struct in6_addr *daddr, |
446 | struct icmp6hdr *icmp6h, struct in6_addr *target, | 446 | const struct in6_addr *saddr, |
447 | struct icmp6hdr *icmp6h, const struct in6_addr *target, | ||
447 | int llinfo) | 448 | int llinfo) |
448 | { | 449 | { |
449 | struct flowi fl; | 450 | struct flowi fl; |
@@ -529,12 +530,13 @@ static void __ndisc_send(struct net_device *dev, | |||
529 | } | 530 | } |
530 | 531 | ||
531 | static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | 532 | static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, |
532 | struct in6_addr *daddr, struct in6_addr *solicited_addr, | 533 | const struct in6_addr *daddr, |
533 | int router, int solicited, int override, int inc_opt) | 534 | const struct in6_addr *solicited_addr, |
535 | int router, int solicited, int override, int inc_opt) | ||
534 | { | 536 | { |
535 | struct in6_addr tmpaddr; | 537 | struct in6_addr tmpaddr; |
536 | struct inet6_ifaddr *ifp; | 538 | struct inet6_ifaddr *ifp; |
537 | struct in6_addr *src_addr; | 539 | const struct in6_addr *src_addr; |
538 | struct icmp6hdr icmp6h = { | 540 | struct icmp6hdr icmp6h = { |
539 | .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT, | 541 | .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT, |
540 | }; | 542 | }; |
@@ -564,8 +566,8 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | |||
564 | } | 566 | } |
565 | 567 | ||
566 | void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, | 568 | void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, |
567 | struct in6_addr *solicit, | 569 | const struct in6_addr *solicit, |
568 | struct in6_addr *daddr, struct in6_addr *saddr) | 570 | const struct in6_addr *daddr, const struct in6_addr *saddr) |
569 | { | 571 | { |
570 | struct in6_addr addr_buf; | 572 | struct in6_addr addr_buf; |
571 | struct icmp6hdr icmp6h = { | 573 | struct icmp6hdr icmp6h = { |
@@ -584,8 +586,8 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, | |||
584 | !ipv6_addr_any(saddr) ? ND_OPT_SOURCE_LL_ADDR : 0); | 586 | !ipv6_addr_any(saddr) ? ND_OPT_SOURCE_LL_ADDR : 0); |
585 | } | 587 | } |
586 | 588 | ||
587 | void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr, | 589 | void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr, |
588 | struct in6_addr *daddr) | 590 | const struct in6_addr *daddr) |
589 | { | 591 | { |
590 | struct icmp6hdr icmp6h = { | 592 | struct icmp6hdr icmp6h = { |
591 | .icmp6_type = NDISC_ROUTER_SOLICITATION, | 593 | .icmp6_type = NDISC_ROUTER_SOLICITATION, |
@@ -1447,7 +1449,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) | |||
1447 | } | 1449 | } |
1448 | 1450 | ||
1449 | void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | 1451 | void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, |
1450 | struct in6_addr *target) | 1452 | const struct in6_addr *target) |
1451 | { | 1453 | { |
1452 | struct net_device *dev = skb->dev; | 1454 | struct net_device *dev = skb->dev; |
1453 | struct net *net = dev_net(dev); | 1455 | struct net *net = dev_net(dev); |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 269b76093288..6293cb91ed1d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -556,8 +556,8 @@ out: | |||
556 | 556 | ||
557 | } | 557 | } |
558 | 558 | ||
559 | struct rt6_info *rt6_lookup(struct net *net, struct in6_addr *daddr, | 559 | struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr, |
560 | struct in6_addr *saddr, int oif, int strict) | 560 | const struct in6_addr *saddr, int oif, int strict) |
561 | { | 561 | { |
562 | struct flowi fl = { | 562 | struct flowi fl = { |
563 | .oif = oif, | 563 | .oif = oif, |
@@ -925,7 +925,7 @@ static DEFINE_SPINLOCK(icmp6_dst_lock); | |||
925 | 925 | ||
926 | struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | 926 | struct dst_entry *icmp6_dst_alloc(struct net_device *dev, |
927 | struct neighbour *neigh, | 927 | struct neighbour *neigh, |
928 | struct in6_addr *addr) | 928 | const struct in6_addr *addr) |
929 | { | 929 | { |
930 | struct rt6_info *rt; | 930 | struct rt6_info *rt; |
931 | struct inet6_dev *idev = in6_dev_get(dev); | 931 | struct inet6_dev *idev = in6_dev_get(dev); |