]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
tarpit: compress some code
authorJan Engelhardt <jengelh@inai.de>
Thu, 9 Oct 2025 23:05:54 +0000 (01:05 +0200)
committerJan Engelhardt <jengelh@inai.de>
Thu, 9 Oct 2025 23:05:54 +0000 (01:05 +0200)
extensions/xt_TARPIT.c

index 71967b23405c6de3adc2266126a1ff77e3b913bb..650cdf9398f5fcbb9fd98e420e0808516ad9b098 100644 (file)
@@ -374,12 +374,8 @@ static void tarpit_tcp6(const struct xt_action_param *par,
        ip6h->daddr = oip6h->saddr;
 
        /* Adjust IP TTL */
-       if (mode == XTTARPIT_HONEYPOT) {
-               ip6h->hop_limit = 128;
-       } else {
-               ip6h->hop_limit = ip6_dst_hoplimit(skb_dst(nskb));
-       }
-
+       ip6h->hop_limit = mode == XTTARPIT_HONEYPOT ? 128 :
+                         ip6_dst_hoplimit(skb_dst(nskb));
        tcph = (struct tcphdr *)(skb_network_header(nskb) +
               sizeof(struct ipv6hdr));