2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofp-util: Fully initialize flow_wildcards in ofputil_cls_rule_from_match().

The new 'zero' member was not being properly initialized.  One approach
would be to add an assignment, but it seems more future-proof to let
flow_wildcards_init_catchall() do the right thing.

Noticed by valgrind.

Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
Ben Pfaff
2010-12-06 16:11:55 -08:00
parent 06448753e2
commit f9ba8dad04

View File

@@ -117,11 +117,11 @@ ofputil_cls_rule_from_match(const struct ofp_match *match,
rule->priority = !ofpfw ? UINT16_MAX : priority;
/* Initialize most of rule->wc. */
flow_wildcards_init_catchall(wc);
wc->wildcards = ofpfw & WC_INVARIANTS;
if (ofpfw & OFPFW_NW_TOS) {
wc->wildcards |= FWW_NW_TOS;
}
memset(wc->reg_masks, 0, sizeof wc->reg_masks);
wc->nw_src_mask = ofputil_wcbits_to_netmask(ofpfw >> OFPFW_NW_SRC_SHIFT);
wc->nw_dst_mask = ofputil_wcbits_to_netmask(ofpfw >> OFPFW_NW_DST_SHIFT);