Allow the IP_MINTTL socket option to be set to zero.
authorHasso Tepper <hasso@estpak.ee>
Mon, 2 Mar 2009 13:07:00 +0000 (15:07 +0200)
committerHasso Tepper <hasso@estpak.ee>
Mon, 2 Mar 2009 13:40:09 +0000 (15:40 +0200)
This disables the feature and is the default actually.

Reported-by: Nick Hilliard <nick at foobar.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1304>

sys/netinet/ip_output.c

index 9004ec9..3fc5796 100644 (file)
@@ -1401,7 +1401,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
                                inp->inp_ip_ttl = optval;
                                break;
                        case IP_MINTTL:
-                               if (optval > 0 && optval <= MAXTTL)
+                               if (optval >= 0 && optval <= MAXTTL)
                                        inp->inp_ip_minttl = optval;
                                else
                                        error = EINVAL;