From a79c50f3df6197381c0ad8e91216ba2c5253473d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 27 Jan 2012 15:38:53 -0800 Subject: [PATCH] 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 --- lib/flow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/flow.c b/lib/flow.c index 29714b1c..dc2bb1cf 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; -- 2.30.2