oao->max_len = htons(output->max_len);
}
+static void
+ofpact_dec_ttl_to_openflow11(const struct ofpact_cnt_ids *dec_ttl,
+ struct ofpbuf *out)
+{
+ if (dec_ttl->n_controllers == 1 && dec_ttl->cnt_ids[0] == 0
+ && (!dec_ttl->ofpact.compat ||
+ dec_ttl->ofpact.compat == OFPUTIL_OFPAT11_DEC_NW_TTL)) {
+ ofputil_put_OFPAT11_DEC_NW_TTL(out);
+ } else {
+ ofpact_dec_ttl_to_nxast(dec_ttl, out);
+ }
+}
+
static void
ofpact_to_openflow11(const struct ofpact *a, struct ofpbuf *out)
{
break;
case OFPACT_DEC_TTL:
- if (a->compat == OFPUTIL_OFPAT11_DEC_NW_TTL) {
- ofputil_put_OFPAT11_DEC_NW_TTL(out);
- } else {
- ofpact_to_nxast(a, out);
- }
+ ofpact_dec_ttl_to_openflow11(ofpact_get_DEC_TTL(a), out);
break;
case OFPACT_CLEAR_ACTIONS:
}
static void
-parse_noargs_dec_ttl(struct ofpbuf *b, enum ofputil_action_code compat)
+parse_noargs_dec_ttl(struct ofpbuf *b)
{
struct ofpact_cnt_ids *ids;
uint16_t id = 0;
ids = ofpact_put_DEC_TTL(b);
- ids->ofpact.compat = compat;
ofpbuf_put(b, &id, sizeof id);
ids = b->l2;
ids->n_controllers++;
}
static void
-parse_dec_ttl(struct ofpbuf *b, char *arg, enum ofputil_action_code compat)
+parse_dec_ttl(struct ofpbuf *b, char *arg)
{
if (*arg == '\0') {
- parse_noargs_dec_ttl(b, compat);
+ parse_noargs_dec_ttl(b);
} else {
struct ofpact_cnt_ids *ids;
char *cntr;
break;
case OFPUTIL_NXAST_DEC_TTL:
- parse_dec_ttl(ofpacts, arg, code);
+ parse_dec_ttl(ofpacts, arg);
break;
case OFPUTIL_NXAST_FIN_TIMEOUT: