xt_TARPIT: fix kernel warning about RTAX_HOPLIMIT being used

This commit is contained in:
Jan Engelhardt
2011-07-26 01:57:45 +02:00
parent d2f3541cda
commit cd18e2479c
2 changed files with 5 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
HEAD
====
- xt_TARPIT: fix kernel warning about RTAX_HOPLIMIT being used
v1.37 (2011-06-25)

View File

@@ -232,7 +232,11 @@ static void tarpit_tcp(struct sk_buff *oldskb, unsigned int hook,
if (mode == XTTARPIT_HONEYPOT)
niph->ttl = 128;
else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
#else
niph->ttl = dst_metric(skb_dst(nskb), RTAX_HOPLIMIT);
#endif
/* Adjust IP checksum */
niph->check = 0;