Skip to content

Commit

Permalink
packets: Do not use zero sized array in icmp header.
Browse files Browse the repository at this point in the history
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 e60e935 (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@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
shettyg committed Jan 16, 2015
1 parent 6bb81d0 commit 233c7ef
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/packets.h
Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 233c7ef

Please sign in to comment.