summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-01 01:06:47 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-04 15:18:22 +0900
commite898d4db2749c6052072e9bc4448e396cbdeb06a (patch)
tree2b8673d85210a23e67d0817b18f401411e8936f3 /net/ipv6/ipv6_sockglue.c
parentc6aefafb7ec620911d46174eed514f9df639e5a4 (diff)
downloadlinux-e898d4db2749c6052072e9bc4448e396cbdeb06a.tar.gz
linux-e898d4db2749c6052072e9bc4448e396cbdeb06a.tar.bz2
linux-e898d4db2749c6052072e9bc4448e396cbdeb06a.zip
[UDP]: Allow users to configure UDP-Lite.
Let's give users an option for disabling UDP-Lite (~4K). old: | text data bss dec hex filename | 286498 12432 6072 305002 4a76a net/ipv4/built-in.o | 193830 8192 3204 205226 321aa net/ipv6/ipv6.o new (without UDP-Lite): | text data bss dec hex filename | 284086 12136 5432 301654 49a56 net/ipv4/built-in.o | 191835 7832 3076 202743 317f7 net/ipv6/ipv6.o Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index bf2a686aa13d..0a18fecb93d1 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -239,7 +239,9 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
struct sk_buff *pktopt;
if (sk->sk_protocol != IPPROTO_UDP &&
+#ifdef CONFIG_IP_UDPLITE
sk->sk_protocol != IPPROTO_UDPLITE &&
+#endif
sk->sk_protocol != IPPROTO_TCP)
break;
@@ -279,7 +281,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
} else {
struct proto *prot = &udp_prot;
- if (sk->sk_protocol == IPPROTO_UDPLITE)
+ if (IS_PROTO_UDPLITE(sk->sk_protocol))
prot = &udplite_prot;
local_bh_disable();
sock_prot_inuse_add(sk->sk_prot, -1);
@@ -844,7 +846,9 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
switch (optname) {
case IPV6_ADDRFORM:
if (sk->sk_protocol != IPPROTO_UDP &&
+#ifdef CONFIG_IP_UDPLITE
sk->sk_protocol != IPPROTO_UDPLITE &&
+#endif
sk->sk_protocol != IPPROTO_TCP)
return -EINVAL;
if (sk->sk_state != TCP_ESTABLISHED)