diff options
| -rw-r--r-- | include/net/protocol.h | 7 | ||||
| -rw-r--r-- | net/dccp/ipv4.c | 2 | ||||
| -rw-r--r-- | net/ipv4/af_inet.c | 18 | ||||
| -rw-r--r-- | net/ipv4/ah4.c | 2 | ||||
| -rw-r--r-- | net/ipv4/esp4.c | 2 | ||||
| -rw-r--r-- | net/ipv4/icmp.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ip_input.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipcomp.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipmr.c | 6 | ||||
| -rw-r--r-- | net/ipv4/protocol.c | 6 | ||||
| -rw-r--r-- | net/ipv4/tunnel4.c | 4 | ||||
| -rw-r--r-- | net/ipv4/udplite.c | 2 | ||||
| -rw-r--r-- | net/sctp/protocol.c | 2 |
14 files changed, 27 insertions, 32 deletions
diff --git a/include/net/protocol.h b/include/net/protocol.h index 1089d5aabd49..cea2aee92ac5 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
| @@ -94,15 +94,14 @@ struct inet_protosw { | |||
| 94 | #define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ | 94 | #define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ |
| 95 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ | 95 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ |
| 96 | 96 | ||
| 97 | extern struct net_protocol *inet_protocol_base; | 97 | extern const struct net_protocol *inet_protos[MAX_INET_PROTOS]; |
| 98 | extern struct net_protocol *inet_protos[MAX_INET_PROTOS]; | ||
| 99 | 98 | ||
| 100 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 99 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
| 101 | extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; | 100 | extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; |
| 102 | #endif | 101 | #endif |
| 103 | 102 | ||
| 104 | extern int inet_add_protocol(struct net_protocol *prot, unsigned char num); | 103 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); |
| 105 | extern int inet_del_protocol(struct net_protocol *prot, unsigned char num); | 104 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); |
| 106 | extern void inet_register_protosw(struct inet_protosw *p); | 105 | extern void inet_register_protosw(struct inet_protosw *p); |
| 107 | extern void inet_unregister_protosw(struct inet_protosw *p); | 106 | extern void inet_unregister_protosw(struct inet_protosw *p); |
| 108 | 107 | ||
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index d01c00de1ad0..7302e1498d46 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -948,7 +948,7 @@ static struct proto dccp_v4_prot = { | |||
| 948 | #endif | 948 | #endif |
| 949 | }; | 949 | }; |
| 950 | 950 | ||
| 951 | static struct net_protocol dccp_v4_protocol = { | 951 | static const struct net_protocol dccp_v4_protocol = { |
| 952 | .handler = dccp_v4_rcv, | 952 | .handler = dccp_v4_rcv, |
| 953 | .err_handler = dccp_v4_err, | 953 | .err_handler = dccp_v4_err, |
| 954 | .no_policy = 1, | 954 | .no_policy = 1, |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 6c30a73f03f5..58c4b0f7c4aa 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -244,7 +244,7 @@ EXPORT_SYMBOL(build_ehash_secret); | |||
| 244 | static inline int inet_netns_ok(struct net *net, int protocol) | 244 | static inline int inet_netns_ok(struct net *net, int protocol) |
| 245 | { | 245 | { |
| 246 | int hash; | 246 | int hash; |
| 247 | struct net_protocol *ipprot; | 247 | const struct net_protocol *ipprot; |
| 248 | 248 | ||
| 249 | if (net_eq(net, &init_net)) | 249 | if (net_eq(net, &init_net)) |
| 250 | return 1; | 250 | return 1; |
| @@ -1162,7 +1162,7 @@ EXPORT_SYMBOL(inet_sk_rebuild_header); | |||
| 1162 | static int inet_gso_send_check(struct sk_buff *skb) | 1162 | static int inet_gso_send_check(struct sk_buff *skb) |
| 1163 | { | 1163 | { |
| 1164 | struct iphdr *iph; | 1164 | struct iphdr *iph; |
| 1165 | struct net_protocol *ops; | 1165 | const struct net_protocol *ops; |
| 1166 | int proto; | 1166 | int proto; |
| 1167 | int ihl; | 1167 | int ihl; |
| 1168 | int err = -EINVAL; | 1168 | int err = -EINVAL; |
| @@ -1198,7 +1198,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features) | |||
| 1198 | { | 1198 | { |
| 1199 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 1199 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
| 1200 | struct iphdr *iph; | 1200 | struct iphdr *iph; |
| 1201 | struct net_protocol *ops; | 1201 | const struct net_protocol *ops; |
| 1202 | int proto; | 1202 | int proto; |
| 1203 | int ihl; | 1203 | int ihl; |
| 1204 | int id; | 1204 | int id; |
| @@ -1265,7 +1265,7 @@ out: | |||
| 1265 | static struct sk_buff **inet_gro_receive(struct sk_buff **head, | 1265 | static struct sk_buff **inet_gro_receive(struct sk_buff **head, |
| 1266 | struct sk_buff *skb) | 1266 | struct sk_buff *skb) |
| 1267 | { | 1267 | { |
| 1268 | struct net_protocol *ops; | 1268 | const struct net_protocol *ops; |
| 1269 | struct sk_buff **pp = NULL; | 1269 | struct sk_buff **pp = NULL; |
| 1270 | struct sk_buff *p; | 1270 | struct sk_buff *p; |
| 1271 | struct iphdr *iph; | 1271 | struct iphdr *iph; |
| @@ -1342,7 +1342,7 @@ out: | |||
| 1342 | 1342 | ||
| 1343 | static int inet_gro_complete(struct sk_buff *skb) | 1343 | static int inet_gro_complete(struct sk_buff *skb) |
| 1344 | { | 1344 | { |
| 1345 | struct net_protocol *ops; | 1345 | const struct net_protocol *ops; |
| 1346 | struct iphdr *iph = ip_hdr(skb); | 1346 | struct iphdr *iph = ip_hdr(skb); |
| 1347 | int proto = iph->protocol & (MAX_INET_PROTOS - 1); | 1347 | int proto = iph->protocol & (MAX_INET_PROTOS - 1); |
| 1348 | int err = -ENOSYS; | 1348 | int err = -ENOSYS; |
| @@ -1427,13 +1427,13 @@ void snmp_mib_free(void *ptr[2]) | |||
| 1427 | EXPORT_SYMBOL_GPL(snmp_mib_free); | 1427 | EXPORT_SYMBOL_GPL(snmp_mib_free); |
| 1428 | 1428 | ||
| 1429 | #ifdef CONFIG_IP_MULTICAST | 1429 | #ifdef CONFIG_IP_MULTICAST |
| 1430 | static struct net_protocol igmp_protocol = { | 1430 | static const struct net_protocol igmp_protocol = { |
| 1431 | .handler = igmp_rcv, | 1431 | .handler = igmp_rcv, |
| 1432 | .netns_ok = 1, | 1432 | .netns_ok = 1, |
| 1433 | }; | 1433 | }; |
| 1434 | #endif | 1434 | #endif |
| 1435 | 1435 | ||
| 1436 | static struct net_protocol tcp_protocol = { | 1436 | static const struct net_protocol tcp_protocol = { |
| 1437 | .handler = tcp_v4_rcv, | 1437 | .handler = tcp_v4_rcv, |
| 1438 | .err_handler = tcp_v4_err, | 1438 | .err_handler = tcp_v4_err, |
| 1439 | .gso_send_check = tcp_v4_gso_send_check, | 1439 | .gso_send_check = tcp_v4_gso_send_check, |
| @@ -1444,7 +1444,7 @@ static struct net_protocol tcp_protocol = { | |||
| 1444 | .netns_ok = 1, | 1444 | .netns_ok = 1, |
| 1445 | }; | 1445 | }; |
| 1446 | 1446 | ||
| 1447 | static struct net_protocol udp_protocol = { | 1447 | static const struct net_protocol udp_protocol = { |
| 1448 | .handler = udp_rcv, | 1448 | .handler = udp_rcv, |
| 1449 | .err_handler = udp_err, | 1449 | .err_handler = udp_err, |
| 1450 | .gso_send_check = udp4_ufo_send_check, | 1450 | .gso_send_check = udp4_ufo_send_check, |
| @@ -1453,7 +1453,7 @@ static struct net_protocol udp_protocol = { | |||
| 1453 | .netns_ok = 1, | 1453 | .netns_ok = 1, |
| 1454 | }; | 1454 | }; |
| 1455 | 1455 | ||
| 1456 | static struct net_protocol icmp_protocol = { | 1456 | static const struct net_protocol icmp_protocol = { |
| 1457 | .handler = icmp_rcv, | 1457 | .handler = icmp_rcv, |
| 1458 | .no_policy = 1, | 1458 | .no_policy = 1, |
| 1459 | .netns_ok = 1, | 1459 | .netns_ok = 1, |
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index e878e494296e..5c662703eb1e 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
| @@ -311,7 +311,7 @@ static const struct xfrm_type ah_type = | |||
| 311 | .output = ah_output | 311 | .output = ah_output |
| 312 | }; | 312 | }; |
| 313 | 313 | ||
| 314 | static struct net_protocol ah4_protocol = { | 314 | static const struct net_protocol ah4_protocol = { |
| 315 | .handler = xfrm4_rcv, | 315 | .handler = xfrm4_rcv, |
| 316 | .err_handler = ah4_err, | 316 | .err_handler = ah4_err, |
| 317 | .no_policy = 1, | 317 | .no_policy = 1, |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 18bb383ea393..12f7287e902d 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
| @@ -615,7 +615,7 @@ static const struct xfrm_type esp_type = | |||
| 615 | .output = esp_output | 615 | .output = esp_output |
| 616 | }; | 616 | }; |
| 617 | 617 | ||
| 618 | static struct net_protocol esp4_protocol = { | 618 | static const struct net_protocol esp4_protocol = { |
| 619 | .handler = xfrm4_rcv, | 619 | .handler = xfrm4_rcv, |
| 620 | .err_handler = esp4_err, | 620 | .err_handler = esp4_err, |
| 621 | .no_policy = 1, | 621 | .no_policy = 1, |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 97c410e84388..5bc13fe816d1 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
| @@ -655,7 +655,7 @@ static void icmp_unreach(struct sk_buff *skb) | |||
| 655 | struct iphdr *iph; | 655 | struct iphdr *iph; |
| 656 | struct icmphdr *icmph; | 656 | struct icmphdr *icmph; |
| 657 | int hash, protocol; | 657 | int hash, protocol; |
| 658 | struct net_protocol *ipprot; | 658 | const struct net_protocol *ipprot; |
| 659 | u32 info = 0; | 659 | u32 info = 0; |
| 660 | struct net *net; | 660 | struct net *net; |
| 661 | 661 | ||
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 533afaadefd4..d9645c94a067 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
| @@ -1288,7 +1288,7 @@ static void ipgre_fb_tunnel_init(struct net_device *dev) | |||
| 1288 | } | 1288 | } |
| 1289 | 1289 | ||
| 1290 | 1290 | ||
| 1291 | static struct net_protocol ipgre_protocol = { | 1291 | static const struct net_protocol ipgre_protocol = { |
