X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmeta-flow.c;h=8b60b35f11ee0368b5b7b129ab618f0cdff508b2;hb=ccbe50f8f61ac944eb965f67c570d79b6724c9cf;hp=c1efbe2c14dd509189d9af45cc969d08fe598459;hpb=e0edde6fee279cdbbf3c179f5f50adaf0c7c7f1e;p=sliver-openvswitch.git diff --git a/lib/meta-flow.c b/lib/meta-flow.c index c1efbe2c1..8b60b35f1 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -1457,6 +1457,19 @@ mf_set_flow_value(const struct mf_field *mf, } } +/* Returns true if 'mf' has a zero value in 'flow', false if it is nonzero. + * + * The caller is responsible for ensuring that 'flow' meets 'mf''s + * prerequisites. */ +bool +mf_is_zero(const struct mf_field *mf, const struct flow *flow) +{ + union mf_value value; + + mf_get_value(mf, flow, &value); + return is_all_zeros((const uint8_t *) &value, mf->n_bytes); +} + /* Makes 'rule' wildcard field 'mf'. * * The caller is responsible for ensuring that 'rule' meets 'mf''s