From: Ben Pfaff Date: Tue, 14 Dec 2010 00:25:53 +0000 (-0800) Subject: ofproto: Always use xid 0 for *_FLOW_REMOVED messages. X-Git-Tag: v1.1.0~613 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0224fbde1b8de20652a4474fedefa6f270b3344b;p=sliver-openvswitch.git ofproto: Always use xid 0 for *_FLOW_REMOVED messages. Asynchronous messages are never part of a request/reply pair so it doesn't make sense to allocate a xid, which could confuse the controller anyhow. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 5fef09226..243569077 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -4678,7 +4678,7 @@ compose_ofp_flow_removed(struct ofconn *ofconn, const struct rule *rule, struct ofp_flow_removed *ofr; struct ofpbuf *buf; - ofr = make_openflow(sizeof *ofr, OFPT_FLOW_REMOVED, &buf); + ofr = make_openflow_xid(sizeof *ofr, OFPT_FLOW_REMOVED, htonl(0), &buf); ofputil_cls_rule_to_match(&rule->cr, ofconn->flow_format, &ofr->match, rule->flow_cookie, &ofr->cookie); ofr->priority = htons(rule->cr.priority); @@ -4698,9 +4698,9 @@ compose_nx_flow_removed(const struct rule *rule, uint8_t reason) struct ofpbuf *buf; int match_len; - make_nxmsg(sizeof *nfr, NXT_FLOW_REMOVED, &buf); - + make_nxmsg_xid(sizeof *nfr, NXT_FLOW_REMOVED, htonl(0), &buf); match_len = nx_put_match(buf, &rule->cr); + nfr = buf->data; nfr->cookie = rule->flow_cookie; nfr->priority = htons(rule->cr.priority);