> On Jun 3, 2015, at 8:16 PM, 林清祥 <[email protected]> wrote: > > I am reading openflow-spec-v1.3.0, and in page 37 there are a few codes as > follow: > >> /* Full description for a queue. */ >> struct ofp_packet_queue { >> uint32_t queue_id; >> /* id for the specific queue. */ >> uint32_t port; >> /* Port this queue is attached to. */ >> uint16_t len; >> /* Length in bytes of this queue desc. */ >> uint8_t pad[6]; >> /* 64-bit alignment. */ >> struct ofp_queue_prop_header properties[0]; /* List of properties. */ >> }; >> OFP_ASSERT(sizeof(struct ofp_packet_queue) == 16); > > In my opinion, sizeof(struct ofp_packet_queue) = sizeof(queue_id) + > sizeof(port) + sizeof(len) + sizeof(pad[]) + sizeof(properties) = 4 + 4 + 2 + > 6 + 4 = 20 > > But the ASSERT is sizeof(struct ofp_packet_queue) == 16. > > Is there anyone can point out my misunderstanding?
The "properties" element has zero elements, which has no length. --Justin
_______________________________________________ discuss mailing list [email protected] http://openvswitch.org/mailman/listinfo/discuss
