Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

+55 -53
+15 -13
include/net/addrconf.h
··· 76 76 struct net_device *dev); 77 77 78 78 extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 79 - struct in6_addr *addr, 79 + const struct in6_addr *addr, 80 80 struct net_device *dev, 81 81 int strict); 82 82 83 83 extern int ipv6_dev_get_saddr(struct net_device *dev, 84 - struct in6_addr *daddr, 84 + const struct in6_addr *daddr, 85 85 unsigned int srcprefs, 86 86 struct in6_addr *saddr); 87 87 extern int ipv6_get_lladdr(struct net_device *dev, ··· 105 105 /* 106 106 * multicast prototypes (mcast.c) 107 107 */ 108 - extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 109 - struct in6_addr *addr); 110 - extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 111 - struct in6_addr *addr); 108 + extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 109 + const struct in6_addr *addr); 110 + extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 111 + const struct in6_addr *addr); 112 112 extern void ipv6_sock_mc_close(struct sock *sk); 113 - extern int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, 114 - struct in6_addr *src_addr); 113 + extern int inet6_mc_check(struct sock *sk, 114 + const struct in6_addr *mc_addr, 115 + const struct in6_addr *src_addr); 115 116 116 - extern int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr); 117 - extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr); 118 - extern int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr); 117 + extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 118 + extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 119 + extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 119 120 extern void ipv6_mc_up(struct inet6_dev *idev); 120 121 extern void ipv6_mc_down(struct inet6_dev *idev); 121 122 extern void ipv6_mc_init_dev(struct inet6_dev *idev); 122 123 extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 123 124 extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 124 125 125 - extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, 126 - struct in6_addr *src_addr); 126 + extern int ipv6_chk_mcast_addr(struct net_device *dev, 127 + const struct in6_addr *group, 128 + const struct in6_addr *src_addr); 127 129 extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); 128 130 129 131 extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);
+3 -3
include/net/ip6_route.h
··· 61 61 extern int ip6_del_rt(struct rt6_info *); 62 62 63 63 extern struct rt6_info *rt6_lookup(struct net *net, 64 - struct in6_addr *daddr, 65 - struct in6_addr *saddr, 64 + const struct in6_addr *daddr, 65 + const struct in6_addr *saddr, 66 66 int oif, int flags); 67 67 68 68 extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 69 69 struct neighbour *neigh, 70 - struct in6_addr *addr); 70 + const struct in6_addr *addr); 71 71 extern int icmp6_dst_gc(int *more); 72 72 73 73 extern void fib6_force_start_gc(struct net *net);
+2 -2
include/net/ipv6.h
··· 451 451 extern int ip6_nd_hdr(struct sock *sk, 452 452 struct sk_buff *skb, 453 453 struct net_device *dev, 454 - struct in6_addr *saddr, 455 - struct in6_addr *daddr, 454 + const struct in6_addr *saddr, 455 + const struct in6_addr *daddr, 456 456 int proto, int len); 457 457 458 458 extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
+7 -7
include/net/ndisc.h
··· 94 94 95 95 extern void ndisc_send_ns(struct net_device *dev, 96 96 struct neighbour *neigh, 97 - struct in6_addr *solicit, 98 - struct in6_addr *daddr, 99 - struct in6_addr *saddr); 97 + const struct in6_addr *solicit, 98 + const struct in6_addr *daddr, 99 + const struct in6_addr *saddr); 100 100 101 101 extern void ndisc_send_rs(struct net_device *dev, 102 - struct in6_addr *saddr, 103 - struct in6_addr *daddr); 102 + const struct in6_addr *saddr, 103 + const struct in6_addr *daddr); 104 104 105 105 extern void ndisc_send_redirect(struct sk_buff *skb, 106 106 struct neighbour *neigh, 107 - struct in6_addr *target); 107 + const struct in6_addr *target); 108 108 109 109 extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); 110 110 ··· 134 134 extern void inet6_ifinfo_notify(int event, 135 135 struct inet6_dev *idev); 136 136 137 - static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) 137 + static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr) 138 138 { 139 139 140 140 if (dev)
+3 -3
net/ipv6/addrconf.c
··· 940 940 }; 941 941 942 942 struct ipv6_saddr_dst { 943 - struct in6_addr *addr; 943 + const struct in6_addr *addr; 944 944 int ifindex; 945 945 int scope; 946 946 int label; ··· 1074 1074 } 1075 1075 1076 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 1078 struct in6_addr *saddr) 1079 1079 { 1080 1080 struct ipv6_saddr_score scores[2], ··· 1309 1309 1310 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 1313 struct net_device *dev, int strict) 1314 1314 { 1315 1315 struct inet6_ifaddr * ifp;
+1 -1
net/ipv6/ip6_output.c
··· 286 286 */ 287 287 288 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 290 int proto, int len) 291 291 { 292 292 struct ipv6_pinfo *np = inet6_sk(sk);
+9 -11
net/ipv6/mcast.c
··· 127 127 /* Big mc list lock for all the sockets */ 128 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 130 static void igmp6_join_group(struct ifmcaddr6 *ma); 133 131 static void igmp6_leave_group(struct ifmcaddr6 *ma); 134 132 static void igmp6_timer_handler(unsigned long data); ··· 175 177 * socket join on multicast group 176 178 */ 177 179 178 - int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr) 180 + int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr) 179 181 { 180 182 struct net_device *dev = NULL; 181 183 struct ipv6_mc_socklist *mc_lst; ··· 250 252 /* 251 253 * socket leave on multicast group 252 254 */ 253 - int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr) 255 + int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr) 254 256 { 255 257 struct ipv6_pinfo *np = inet6_sk(sk); 256 258 struct ipv6_mc_socklist *mc_lst, **lnk; ··· 662 664 return err; 663 665 } 664 666 665 - int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, 666 - struct in6_addr *src_addr) 667 + int inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr, 668 + const struct in6_addr *src_addr) 667 669 { 668 670 struct ipv6_pinfo *np = inet6_sk(sk); 669 671 struct ipv6_mc_socklist *mc; ··· 869 871 /* 870 872 * device multicast group inc (add if not found) 871 873 */ 872 - int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) 874 + int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr) 873 875 { 874 876 struct ifmcaddr6 *mc; 875 877 struct inet6_dev *idev; ··· 940 942 /* 941 943 * device multicast group del 942 944 */ 943 - int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr) 945 + int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr) 944 946 { 945 947 struct ifmcaddr6 *ma, **map; 946 948 ··· 965 967 return -ENOENT; 966 968 } 967 969 968 - int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr) 970 + int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr) 969 971 { 970 972 struct inet6_dev *idev = in6_dev_get(dev); 971 973 int err; ··· 1010 1012 /* 1011 1013 * check if the interface/address pair is valid 1012 1014 */ 1013 - int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, 1014 - struct in6_addr *src_addr) 1015 + int ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group, 1016 + const struct in6_addr *src_addr) 1015 1017 { 1016 1018 struct inet6_dev *idev; 1017 1019 struct ifmcaddr6 *mc;
+12 -10
net/ipv6/ndisc.c
··· 442 442 */ 443 443 static void __ndisc_send(struct net_device *dev, 444 444 struct neighbour *neigh, 445 - struct in6_addr *daddr, struct in6_addr *saddr, 446 - struct icmp6hdr *icmp6h, struct in6_addr *target, 445 + const struct in6_addr *daddr, 446 + const struct in6_addr *saddr, 447 + struct icmp6hdr *icmp6h, const struct in6_addr *target, 447 448 int llinfo) 448 449 { 449 450 struct flowi fl; ··· 530 529 } 531 530 532 531 static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, 533 - struct in6_addr *daddr, struct in6_addr *solicited_addr, 534 - int router, int solicited, int override, int inc_opt) 532 + const struct in6_addr *daddr, 533 + const struct in6_addr *solicited_addr, 534 + int router, int solicited, int override, int inc_opt) 535 535 { 536 536 struct in6_addr tmpaddr; 537 537 struct inet6_ifaddr *ifp; 538 - struct in6_addr *src_addr; 538 + const struct in6_addr *src_addr; 539 539 struct icmp6hdr icmp6h = { 540 540 .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT, 541 541 }; ··· 566 564 } 567 565 568 566 void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, 569 - struct in6_addr *solicit, 570 - struct in6_addr *daddr, struct in6_addr *saddr) 567 + const struct in6_addr *solicit, 568 + const struct in6_addr *daddr, const struct in6_addr *saddr) 571 569 { 572 570 struct in6_addr addr_buf; 573 571 struct icmp6hdr icmp6h = { ··· 586 584 !ipv6_addr_any(saddr) ? ND_OPT_SOURCE_LL_ADDR : 0); 587 585 } 588 586 589 - void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr, 590 - struct in6_addr *daddr) 587 + void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr, 588 + const struct in6_addr *daddr) 591 589 { 592 590 struct icmp6hdr icmp6h = { 593 591 .icmp6_type = NDISC_ROUTER_SOLICITATION, ··· 1449 1447 } 1450 1448 1451 1449 void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, 1452 - struct in6_addr *target) 1450 + const struct in6_addr *target) 1453 1451 { 1454 1452 struct net_device *dev = skb->dev; 1455 1453 struct net *net = dev_net(dev);
+3 -3
net/ipv6/route.c
··· 556 556 557 557 } 558 558 559 - struct rt6_info *rt6_lookup(struct net *net, struct in6_addr *daddr, 560 - struct in6_addr *saddr, int oif, int strict) 559 + struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr, 560 + const struct in6_addr *saddr, int oif, int strict) 561 561 { 562 562 struct flowi fl = { 563 563 .oif = oif, ··· 925 925 926 926 struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 927 927 struct neighbour *neigh, 928 - struct in6_addr *addr) 928 + const struct in6_addr *addr) 929 929 { 930 930 struct rt6_info *rt; 931 931 struct inet6_dev *idev = in6_dev_get(dev);