[ovs-dev] [PATCH] packets: Do not use zero sized array in icmp header.

Gurucharan Shetty shettyg at nicira.com
Thu Jan 15 19:14:27 UTC 2015


Visual studio supports zero-size array within a struct or union,
but has to be the last element. GCC does not have this restriction.

icmp headers got included inside 'struct ovs_nd_msg' through
commit e60e935b1f (Implement set-field for IPv6 ND fields (nd_target,
nd_sll,and nd_tll). This causes compilation error while using MSVC.

Since icmp[6]_data in the icmp[6]_header is not used anywhere, just remove
them.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 lib/packets.h |    2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index 65d2274..cbd6f90 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -518,7 +518,6 @@ struct icmp_header {
         } frag;
         ovs_16aligned_be32 gateway;
     } icmp_fields;
-    uint8_t icmp_data[0];
 };
 BUILD_ASSERT_DECL(ICMP_HEADER_LEN == sizeof(struct icmp_header));
 
@@ -643,7 +642,6 @@ struct icmp6_header {
     uint8_t icmp6_type;
     uint8_t icmp6_code;
     ovs_be16 icmp6_cksum;
-    uint8_t icmp6_data[0];
 };
 BUILD_ASSERT_DECL(ICMP6_HEADER_LEN == sizeof(struct icmp6_header));
 
-- 
1.7.9.5




More information about the dev mailing list