From 2c5d0956a9b7de7dfaa3d802d485af5e1b46ef38 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Tue, 6 Jun 2023 00:10:39 +0900 Subject: [PATCH] xt_ipp2p: change byte order conversion Instead of converting the packet bytes before comparing it to a constant, convert the constant. Signed-off-by: Jeremy Sowden --- extensions/xt_ipp2p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/xt_ipp2p.c b/extensions/xt_ipp2p.c index 5bdb7ee..d2e2970 100644 --- a/extensions/xt_ipp2p.c +++ b/extensions/xt_ipp2p.c @@ -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: -- 2.47.2