[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvswitch-dev
Subject:    [ovs-dev] [PATCH] packets: Use WORDS_BIGENDIAN for struct geneve_opt.
From:       jesse () nicira ! com (Jesse Gross)
Date:       2014-10-31 23:53:00
Message-ID: 1414799580-50927-1-git-send-email-jesse () nicira ! com
[Download RAW message or body]

WORDS_BIGENDIAN is defined by configure so it is a more portable
way to test for endianness.

Reported-by: Ben Pfaff <blp at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 lib/packets.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index fc7e602..f45ddde 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -694,16 +694,16 @@ static inline bool dl_type_is_ip_any(ovs_be16 dl_type)
 struct geneve_opt {
     ovs_be16  opt_class;
     uint8_t   type;
-#ifdef LITTLE_ENDIAN
-    uint8_t   length:5;
-    uint8_t   r3:1;
-    uint8_t   r2:1;
-    uint8_t   r1:1;
-#else
+#ifdef WORDS_BIGENDIAN
     uint8_t   r1:1;
     uint8_t   r2:1;
     uint8_t   r3:1;
     uint8_t   length:5;
+#else
+    uint8_t   length:5;
+    uint8_t   r3:1;
+    uint8_t   r2:1;
+    uint8_t   r1:1;
 #endif
     uint8_t   opt_data[];
 };
-- 
1.9.1


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic