case NX_LEARN_DST_OUTPUT:
if (spec->n_bits <= 16
|| is_all_zeros(value.u8, sizeof value - 2)) {
- ofp_port_t port = u16_to_ofp(ntohs(value.be16[7]));
+ ovs_be16 *last_be16 = &value.be16[ARRAY_SIZE(value.be16) - 1];
+ ofp_port_t port = u16_to_ofp(ntohs(*last_be16));
if (ofp_to_u16(port) < ofp_to_u16(OFPP_MAX)
|| port == OFPP_IN_PORT
}
s = arrow;
} else {
- imm.be64[1] = htonll(strtoull(s, (char **) &s, 0));
+ ovs_be64 *last_be64 = &imm.be64[ARRAY_SIZE(imm.be64) - 1];
+ *last_be64 = htonll(strtoull(s, (char **) &s, 0));
}
if (strncmp(s, "->", 2)) {
};
BUILD_ASSERT_DECL(sizeof(union mf_value) == 16);
+/* An all-1-bits mf_value. Needs to be updated if struct mf_value grows.*/
#define MF_EXACT_MASK_INITIALIZER { IN6ADDR_EXACT_INIT }
+BUILD_ASSERT_DECL(sizeof(union mf_value) == sizeof(struct in6_addr));
/* Part of a field. */
struct mf_subfield {