]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_ECHO: fix kernel warning about RTAX_HOPLIMIT being used
authorJan Engelhardt <jengelh@medozas.de>
Sat, 24 Sep 2011 21:18:33 +0000 (23:18 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 25 Sep 2011 12:39:43 +0000 (14:39 +0200)
doc/changelog.txt
extensions/xt_ECHO.c

index 655e547947a4f838fd3ad392c7842e05e838ae06..367e8f2d2fd792a1cd527884d4b62c2e91738be3 100644 (file)
@@ -1,6 +1,8 @@
 
 HEAD
 ====
+Fixes:
+- xt_ECHO: fix kernel warning about RTAX_HOPLIMIT being used
 
 
 v1.39 (2011-09-21)
index 5dbfbe746534d0fc09ab4dd62a3de30159a32b8c..389be12d7a3837bbb37f68c3014a49b71cb3bb4d 100644 (file)
@@ -18,6 +18,7 @@
 #      include <linux/netfilter_bridge.h>
 #endif
 #include <net/ip.h>
+#include <net/route.h>
 #include "compat_xtables.h"
 
 static unsigned int
@@ -82,7 +83,11 @@ echo_tg4(struct sk_buff **poldskb, const struct xt_action_param *par)
        if (ip_route_me_harder(&newskb, RTN_UNSPEC) != 0)
                goto free_nskb;
 
-       newip->ttl        = dst_metric(skb_dst(newskb), RTAX_HOPLIMIT);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+       newip->ttl = ip4_dst_hoplimit(skb_dst(newskb));
+#else
+       newip->ttl = dst_metric(skb_dst(newskb), RTAX_HOPLIMIT);
+#endif
        newskb->ip_summed = CHECKSUM_NONE;
 
        /* "Never happens" (?) */