]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
psd: byteswap constant value instead
authorFlorian Westphal <fw@strlen.de>
Fri, 11 Sep 2009 09:05:55 +0000 (11:05 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 11 Sep 2009 19:38:23 +0000 (21:38 +0200)
htons(CONSTANT) is computed at compile time.
reduces .text by 4 bytes on x86.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
extensions/xt_psd.c

index 23b5e916d242d7cd977ce56fb27aeaaa77935f55..605ed032ce084f2061e328a20372f84ece9a1464 100644 (file)
@@ -118,7 +118,7 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
        iph = ip_hdr(pskb);
 
        /* Sanity check */
-       if (ntohs(iph->frag_off) & IP_OFFSET) {
+       if (iph->frag_off & htons(IP_OFFSET)) {
                pr_debug("sanity check failed\n");
                return false;
        }