On Sat, Jun 29, 2013 at 8:27 AM, Ben Pfaff <b...@nicira.com> wrote:
> @@ -1514,7 +1593,17 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
>
>          /* Translate the message. */
>          fm->priority = ntohs(ofm->priority);
> -        if (ofm->command == OFPFC_ADD) {
> +        if (oh->version == OFP11_VERSION
> +            && (ofm->command == OFPFC_MODIFY ||
> +                ofm->command == OFPFC_MODIFY_STRICT)
> +            && ofm->cookie_mask == htonll(0)) {
> +            /* In OpenFlow 1.1 only, a "modify" or "modify-strict" that does
> +             * not match on the cookie is treated as an "add" if there is no
> +             * match. */
> +            fm->cookie = htonll(0);
> +            fm->cookie_mask = htonll(0);
> +            fm->new_cookie = ofm->cookie;
> +        } else if (ofm->command == OFPFC_ADD) {
>              fm->cookie = htonll(0);
>              fm->cookie_mask = htonll(0);
>              fm->new_cookie = ofm->cookie;

Is this flowmod init code duplicated just to keep the OF1.1 comment
separate? The first two if statements here are combined in the similar
encode_flow_mod() code.

Otherwise, the tests seem to check the OF1.1-specific behaviour, and
they pass, so it looks pretty good to me.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to