Explorar o código

fix ipv6 header struct

wangyu- %!s(int64=7) %!d(string=hai) anos
pai
achega
f52385ccd5
Modificáronse 1 ficheiros con 9 adicións e 8 borrados
  1. 9 8
      network.h

+ 9 - 8
network.h

@@ -33,18 +33,19 @@ extern int g_packet_buf_cnt;
 struct my_ip6hdr
 struct my_ip6hdr
   {
   {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int32_t traffic_class_high:4;
-    u_int32_t version:4;
-    u_int32_t traffic_class_low:4;
-    u_int32_t flow_label:20;
+    uint8_t traffic_class_high:4;
+    uint8_t version:4;
+    uint8_t flow_label_high:4;
+    uint8_t traffic_class_low:4;
 #elif __BYTE_ORDER == __BIG_ENDIAN
 #elif __BYTE_ORDER == __BIG_ENDIAN
-    u_int32_t flow_label:20;
-    u_int32_t traffic_class_low:4;
-	u_int32_t version:4;
-    u_int32_t traffic_class_high:4;
+    uint8_t version:4;
+    uint8_t traffic_class_high:4;
+    uint8_t traffic_class_low:4;
+    uint8_t flow_label_high:4;
 #else
 #else
 # error	"Please fix this"
 # error	"Please fix this"
 #endif
 #endif
+    u_int16_t flow_label_low;
     u_int16_t payload_len;
     u_int16_t payload_len;
     unsigned char next_header;
     unsigned char next_header;
     unsigned char hop_limit;
     unsigned char hop_limit;