From bf13819340f1c75632f122d2ad6daaf70f6eb8f5 Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@nicira.com>
Date: Mon, 4 Aug 2008 14:21:34 -0700
Subject: [PATCH] Make it easier for the compiler to optimize IP_IS_FRAGMENT.

---
 include/packets.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/packets.h b/include/packets.h
index 177bc30f4..ea73cb149 100644
--- a/include/packets.h
+++ b/include/packets.h
@@ -177,7 +177,7 @@ BUILD_ASSERT_DECL(VLAN_ETH_HEADER_LEN == sizeof(struct vlan_eth_header));
 #define IP_MORE_FRAGMENTS 0x2000 /* More fragments. */
 #define IP_FRAG_OFF_MASK  0x1fff /* Fragment offset. */
 #define IP_IS_FRAGMENT(ip_frag_off) \
-        (ntohs(ip_frag_off) & (IP_MORE_FRAGMENTS | IP_FRAG_OFF_MASK))
+        ((ip_frag_off) & htons(IP_MORE_FRAGMENTS | IP_FRAG_OFF_MASK))
 
 #define IP_HEADER_LEN 20
 struct ip_header {
-- 
2.47.0