diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-14 16:36:28 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-28 22:26:22 +0200 |
commit | 1d71fdaf6b556546c6867bf7c6cdb0618a782e37 (patch) | |
tree | 10f7bbb2fb161ba6627137706420c821c9a759c8 /src/ip6_icmp.h | |
parent | 2059a5f629122270d7d9362e66d0f44d86780448 (diff) | |
download | slirp-1d71fdaf6b556546c6867bf7c6cdb0618a782e37.zip slirp-1d71fdaf6b556546c6867bf7c6cdb0618a782e37.tar.gz slirp-1d71fdaf6b556546c6867bf7c6cdb0618a782e37.tar.bz2 |
Fix bitfields order for MSVC
It uses a saner strictly "from low to high bit" rule.
Diffstat (limited to 'src/ip6_icmp.h')
-rw-r--r-- | src/ip6_icmp.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ip6_icmp.h b/src/ip6_icmp.h index 76517b3..9ae6266 100644 --- a/src/ip6_icmp.h +++ b/src/ip6_icmp.h @@ -35,7 +35,7 @@ struct ndp_rs { /* Router Solicitation Message */ struct ndp_ra { /* Router Advertisement Message */ uint8_t chl; /* Cur Hop Limit */ -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t M : 1, O : 1, reserved : 6; #else uint8_t reserved : 6, O : 1, M : 1; @@ -55,14 +55,16 @@ struct ndp_ns { /* Neighbor Solicitation Message */ G_STATIC_ASSERT(sizeof(struct ndp_ns) == 20); struct ndp_na { /* Neighbor Advertisement Message */ -#if G_BYTE_ORDER == G_BIG_ENDIAN - uint32_t R : 1, /* Router Flag */ +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) + uint8_t R : 1, /* Router Flag */ S : 1, /* Solicited Flag */ O : 1, /* Override Flag */ - reserved_hi : 5, reserved_lo : 24; + reserved_1 : 5 #else - uint32_t reserved_hi : 5, O : 1, S : 1, R : 1, reserved_lo : 24; + uint8_t reserved_1 : 5, O : 1, S : 1, R : 1; #endif + uint8_t reserved_2; + uint16_t reserved_3; struct in6_addr target; /* Target Address */ }; @@ -125,7 +127,7 @@ struct ndpopt { SLIRP_PACKED_BEGIN struct prefixinfo { /* Prefix Information */ uint8_t prefix_length; -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t L : 1, A : 1, reserved1 : 6; #else uint8_t reserved1 : 6, A : 1, L : 1; |