From: Ben Pfaff Date: Tue, 7 Dec 2010 00:11:55 +0000 (-0800) Subject: ofp-util: Fully initialize flow_wildcards in ofputil_cls_rule_from_match(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ba8dad04b6f1b6c2994b462b13531f6e2f24c4;p=openvswitch 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 --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index cf832b7d..2c525baf 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -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);