]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_ipp2p: change byte order conversion
authorJeremy Sowden <jeremy@azazel.net>
Mon, 5 Jun 2023 15:10:39 +0000 (00:10 +0900)
committerJan Engelhardt <jengelh@inai.de>
Tue, 6 Jun 2023 11:38:20 +0000 (20:38 +0900)
Instead of converting the packet bytes before comparing it to a
constant, convert the constant.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
extensions/xt_ipp2p.c

index 5bdb7eec40d266c4c278e90873d836f171c1bdf0..d2e29706998a48a7e7b617400acc2cc2a8ec32c0 100644 (file)
@@ -210,8 +210,8 @@ udp_search_bit(const unsigned char *haystack, const unsigned int packet_len)
        switch (packet_len) {
        case 16:
                /* ^ 00 00 04 17 27 10 19 80 */
-               if (ntohl(get_u32(haystack, 0)) == 0x00000417 &&
-                   ntohl(get_u32(haystack, 4)) == 0x27101980)
+               if (get_u32(haystack, 0) == __constant_htonl(0x00000417) &&
+                   get_u32(haystack, 4) == __constant_htonl(0x27101980))
                        return IPP2P_BIT * 100 + 50;
                break;
        case 36: