From: Ben Pfaff Date: Mon, 4 Aug 2008 21:21:34 +0000 (-0700) Subject: Make it easier for the compiler to optimize IP_IS_FRAGMENT. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf13819340f1c75632f122d2ad6daaf70f6eb8f5;p=openvswitch Make it easier for the compiler to optimize IP_IS_FRAGMENT. --- diff --git a/include/packets.h b/include/packets.h index 177bc30f..ea73cb14 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 {