diff options
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index cafad9baff03..644dc43a55de 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -451,7 +451,8 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
451 | (1<<IP_TTL) | (1<<IP_HDRINCL) | | 451 | (1<<IP_TTL) | (1<<IP_HDRINCL) | |
452 | (1<<IP_MTU_DISCOVER) | (1<<IP_RECVERR) | | 452 | (1<<IP_MTU_DISCOVER) | (1<<IP_RECVERR) | |
453 | (1<<IP_ROUTER_ALERT) | (1<<IP_FREEBIND) | | 453 | (1<<IP_ROUTER_ALERT) | (1<<IP_FREEBIND) | |
454 | (1<<IP_PASSSEC) | (1<<IP_TRANSPARENT))) || | 454 | (1<<IP_PASSSEC) | (1<<IP_TRANSPARENT) | |
455 | (1<<IP_MINTTL))) || | ||
455 | optname == IP_MULTICAST_TTL || | 456 | optname == IP_MULTICAST_TTL || |
456 | optname == IP_MULTICAST_ALL || | 457 | optname == IP_MULTICAST_ALL || |
457 | optname == IP_MULTICAST_LOOP || | 458 | optname == IP_MULTICAST_LOOP || |
@@ -936,6 +937,14 @@ mc_msf_out: | |||
936 | inet->transparent = !!val; | 937 | inet->transparent = !!val; |
937 | break; | 938 | break; |
938 | 939 | ||
940 | case IP_MINTTL: | ||
941 | if (optlen < 1) | ||
942 | goto e_inval; | ||
943 | if (val < 0 || val > 255) | ||
944 | goto e_inval; | ||
945 | inet->min_ttl = val; | ||
946 | break; | ||
947 | |||
939 | default: | 948 | default: |
940 | err = -ENOPROTOOPT; | 949 | err = -ENOPROTOOPT; |
941 | break; | 950 | break; |
@@ -1198,6 +1207,9 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, | |||
1198 | case IP_TRANSPARENT: | 1207 | case IP_TRANSPARENT: |
1199 | val = inet->transparent; | 1208 | val = inet->transparent; |
1200 | break; | 1209 | break; |
1210 | case IP_MINTTL: | ||
1211 | val = inet->min_ttl; | ||
1212 | break; | ||
1201 | default: | 1213 | default: |
1202 | release_sock(sk); | 1214 | release_sock(sk); |
1203 | return -ENOPROTOOPT; | 1215 | return -ENOPROTOOPT; |