aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-09-14 08:22:28 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-14 20:03:05 -0400
commit41135cc836a1abeb12ca1416bdb29e87ad021153 (patch)
tree01c402f2fb9ac494dc3655a17e92072b170b7c1f /net/ipv6
parent32613090a96dba2ca2cc524c8d4749d3126fdde5 (diff)
net: constify struct inet6_protocol
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c10
-rw-r--r--net/ipv6/ah6.c2
-rw-r--r--net/ipv6/esp6.c2
-rw-r--r--net/ipv6/exthdrs.c6
-rw-r--r--net/ipv6/icmp.c4
-rw-r--r--net/ipv6/ip6_input.c2
-rw-r--r--net/ipv6/ip6mr.c6
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/protocol.c6
-rw-r--r--net/ipv6/reassembly.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
-rw-r--r--net/ipv6/tunnel6.c4
-rw-r--r--net/ipv6/udp.c2
-rw-r--r--net/ipv6/udplite.c2
14 files changed, 24 insertions, 28 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index a123a328aeb3..e127a32f9540 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -710,7 +710,7 @@ EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
710 710
711static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) 711static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
712{ 712{
713 struct inet6_protocol *ops = NULL; 713 const struct inet6_protocol *ops = NULL;
714 714
715 for (;;) { 715 for (;;) {
716 struct ipv6_opt_hdr *opth; 716 struct ipv6_opt_hdr *opth;
@@ -745,7 +745,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
745static int ipv6_gso_send_check(struct sk_buff *skb) 745static int ipv6_gso_send_check(struct sk_buff *skb)
746{ 746{
747 struct ipv6hdr *ipv6h; 747 struct ipv6hdr *ipv6h;
748 struct inet6_protocol *ops; 748 const struct inet6_protocol *ops;
749 int err = -EINVAL; 749 int err = -EINVAL;
750 750
751 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h)))) 751 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
@@ -773,7 +773,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
773{ 773{
774 struct sk_buff *segs = ERR_PTR(-EINVAL); 774 struct sk_buff *segs = ERR_PTR(-EINVAL);
775 struct ipv6hdr *ipv6h; 775 struct ipv6hdr *ipv6h;
776 struct inet6_protocol *ops; 776 const struct inet6_protocol *ops;
777 int proto; 777 int proto;
778 struct frag_hdr *fptr; 778 struct frag_hdr *fptr;
779 unsigned int unfrag_ip6hlen; 779 unsigned int unfrag_ip6hlen;
@@ -840,7 +840,7 @@ struct ipv6_gro_cb {
840static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, 840static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
841 struct sk_buff *skb) 841 struct sk_buff *skb)
842{ 842{
843 struct inet6_protocol *ops; 843 const struct inet6_protocol *ops;
844 struct sk_buff **pp = NULL; 844 struct sk_buff **pp = NULL;
845 struct sk_buff *p; 845 struct sk_buff *p;
846 struct ipv6hdr *iph; 846 struct ipv6hdr *iph;
@@ -926,7 +926,7 @@ out:
926 926
927static int ipv6_gro_complete(struct sk_buff *skb) 927static int ipv6_gro_complete(struct sk_buff *skb)
928{ 928{
929 struct inet6_protocol *ops; 929 const struct inet6_protocol *ops;
930 struct ipv6hdr *iph = ipv6_hdr(skb); 930 struct ipv6hdr *iph = ipv6_hdr(skb);
931 int err = -ENOSYS; 931 int err = -ENOSYS;
932 932
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 86f42a288c4b..c1589e2f1dc9 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -527,7 +527,7 @@ static const struct xfrm_type ah6_type =
527 .hdr_offset = xfrm6_find_1stfragopt, 527 .hdr_offset = xfrm6_find_1stfragopt,
528}; 528};
529 529
530static struct inet6_protocol ah6_protocol = { 530static const struct inet6_protocol ah6_protocol = {
531 .handler = xfrm6_rcv, 531 .handler = xfrm6_rcv,
532 .err_handler = ah6_err, 532 .err_handler = ah6_err,
533 .flags = INET6_PROTO_NOPOLICY, 533 .flags = INET6_PROTO_NOPOLICY,
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 678bb95b1525..af597c73ebe9 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -558,7 +558,7 @@ static const struct xfrm_type esp6_type =
558 .hdr_offset = xfrm6_find_1stfragopt, 558 .hdr_offset = xfrm6_find_1stfragopt,
559}; 559};
560 560
561static struct inet6_protocol esp6_protocol = { 561static const struct inet6_protocol esp6_protocol = {
562 .handler = xfrm6_rcv, 562 .handler = xfrm6_rcv,
563 .err_handler = esp6_err, 563 .err_handler = esp6_err,
564 .flags = INET6_PROTO_NOPOLICY, 564 .flags = INET6_PROTO_NOPOLICY,
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 4aae658e5501..df159fffe4bc 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -500,17 +500,17 @@ unknown_rh:
500 return -1; 500 return -1;
501} 501}
502 502
503static struct inet6_protocol rthdr_protocol = { 503static const struct inet6_protocol rthdr_protocol = {
504 .handler = ipv6_rthdr_rcv, 504 .handler = ipv6_rthdr_rcv,
505 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR, 505 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
506}; 506};
507 507
508static struct inet6_protocol destopt_protocol = { 508static const struct inet6_protocol destopt_protocol = {
509 .handler = ipv6_destopt_rcv, 509 .handler = ipv6_destopt_rcv,
510 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR, 510 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
511}; 511};
512 512
513static struct inet6_protocol nodata_protocol = { 513static const struct inet6_protocol nodata_protocol = {
514 .handler = dst_discard, 514 .handler = dst_discard,
515 .flags = INET6_PROTO_NOPOLICY, 515 .flags = INET6_PROTO_NOPOLICY,
516}; 516};
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index e2325f6a05fb..f23ebbec0631 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -86,7 +86,7 @@ static inline struct sock *icmpv6_sk(struct net *net)
86 86
87static int icmpv6_rcv(struct sk_buff *skb); 87static int icmpv6_rcv(struct sk_buff *skb);
88 88
89static struct inet6_protocol icmpv6_protocol = { 89static const struct inet6_protocol icmpv6_protocol = {
90 .handler = icmpv6_rcv, 90 .handler = icmpv6_rcv,
91 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 91 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
92}; 92};
@@ -583,7 +583,7 @@ out:
583 583
584static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info) 584static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info)
585{ 585{
586 struct inet6_protocol *ipprot; 586 const struct inet6_protocol *ipprot;
587 int inner_offset; 587 int inner_offset;
588 int hash; 588 int hash;
589 u8 nexthdr; 589 u8 nexthdr;
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 2d9cbaa67edb..237e2dba6e94 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -159,7 +159,7 @@ drop:
159 159
160static int ip6_input_finish(struct sk_buff *skb) 160static int ip6_input_finish(struct sk_buff *skb)
161{ 161{
162 struct inet6_protocol *ipprot; 162 const struct inet6_protocol *ipprot;
163 unsigned int nhoff; 163 unsigned int nhoff;
164 int nexthdr, raw; 164 int nexthdr, raw;
165 u8 hash; 165 u8 hash;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 5c8d73730c75..3907510c2ce3 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -83,10 +83,6 @@ static int ip6mr_cache_report(struct net *net, struct sk_buff *pkt,
83static int ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm); 83static int ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm);
84static void mroute_clean_tables(struct net *net); 84static void mroute_clean_tables(struct net *net);
85 85
86#ifdef CONFIG_IPV6_PIMSM_V2
87static struct inet6_protocol pim6_protocol;
88#endif
89
90static struct timer_list ipmr_expire_timer; 86static struct timer_list ipmr_expire_timer;
91 87
92 88
@@ -410,7 +406,7 @@ static int pim6_rcv(struct sk_buff *skb)
410 return 0; 406 return 0;
411} 407}
412 408
413static struct inet6_protocol pim6_protocol = { 409static const struct inet6_protocol pim6_protocol = {
414 .handler = pim6_rcv, 410 .handler = pim6_rcv,
415}; 411};
416 412
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 79c172f1ff01..2f2a5ca2c878 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -178,7 +178,7 @@ static const struct xfrm_type ipcomp6_type =
178 .hdr_offset = xfrm6_find_1stfragopt, 178 .hdr_offset = xfrm6_find_1stfragopt,
179}; 179};
180 180
181static struct inet6_protocol ipcomp6_protocol = 181static const struct inet6_protocol ipcomp6_protocol =
182{ 182{
183 .handler = xfrm6_rcv, 183 .handler = xfrm6_rcv,
184 .err_handler = ipcomp6_err, 184 .err_handler = ipcomp6_err,
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
index 568864f722ca..1fa3468f0f32 100644
--- a/net/ipv6/protocol.c
+++ b/net/ipv6/protocol.c
@@ -25,11 +25,11 @@
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <net/protocol.h> 26#include <net/protocol.h>
27 27
28struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; 28const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
29static DEFINE_SPINLOCK(inet6_proto_lock); 29static DEFINE_SPINLOCK(inet6_proto_lock);
30 30
31 31
32int inet6_add_protocol(struct inet6_protocol *prot, unsigned char protocol) 32int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char protocol)
33{ 33{
34 int ret, hash = protocol & (MAX_INET_PROTOS - 1); 34 int ret, hash = protocol & (MAX_INET_PROTOS - 1);
35 35
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(inet6_add_protocol);
53 * Remove a protocol from the hash tables. 53 * Remove a protocol from the hash tables.
54 */ 54 */
55 55
56int inet6_del_protocol(struct inet6_protocol *prot, unsigned char protocol) 56int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char protocol)
57{ 57{
58 int ret, hash = protocol & (MAX_INET_PROTOS - 1); 58 int ret, hash = protocol & (MAX_INET_PROTOS - 1);
59 59
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2642a41a8535..da5bd0ed83df 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -627,7 +627,7 @@ fail_hdr:
627 return -1; 627 return -1;
628} 628}
629 629
630static struct inet6_protocol frag_protocol = 630static const struct inet6_protocol frag_protocol =
631{ 631{
632 .handler = ipv6_frag_rcv, 632 .handler = ipv6_frag_rcv,
633 .flags = INET6_PROTO_NOPOLICY, 633 .flags = INET6_PROTO_NOPOLICY,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3aae0f217d61..7718a9261efb 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2093,7 +2093,7 @@ struct proto tcpv6_prot = {
2093#endif 2093#endif
2094}; 2094};
2095 2095
2096static struct inet6_protocol tcpv6_protocol = { 2096static const struct inet6_protocol tcpv6_protocol = {
2097 .handler = tcp_v6_rcv, 2097 .handler = tcp_v6_rcv,
2098 .err_handler = tcp_v6_err, 2098 .err_handler = tcp_v6_err,
2099 .gso_send_check = tcp_v6_gso_send_check, 2099 .gso_send_check = tcp_v6_gso_send_check,
diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c
index 633ad789effc..51e2832d13a6 100644
--- a/net/ipv6/tunnel6.c
+++ b/net/ipv6/tunnel6.c
@@ -133,13 +133,13 @@ static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
133 break; 133 break;
134} 134}
135 135
136static struct inet6_protocol tunnel6_protocol = { 136static const struct inet6_protocol tunnel6_protocol = {
137 .handler = tunnel6_rcv, 137 .handler = tunnel6_rcv,
138 .err_handler = tunnel6_err, 138 .err_handler = tunnel6_err,
139 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 139 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
140}; 140};
141 141
142static struct inet6_protocol tunnel46_protocol = { 142static const struct inet6_protocol tunnel46_protocol = {
143 .handler = tunnel46_rcv, 143 .handler = tunnel46_rcv,
144 .err_handler = tunnel6_err, 144 .err_handler = tunnel6_err,
145 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 145 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 164040613c2e..b265b7047d3e 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1172,7 +1172,7 @@ out:
1172 return segs; 1172 return segs;
1173} 1173}
1174 1174
1175static struct inet6_protocol udpv6_protocol = { 1175static const struct inet6_protocol udpv6_protocol = {
1176 .handler = udpv6_rcv, 1176 .handler = udpv6_rcv,
1177 .err_handler = udpv6_err, 1177 .err_handler = udpv6_err,
1178 .gso_send_check = udp6_ufo_send_check, 1178 .gso_send_check = udp6_ufo_send_check,
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 4818c48688f2..d737a27ee010 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -25,7 +25,7 @@ static void udplitev6_err(struct sk_buff *skb,
25 __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table); 25 __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table);
26} 26}
27 27
28static struct inet6_protocol udplitev6_protocol = { 28static const struct inet6_protocol udplitev6_protocol = {
29 .handler = udplitev6_rcv, 29 .handler = udplitev6_rcv,
30 .err_handler = udplitev6_err, 30 .err_handler = udplitev6_err,
31 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 31 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,