diff options
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index dac471ed067b..ec946c13ea20 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -1015,6 +1015,11 @@ int do_ip_setsockopt(struct sock *sk, int level, int optname, goto e_inval; inet_assign_bit(TRANSPARENT, sk, val); return 0; + case IP_NODEFRAG: + if (sk->sk_type != SOCK_RAW) + return -ENOPROTOOPT; + inet_assign_bit(NODEFRAG, sk, val); + return 0; } err = 0; @@ -1079,13 +1084,6 @@ int do_ip_setsockopt(struct sock *sk, int level, int optname, goto e_inval; inet->uc_ttl = val; break; - case IP_NODEFRAG: - if (sk->sk_type != SOCK_RAW) { - err = -ENOPROTOOPT; - break; - } - inet->nodefrag = val ? 1 : 0; - break; case IP_BIND_ADDRESS_NO_PORT: inet->bind_address_no_port = val ? 1 : 0; break; @@ -1586,6 +1584,9 @@ int do_ip_getsockopt(struct sock *sk, int level, int optname, case IP_TRANSPARENT: val = inet_test_bit(TRANSPARENT, sk); goto copyval; + case IP_NODEFRAG: + val = inet_test_bit(NODEFRAG, sk); + goto copyval; } if (needs_rtnl) @@ -1633,9 +1634,6 @@ int do_ip_getsockopt(struct sock *sk, int level, int optname, inet->uc_ttl); break; } - case IP_NODEFRAG: - val = inet->nodefrag; - break; case IP_BIND_ADDRESS_NO_PORT: val = inet->bind_address_no_port; break; |