diff options
author | Jiri Olsa <jolsa@redhat.com> | 2010-06-15 01:07:31 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-23 13:16:38 -0700 |
commit | 7b2ff18ee7b0ec4bc3162f821e221781aaca48bd (patch) | |
tree | eed7535663f6333a1dc68861d8cd7b98d8050d4d /net/ipv4/ip_sockglue.c | |
parent | 01fc3e86c6379cc4c78c529a1bad1b8179b726aa (diff) | |
download | linux-3.10-7b2ff18ee7b0ec4bc3162f821e221781aaca48bd.tar.gz linux-3.10-7b2ff18ee7b0ec4bc3162f821e221781aaca48bd.tar.bz2 linux-3.10-7b2ff18ee7b0ec4bc3162f821e221781aaca48bd.zip |
net - IP_NODEFRAG option for IPv4 socket
this patch is implementing IP_NODEFRAG option for IPv4 socket.
The reason is, there's no other way to send out the packet with user
customized header of the reassembly part.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 47fff528ff3..6c40a8c46e7 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -465,7 +465,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, (1<<IP_MTU_DISCOVER) | (1<<IP_RECVERR) | (1<<IP_ROUTER_ALERT) | (1<<IP_FREEBIND) | (1<<IP_PASSSEC) | (1<<IP_TRANSPARENT) | - (1<<IP_MINTTL))) || + (1<<IP_MINTTL) | (1<<IP_NODEFRAG))) || optname == IP_MULTICAST_TTL || optname == IP_MULTICAST_ALL || optname == IP_MULTICAST_LOOP || @@ -588,6 +588,13 @@ static int do_ip_setsockopt(struct sock *sk, int level, } inet->hdrincl = val ? 1 : 0; break; + case IP_NODEFRAG: + if (sk->sk_type != SOCK_RAW) { + err = -ENOPROTOOPT; + break; + } + inet->nodefrag = val ? 1 : 0; + break; case IP_MTU_DISCOVER: if (val < IP_PMTUDISC_DONT || val > IP_PMTUDISC_PROBE) goto e_inval; |