[ovs-dev] [ofp-print 04/15] ofproto: Always use xid 0 for *_FLOW_REMOVED messages.

Justin Pettit jpettit at nicira.com
Tue Dec 14 22:11:29 UTC 2010


Looks good.

--Justin


On Dec 14, 2010, at 12:23 PM, Ben Pfaff wrote:

> 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.
> ---
> ofproto/ofproto.c |    6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 5fef092..2435690 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);
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list