aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-06 19:22:02 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-06 19:22:02 -0500
commitdb8dac20d5199307dcfcf4e01dac4bda5edf9e89 (patch)
tree3694d1aee5c0014fb45eec045a67ca150ca1231f /net/ipv6
parentba0fa4599484b98dbb21d279fbfdb40e9c07d30d (diff)
[UDP]: Revert udplite and code split.
This reverts commit db1ed684f6c430c4cdad67d058688b8a1b5e607c ("[IPV6] UDP: Rename IPv6 UDP files."), commit 8be8af8fa4405652e6c0797db5465a4be8afb998 ("[IPV4] UDP: Move IPv4-specific bits to other file.") and commit e898d4db2749c6052072e9bc4448e396cbdeb06a ("[UDP]: Allow users to configure UDP-Lite."). First, udplite is of such small cost, and it is a core protocol just like TCP and normal UDP are. We spent enormous amounts of effort to make udplite share as much code with core UDP as possible. All of that work is less valuable if we're just going to slap a config option on udplite support. It is also causing build failures, as reported on linux-next, showing that the changeset was not tested very well. In fact, this is the second build failure resulting from the udplite change. Finally, the config options provided was a bool, instead of a modular option. Meaning the udplite code does not even get build tested by allmodconfig builds, and furthermore the user is not presented with a reasonable modular build option which is particularly needed by distribution vendors. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/Makefile3
-rw-r--r--net/ipv6/af_inet6.c14
-rw-r--r--net/ipv6/ipv6_sockglue.c6
-rw-r--r--net/ipv6/proc.c6
-rw-r--r--net/ipv6/udp.c (renamed from net/ipv6/udp_ipv6.c)16
-rw-r--r--net/ipv6/udplite.c (renamed from net/ipv6/udplite_ipv6.c)0
6 files changed, 10 insertions, 35 deletions
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 107051f7c227..ae14617e607f 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_IPV6) += ipv6.o
6 6
7ipv6-objs := af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \ 7ipv6-objs := af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \
8 addrlabel.o \ 8 addrlabel.o \
9 route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp_ipv6.o \ 9 route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o udplite.o \
10 raw.o protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ 10 raw.o protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \
11 exthdrs.o datagram.o ip6_flowlabel.o inet6_connection_sock.o 11 exthdrs.o datagram.o ip6_flowlabel.o inet6_connection_sock.o
12 12
@@ -17,7 +17,6 @@ ipv6-$(CONFIG_NETFILTER) += netfilter.o
17ipv6-$(CONFIG_IPV6_MULTIPLE_TABLES) += fib6_rules.o 17ipv6-$(CONFIG_IPV6_MULTIPLE_TABLES) += fib6_rules.o
18ipv6-$(CONFIG_PROC_FS) += proc.o 18ipv6-$(CONFIG_PROC_FS) += proc.o
19ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o 19ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o
20ipv6-$(CONFIG_IP_UDPLITE) += udplite_ipv6.o
21 20
22ipv6-objs += $(ipv6-y) 21ipv6-objs += $(ipv6-y)
23 22
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index afe9276d0420..730a861b8f41 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -813,16 +813,12 @@ static int __init init_ipv6_mibs(void)
813 goto err_icmpmsg_mib; 813 goto err_icmpmsg_mib;
814 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0) 814 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0)
815 goto err_udp_mib; 815 goto err_udp_mib;
816#ifdef CONFIG_IP_UDPLITE
817 if (snmp_mib_init((void **)udplite_stats_in6, 816 if (snmp_mib_init((void **)udplite_stats_in6,
818 sizeof (struct udp_mib)) < 0) 817 sizeof (struct udp_mib)) < 0)
819 goto err_udplite_mib; 818 goto err_udplite_mib;
820#endif
821 return 0; 819 return 0;
822 820
823#ifdef CONFIG_IP_UDPLITE
824err_udplite_mib: 821err_udplite_mib:
825#endif
826 snmp_mib_free((void **)udp_stats_in6); 822 snmp_mib_free((void **)udp_stats_in6);
827err_udp_mib: 823err_udp_mib:
828 snmp_mib_free((void **)icmpv6msg_statistics); 824 snmp_mib_free((void **)icmpv6msg_statistics);
@@ -841,9 +837,7 @@ static void cleanup_ipv6_mibs(void)
841 snmp_mib_free((void **)icmpv6_statistics); 837 snmp_mib_free((void **)icmpv6_statistics);
842 snmp_mib_free((void **)icmpv6msg_statistics); 838 snmp_mib_free((void **)icmpv6msg_statistics);
843 snmp_mib_free((void **)udp_stats_in6); 839 snmp_mib_free((void **)udp_stats_in6);
844#ifdef CONFIG_IP_UDPLITE
845 snmp_mib_free((void **)udplite_stats_in6); 840 snmp_mib_free((void **)udplite_stats_in6);
846#endif
847} 841}
848 842
849static int inet6_net_init(struct net *net) 843static int inet6_net_init(struct net *net)
@@ -888,11 +882,9 @@ static int __init inet6_init(void)
888 if (err) 882 if (err)
889 goto out_unregister_tcp_proto; 883 goto out_unregister_tcp_proto;
890 884
891#ifdef CONFIG_IP_UDPLITE
892 err = proto_register(&udplitev6_prot, 1); 885 err = proto_register(&udplitev6_prot, 1);
893 if (err) 886 if (err)
894 goto out_unregister_udp_proto; 887 goto out_unregister_udp_proto;
895#endif
896 888
897 err = proto_register(&rawv6_prot, 1); 889 err = proto_register(&rawv6_prot, 1);
898 if (err) 890 if (err)
@@ -1063,10 +1055,8 @@ out_sock_register_fail:
1063out_unregister_raw_proto: 1055out_unregister_raw_proto:
1064 proto_unregister(&rawv6_prot); 1056 proto_unregister(&rawv6_prot);
1065out_unregister_udplite_proto: 1057out_unregister_udplite_proto:
1066#ifdef CONFIG_IP_UDPLITE
1067 proto_unregister(&udplitev6_prot); 1058 proto_unregister(&udplitev6_prot);
1068out_unregister_udp_proto: 1059out_unregister_udp_proto:
1069#endif
1070 proto_unregister(&udpv6_prot); 1060 proto_unregister(&udpv6_prot);
1071out_unregister_tcp_proto: 1061out_unregister_tcp_proto:
1072 proto_unregister(&tcpv6_prot); 1062 proto_unregister(&tcpv6_prot);
@@ -1085,9 +1075,7 @@ static void __exit inet6_exit(void)
1085 ipv6_sysctl_unregister(); 1075 ipv6_sysctl_unregister();
1086#endif 1076#endif
1087 udpv6_exit(); 1077 udpv6_exit();
1088#ifdef CONFIG_IP_UDPLITE
1089 udplitev6_exit(); 1078 udplitev6_exit();
1090#endif
1091 tcpv6_exit(); 1079 tcpv6_exit();
1092 1080
1093 /* Cleanup code parts. */ 1081 /* Cleanup code parts. */
@@ -1117,9 +1105,7 @@ static void __exit inet6_exit(void)
1117 unregister_pernet_subsys(&inet6_net_ops); 1105 unregister_pernet_subsys(&inet6_net_ops);
1118 cleanup_ipv6_mibs(); 1106 cleanup_ipv6_mibs();
1119 proto_unregister(&rawv6_prot); 1107 proto_unregister(&rawv6_prot);
1120#ifdef CONFIG_IP_UDPLITE
1121 proto_unregister(&udplitev6_prot); 1108 proto_unregister(&udplitev6_prot);
1122#endif
1123 proto_unregister(&udpv6_prot); 1109 proto_unregister(&udpv6_prot);
1124 proto_unregister(&tcpv6_prot); 1110 proto_unregister(&tcpv6_prot);
1125} 1111}
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 3bbfdff698d2..5eea6fa506e5 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -127,9 +127,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
127 struct sk_buff *pktopt; 127 struct sk_buff *pktopt;
128 128
129 if (sk->sk_protocol != IPPROTO_UDP && 129 if (sk->sk_protocol != IPPROTO_UDP &&
130#ifdef CONFIG_IP_UDPLITE
131 sk->sk_protocol != IPPROTO_UDPLITE && 130 sk->sk_protocol != IPPROTO_UDPLITE &&
132#endif
133 sk->sk_protocol != IPPROTO_TCP) 131 sk->sk_protocol != IPPROTO_TCP)
134 break; 132 break;
135 133
@@ -169,7 +167,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
169 } else { 167 } else {
170 struct proto *prot = &udp_prot; 168 struct proto *prot = &udp_prot;
171 169
172 if (IS_PROTO_UDPLITE(sk->sk_protocol)) 170 if (sk->sk_protocol == IPPROTO_UDPLITE)
173 prot = &udplite_prot; 171 prot = &udplite_prot;
174 local_bh_disable(); 172 local_bh_disable();
175 sock_prot_inuse_add(sk->sk_prot, -1); 173 sock_prot_inuse_add(sk->sk_prot, -1);
@@ -734,9 +732,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
734 switch (optname) { 732 switch (optname) {
735 case IPV6_ADDRFORM: 733 case IPV6_ADDRFORM:
736 if (sk->sk_protocol != IPPROTO_UDP && 734 if (sk->sk_protocol != IPPROTO_UDP &&
737#ifdef CONFIG_IP_UDPLITE
738 sk->sk_protocol != IPPROTO_UDPLITE && 735 sk->sk_protocol != IPPROTO_UDPLITE &&
739#endif
740 sk->sk_protocol != IPPROTO_TCP) 736 sk->sk_protocol != IPPROTO_TCP)
741 return -EINVAL; 737 return -EINVAL;
742 if (sk->sk_state != TCP_ESTABLISHED) 738 if (sk->sk_state != TCP_ESTABLISHED)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 2453f2229ef7..8a5be290c710 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -39,10 +39,8 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
39 sock_prot_inuse_get(&tcpv6_prot)); 39 sock_prot_inuse_get(&tcpv6_prot));
40 seq_printf(seq, "UDP6: inuse %d\n", 40 seq_printf(seq, "UDP6: inuse %d\n",
41 sock_prot_inuse_get(&udpv6_prot)); 41 sock_prot_inuse_get(&udpv6_prot));
42#ifdef CONFIG_IP_UDPLITE
43 seq_printf(seq, "UDPLITE6: inuse %d\n", 42 seq_printf(seq, "UDPLITE6: inuse %d\n",
44 sock_prot_inuse_get(&udplitev6_prot)); 43 sock_prot_inuse_get(&udplitev6_prot));
45#endif
46 seq_printf(seq, "RAW6: inuse %d\n", 44 seq_printf(seq, "RAW6: inuse %d\n",
47 sock_prot_inuse_get(&rawv6_prot)); 45 sock_prot_inuse_get(&rawv6_prot));
48 seq_printf(seq, "FRAG6: inuse %d memory %d\n", 46 seq_printf(seq, "FRAG6: inuse %d memory %d\n",
@@ -113,7 +111,6 @@ static struct snmp_mib snmp6_udp6_list[] = {
113 SNMP_MIB_SENTINEL 111 SNMP_MIB_SENTINEL
114}; 112};
115 113
116#ifdef CONFIG_IP_UDPLITE
117static struct snmp_mib snmp6_udplite6_list[] = { 114static struct snmp_mib snmp6_udplite6_list[] = {
118 SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS), 115 SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS),
119 SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS), 116 SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS),
@@ -121,7 +118,6 @@ static struct snmp_mib snmp6_udplite6_list[] = {
121 SNMP_MIB_ITEM("UdpLite6OutDatagrams", UDP_MIB_OUTDATAGRAMS), 118 SNMP_MIB_ITEM("UdpLite6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
122 SNMP_MIB_SENTINEL 119 SNMP_MIB_SENTINEL
123}; 120};
124#endif
125 121
126static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) 122static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
127{ 123{
@@ -180,9 +176,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
180 snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); 176 snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list);
181 snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics); 177 snmp6_seq_show_icmpv6msg(seq, (void **)icmpv6msg_statistics);
182 snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list); 178 snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list);
183#ifdef CONFIG_IP_UDPLITE
184 snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list); 179 snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list);
185#endif
186 } 180 }
187 return 0; 181 return 0;
188} 182}
diff --git a/net/ipv6/udp_ipv6.c b/net/ipv6/udp.c
index 55feac7ba717..53739de829db 100644
--- a/net/ipv6/udp_ipv6.c
+++ b/net/ipv6/udp.c
@@ -400,7 +400,7 @@ static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh,
400 UDP_SKB_CB(skb)->partial_cov = 0; 400 UDP_SKB_CB(skb)->partial_cov = 0;
401 UDP_SKB_CB(skb)->cscov = skb->len; 401 UDP_SKB_CB(skb)->cscov = skb->len;
402 402
403 if (IS_PROTO_UDPLITE(proto)) { 403 if (proto == IPPROTO_UDPLITE) {
404 err = udplite_checksum_init(skb, uh); 404 err = udplite_checksum_init(skb, uh);
405 if (err) 405 if (err)
406 return err; 406 return err;
@@ -489,7 +489,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
489 489
490 if (udp_lib_checksum_complete(skb)) 490 if (udp_lib_checksum_complete(skb))
491 goto discard; 491 goto discard;
492 UDP6_INC_STATS_BH(UDP_MIB_NOPORTS, IS_PROTO_UDPLITE(proto)); 492 UDP6_INC_STATS_BH(UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
493 493
494 icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev); 494 icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);
495 495
@@ -510,11 +510,11 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
510 510
511short_packet: 511short_packet:
512 LIMIT_NETDEBUG(KERN_DEBUG "UDP%sv6: short packet: %d/%u\n", 512 LIMIT_NETDEBUG(KERN_DEBUG "UDP%sv6: short packet: %d/%u\n",
513 IS_PROTO_UDPLITE(proto) ? "-Lite" : "", 513 proto == IPPROTO_UDPLITE ? "-Lite" : "",
514 ulen, skb->len); 514 ulen, skb->len);
515 515
516discard: 516discard:
517 UDP6_INC_STATS_BH(UDP_MIB_INERRORS, IS_PROTO_UDPLITE(proto)); 517 UDP6_INC_STATS_BH(UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE);
518 kfree_skb(skb); 518 kfree_skb(skb);
519 return 0; 519 return 0;
520} 520}
@@ -890,7 +890,7 @@ int udpv6_destroy_sock(struct sock *sk)
890int udpv6_setsockopt(struct sock *sk, int level, int optname, 890int udpv6_setsockopt(struct sock *sk, int level, int optname,
891 char __user *optval, int optlen) 891 char __user *optval, int optlen)
892{ 892{
893 if (IS_SOL_UDPFAMILY(level)) 893 if (level == SOL_UDP || level == SOL_UDPLITE)
894 return udp_lib_setsockopt(sk, level, optname, optval, optlen, 894 return udp_lib_setsockopt(sk, level, optname, optval, optlen,
895 udp_v6_push_pending_frames); 895 udp_v6_push_pending_frames);
896 return ipv6_setsockopt(sk, level, optname, optval, optlen); 896 return ipv6_setsockopt(sk, level, optname, optval, optlen);
@@ -900,7 +900,7 @@ int udpv6_setsockopt(struct sock *sk, int level, int optname,
900int compat_udpv6_setsockopt(struct sock *sk, int level, int optname, 900int compat_udpv6_setsockopt(struct sock *sk, int level, int optname,
901 char __user *optval, int optlen) 901 char __user *optval, int optlen)
902{ 902{
903 if (IS_SOL_UDPFAMILY(level)) 903 if (level == SOL_UDP || level == SOL_UDPLITE)
904 return udp_lib_setsockopt(sk, level, optname, optval, optlen, 904 return udp_lib_setsockopt(sk, level, optname, optval, optlen,
905 udp_v6_push_pending_frames); 905 udp_v6_push_pending_frames);
906 return compat_ipv6_setsockopt(sk, level, optname, optval, optlen); 906 return compat_ipv6_setsockopt(sk, level, optname, optval, optlen);
@@ -910,7 +910,7 @@ int compat_udpv6_setsockopt(struct sock *sk, int level, int optname,
910int udpv6_getsockopt(struct sock *sk, int level, int optname, 910int udpv6_getsockopt(struct sock *sk, int level, int optname,
911 char __user *optval, int __user *optlen) 911 char __user *optval, int __user *optlen)
912{ 912{
913 if (IS_SOL_UDPFAMILY(level)) 913 if (level == SOL_UDP || level == SOL_UDPLITE)
914 return udp_lib_getsockopt(sk, level, optname, optval, optlen); 914 return udp_lib_getsockopt(sk, level, optname, optval, optlen);
915 return ipv6_getsockopt(sk, level, optname, optval, optlen); 915 return ipv6_getsockopt(sk, level, optname, optval, optlen);
916} 916}
@@ -919,7 +919,7 @@ int udpv6_getsockopt(struct sock *sk, int level, int optname,
919int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, 919int compat_udpv6_getsockopt(struct sock *sk, int level, int optname,
920 char __user *optval, int __user *optlen) 920 char __user *optval, int __user *optlen)
921{ 921{
922 if (IS_SOL_UDPFAMILY(level)) 922 if (level == SOL_UDP || level == SOL_UDPLITE)
923 return udp_lib_getsockopt(sk, level, optname, optval, optlen); 923 return udp_lib_getsockopt(sk, level, optname, optval, optlen);
924 return compat_ipv6_getsockopt(sk, level, optname, optval, optlen); 924 return compat_ipv6_getsockopt(sk, level, optname, optval, optlen);
925} 925}
diff --git a/net/ipv6/udplite_ipv6.c b/net/ipv6/udplite.c
index 87d4202522ee..87d4202522ee 100644
--- a/net/ipv6/udplite_ipv6.c
+++ b/net/ipv6/udplite.c