diff --git a/include/ovn/actions.h b/include/ovn/actions.h index 6691116b7e0..1d7bd69e813 100644 --- a/include/ovn/actions.h +++ b/include/ovn/actions.h @@ -60,6 +60,7 @@ struct simap; OVNACT(CT_DNAT, ovnact_ct_nat) \ OVNACT(CT_SNAT, ovnact_ct_nat) \ OVNACT(CT_LB, ovnact_ct_lb) \ + OVNACT(CT_CLEAR, ovnact_null) \ OVNACT(CLONE, ovnact_nest) \ OVNACT(ARP, ovnact_nest) \ OVNACT(ND_NA, ovnact_nest) \ diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c index 186552f1011..90a2addbe88 100644 --- a/ovn/lib/actions.c +++ b/ovn/lib/actions.c @@ -1056,6 +1056,20 @@ ovnact_ct_lb_free(struct ovnact_ct_lb *ct_lb) free(ct_lb->dsts); } +static void +format_CT_CLEAR(const struct ovnact_null *null OVS_UNUSED, struct ds *s) +{ + ds_put_cstr(s, "ct_clear;"); +} + +static void +encode_CT_CLEAR(const struct ovnact_null *null OVS_UNUSED, + const struct ovnact_encode_params *ep OVS_UNUSED, + struct ofpbuf *ofpacts) +{ + ofpact_put_CT_CLEAR(ofpacts); +} + /* Implements the "arp", "nd_na", and "clone" actions, which execute nested * actions on a packet derived from the one being processed. */ static void @@ -1750,6 +1764,8 @@ parse_action(struct action_context *ctx) parse_CT_SNAT(ctx); } else if (lexer_match_id(ctx->lexer, "ct_lb")) { parse_ct_lb_action(ctx); + } else if (lexer_match_id(ctx->lexer, "ct_clear")) { + ovnact_put_CT_CLEAR(ctx->ovnacts); } else if (lexer_match_id(ctx->lexer, "clone")) { parse_CLONE(ctx); } else if (lexer_match_id(ctx->lexer, "arp")) { diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index 6171f9d12f3..f806af72daf 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -1143,6 +1143,10 @@
+ct_clear;
clone { action;
... };