enum ofputil_protocol protocol)
{
struct ofpbuf *msg;
+ enum ofp_flow_removed_reason reason = fr->reason;
+
+ if (reason == OFPRR_METER_DELETE && !(protocol & OFPUTIL_P_OF14_UP)) {
+ reason = OFPRR_DELETE;
+ }
switch (protocol) {
case OFPUTIL_P_OF11_STD:
ofr = ofpbuf_put_zeros(msg, sizeof *ofr);
ofr->cookie = fr->cookie;
ofr->priority = htons(fr->priority);
- ofr->reason = fr->reason;
+ ofr->reason = reason;
ofr->table_id = fr->table_id;
ofr->duration_sec = htonl(fr->duration_sec);
ofr->duration_nsec = htonl(fr->duration_nsec);
ofputil_match_to_ofp10_match(&fr->match, &ofr->match);
ofr->cookie = fr->cookie;
ofr->priority = htons(fr->priority);
- ofr->reason = fr->reason;
+ ofr->reason = reason;
ofr->duration_sec = htonl(fr->duration_sec);
ofr->duration_nsec = htonl(fr->duration_nsec);
ofr->idle_timeout = htons(fr->idle_timeout);
nfr = ofpbuf_l3(msg);
nfr->cookie = fr->cookie;
nfr->priority = htons(fr->priority);
- nfr->reason = fr->reason;
+ nfr->reason = reason;
nfr->table_id = fr->table_id + 1;
nfr->duration_sec = htonl(fr->duration_sec);
nfr->duration_nsec = htonl(fr->duration_nsec);