aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 02:42:10 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-12 00:43:18 -0400
commit9acd9f3ae92d0dc0ca7504fb48c1040e8bbc39fe (patch)
tree8438f08bc6b8642d1d373f07607e8e117e01aaa6
parentdfd982baff01c18e3e1717c97fdac79c28f105ce (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>
-rw-r--r--include/net/addrconf.h28
-rw-r--r--include/net/ip6_route.h6
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/ndisc.h14
-rw-r--r--net/ipv6/addrconf.c6
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/mcast.c20
-rw-r--r--net/ipv6/ndisc.c22
-rw-r--r--net/ipv6/route.c6
9 files changed, 55 insertions, 53 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 8317c1bcd86c..92af23d66eb9 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -76,12 +76,12 @@ extern int ipv6_chk_prefix(struct in6_addr *addr,
76 struct net_device *dev); 76 struct net_device *dev);
77 77
78extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 78extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
79 struct in6_addr *addr, 79 const struct in6_addr *addr,
80 struct net_device *dev, 80 struct net_device *dev,
81 int strict); 81 int strict);
82 82
83extern int ipv6_dev_get_saddr(struct net_device *dev, 83extern int ipv6_dev_get_saddr(struct net_device *dev,
84 struct in6_addr *daddr, 84 const struct in6_addr *daddr,
85 unsigned int srcprefs, 85 unsigned int srcprefs,
86 struct in6_addr *saddr); 86 struct in6_addr *saddr);
87extern int ipv6_get_lladdr(struct net_device *dev, 87extern int ipv6_get_lladdr(struct net_device *dev,
@@ -105,25 +105,27 @@ extern u32 ipv6_addr_label(const struct in6_addr *addr,
105/* 105/*
106 * multicast prototypes (mcast.c) 106 * multicast prototypes (mcast.c)
107 */ 107 */
108extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 108extern int ipv6_sock_mc_join(struct sock *sk, int ifindex,
109 struct in6_addr *addr); 109 const struct in6_addr *addr);
110extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 110extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
111 struct in6_addr *addr); 111 const struct in6_addr *addr);
112extern void ipv6_sock_mc_close(struct sock *sk); 112extern void ipv6_sock_mc_close(struct sock *sk);
113extern int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, 113extern int inet6_mc_check(struct sock *sk,
114 struct in6_addr *src_addr); 114 const struct in6_addr *mc_addr,
115 const struct in6_addr *src_addr);
115 116
116extern int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr); 117extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
117extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr); 118extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
118extern int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr); 119extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
119extern void ipv6_mc_up(struct inet6_dev *idev); 120extern void ipv6_mc_up(struct inet6_dev *idev);
120extern void ipv6_mc_down(struct inet6_dev *idev); 121extern void ipv6_mc_down(struct inet6_dev *idev);
121extern void ipv6_mc_init_dev(struct inet6_dev *idev); 122extern void ipv6_mc_init_dev(struct inet6_dev *idev);
122extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 123extern void ipv6_mc_destroy_dev(struct inet6_dev *idev);
123extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 124extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
124 125
125extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, 126extern int ipv6_chk_mcast_addr(struct net_device *dev,
126 struct in6_addr *src_addr); 127 const struct in6_addr *group,
128 const struct in6_addr *src_addr);
127extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); 129extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);
128 130
129extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); 131extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 9080076ce0e5..9313491e3dad 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -61,13 +61,13 @@ extern int ip6_ins_rt(struct rt6_info *);
61extern int ip6_del_rt(struct rt6_info *); 61extern int ip6_del_rt(struct rt6_info *);
62 62
63extern struct rt6_info *rt6_lookup(struct net *net, 63extern struct rt6_info *rt6_lookup(struct net *net,
64 struct in6_addr *daddr, 64 const struct in6_addr *daddr,
65 struct in6_addr *saddr, 65 const struct in6_addr *saddr,
66 int oif, int flags); 66 int oif, int flags);
67 67
68extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 68extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
69 struct neighbour *neigh, 69 struct neighbour *neigh,
70 struct in6_addr *addr); 70 const struct in6_addr *addr);
71extern int icmp6_dst_gc(int *more); 71extern int icmp6_dst_gc(int *more);
72 72
73extern void fib6_force_start_gc(struct net *net); 73extern void fib6_force_start_gc(struct net *net);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index a0c285b6311e..49c48983019f 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -451,8 +451,8 @@ extern int ip6_xmit(struct sock *sk,
451extern int ip6_nd_hdr(struct sock *sk, 451extern int ip6_nd_hdr(struct sock *sk,
452 struct sk_buff *skb, 452 struct sk_buff *skb,
453 struct net_device *dev, 453 struct net_device *dev,
454 struct in6_addr *saddr, 454 const struct in6_addr *saddr,
455 struct in6_addr *daddr, 455 const struct in6_addr *daddr,
456 int proto, int len); 456 int proto, int len);
457 457
458extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); 458extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 16424236fe2f..9c451ff2f4f4 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -94,17 +94,17 @@ extern int ndisc_rcv(struct sk_buff *skb);
94 94
95extern void ndisc_send_ns(struct net_device *dev, 95extern void ndisc_send_ns(struct net_device *dev,
96 struct neighbour *neigh, 96 struct neighbour *neigh,
97 struct in6_addr *solicit, 97 const struct in6_addr *solicit,
98 struct in6_addr *daddr, 98 const struct in6_addr *daddr,
99 struct in6_addr *saddr); 99 const struct in6_addr *saddr);
100 100
101extern void ndisc_send_rs(struct net_device *dev, 101extern void ndisc_send_rs(struct net_device *dev,
102 struct in6_addr *saddr, 102 const struct in6_addr *saddr,
103 struct in6_addr *daddr); 103 const struct in6_addr *daddr);
104 104
105extern void ndisc_send_redirect(struct sk_buff *skb, 105extern void ndisc_send_redirect(struct sk_buff *skb,
106 struct neighbour *neigh, 106 struct neighbour *neigh,
107 struct in6_addr *target); 107 const struct in6_addr *target);
108 108
109extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); 109extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
110 110
@@ -134,7 +134,7 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
134extern void inet6_ifinfo_notify(int event, 134extern void inet6_ifinfo_notify(int event,
135 struct inet6_dev *idev); 135 struct inet6_dev *idev);
136 136
137static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) 137static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)
138{ 138{
139 139
140 if (dev) 140 if (dev)
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
942struct ipv6_saddr_dst { 942struct 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
1076int ipv6_dev_get_saddr(struct net_device *dst_dev, 1076int 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
1310EXPORT_SYMBOL(ipv6_chk_prefix); 1310EXPORT_SYMBOL(ipv6_chk_prefix);
1311 1311
1312struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr, 1312struct 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
288int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev, 288int 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 */
128static DEFINE_RWLOCK(ipv6_sk_mc_lock); 128static DEFINE_RWLOCK(ipv6_sk_mc_lock);
129 129
130int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr);
131
132static void igmp6_join_group(struct ifmcaddr6 *ma); 130static void igmp6_join_group(struct ifmcaddr6 *ma);
133static void igmp6_leave_group(struct ifmcaddr6 *ma); 131static void igmp6_leave_group(struct ifmcaddr6 *ma);
134static void igmp6_timer_handler(unsigned long data); 132static 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
180int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr) 178int 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 */
255int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr) 253int 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
667int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, 665int 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 */
874int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) 872int 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 */
945int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr) 943int __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
970int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr) 968int 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 */
1015int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, 1013int 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 */
443static void __ndisc_send(struct net_device *dev, 443static 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
531static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, 532static 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
566void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, 568void 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
587void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr, 589void 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
1449void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, 1451void 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
559struct rt6_info *rt6_lookup(struct net *net, struct in6_addr *daddr, 559struct 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
926struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 926struct 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);