tcp: Generalized TTL Security Mechanism
[pandora-kernel.git] / net / ipv4 / tcp_ipv4.c
index 65b8ebf..382f667 100644 (file)
@@ -1649,6 +1649,9 @@ int tcp_v4_rcv(struct sk_buff *skb)
        if (!sk)
                goto no_tcp_socket;
 
+       if (iph->ttl < inet_sk(sk)->min_ttl)
+               goto discard_and_relse;
+
 process:
        if (sk->sk_state == TCP_TIME_WAIT)
                goto do_time_wait;