From: Ben Pfaff Date: Fri, 27 Jan 2012 23:38:53 +0000 (-0800) Subject: flow: Add a couple of missing build assertions on FLOW_WC_SEQ. X-Git-Tag: sliver-openvswitch-0.1-1~380 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a79c50f3df6197381c0ad8e91216ba2c5253473d;p=sliver-openvswitch.git flow: Add a couple of missing build assertions on FLOW_WC_SEQ. Every piece of code that may need to change whenever struct flow or struct flow_wildcards changes, but might easily get overlooked, should have a build assertion on the value of FLOW_WC_SEQ, but these functions did not. Signed-off-by: Ben Pfaff --- diff --git a/lib/flow.c b/lib/flow.c index 29714b1ce..dc2bb1cfb 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -699,6 +699,8 @@ flow_wildcards_combine(struct flow_wildcards *dst, { int i; + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 7); + dst->wildcards = src1->wildcards | src2->wildcards; dst->tun_id_mask = src1->tun_id_mask & src2->tun_id_mask; dst->nw_src_mask = src1->nw_src_mask & src2->nw_src_mask; @@ -732,6 +734,8 @@ flow_wildcards_equal(const struct flow_wildcards *a, { int i; + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 7); + if (a->wildcards != b->wildcards || a->tun_id_mask != b->tun_id_mask || a->nw_src_mask != b->nw_src_mask @@ -760,6 +764,8 @@ flow_wildcards_has_extra(const struct flow_wildcards *a, int i; struct in6_addr ipv6_masked; + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 7); + for (i = 0; i < FLOW_N_REGS; i++) { if ((a->reg_masks[i] & b->reg_masks[i]) != b->reg_masks[i]) { return true;