From: Justin Pettit
Date: Wed, 21 Oct 2015 05:26:07 +0000 (-0700)
Subject: ovn: Use "ip.ttl--" instead of "ip4.ttl--".
X-Git-Tag: v2.5.0~343
X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=47f3b59b06e10b4d351d559cfd034a9147a07070
ovn: Use "ip.ttl--" instead of "ip4.ttl--".
Signed-off-by: Justin Pettit
Acked-by: Russell Bryant
---
diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c
index ccf97f047..693b1c108 100644
--- a/ovn/lib/actions.c
+++ b/ovn/lib/actions.c
@@ -247,9 +247,9 @@ parse_actions(struct action_context *ctx)
parse_next_action(ctx);
} else if (lexer_match_id(ctx->lexer, "output")) {
emit_resubmit(ctx, ctx->output_ptable);
- } else if (lexer_match_id(ctx->lexer, "ip4.ttl")) {
+ } else if (lexer_match_id(ctx->lexer, "ip.ttl")) {
if (lexer_match(ctx->lexer, LEX_T_DECREMENT)) {
- struct expr *e = expr_parse_string("ip4", ctx->symtab,
+ struct expr *e = expr_parse_string("ip", ctx->symtab,
&ctx->error);
ctx->prereqs = expr_combine(EXPR_T_AND, ctx->prereqs, e);
ofpact_put_DEC_TTL(ctx->ofpacts);
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 4bd1990b5..6f0a420a1 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -338,7 +338,7 @@
ip4.dst = ip4.src;
ip4.src = S;
-ip4.ttl = 255;
+ip.ttl = 255;
icmp4.type = 0;
next;
@@ -460,7 +460,7 @@ output;
ICMP time exceeded. For each router port P, whose IP
address is A, a priority-40 flow with match inport
- == P && ip4.ttl == {0, 1} &&
+ == P && ip.ttl == {0, 1} &&
!ip.later_frag
matches packets whose TTL has expired, with the
following actions to send an ICMP time exceeded reply:
@@ -471,7 +471,7 @@ icmp4 {
icmp4.code = 0; /* TTL exceeded in transit. */
ip4.dst = ip4.src;
ip4.src = A;
- ip4.ttl = 255;
+ ip.ttl = 255;
next;
};
@@ -482,7 +482,7 @@ icmp4 {
- TTL discard. A priority-30 flow with match ip4.ttl == {0,
+ TTL discard. A priority-30 flow with match ip.ttl == {0,
1}
and actions drop;
drops other packets whose TTL
has expired, that should not receive a ICMP error reply (i.e. fragments
with nonzero offset).
@@ -519,13 +519,13 @@ icmp4 {
-ip4.ttl--;
+ip.ttl--;
reg0 = G;
next;
- (Ingress table 1 already verified that ip4.ttl--;
will
+ (Ingress table 1 already verified that ip.ttl--;
will
not yield a TTL exceeded error.)
@@ -549,7 +549,7 @@ icmp4 {
icmp4.code = 0; /* Network unreachable. */
ip4.dst = ip4.src;
ip4.src = A;
- ip4.ttl = 255;
+ ip.ttl = 255;
next(2);
};
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index b196837f1..c7d56fef1 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -1272,7 +1272,7 @@ add_route(struct hmap *lflows, struct ovn_datapath *od,
IP_ARGS(network), IP_ARGS(mask));
struct ds actions = DS_EMPTY_INITIALIZER;
- ds_put_cstr(&actions, "ip4.ttl--; reg0 = ");
+ ds_put_cstr(&actions, "ip.ttl--; reg0 = ");
if (gateway) {
ds_put_format(&actions, IP_FMT, IP_ARGS(gateway));
} else {
diff --git a/tests/ovn.at b/tests/ovn.at
index 3e58ff35b..68fcc9a95 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -459,7 +459,8 @@ reg0 <-> reg1; => actions=push:OXM_OF_PKT_REG0[0..31],push:OXM_OF_PKT_REG0[32..6
vlan.pcp <-> reg0[0..2]; => actions=push:OXM_OF_PKT_REG0[32..34],push:NXM_OF_VLAN_TCI[13..15],pop:OXM_OF_PKT_REG0[32..34],pop:NXM_OF_VLAN_TCI[13..15], prereqs=vlan.tci[12]
reg0[10] <-> vlan.pcp[1]; => actions=push:NXM_OF_VLAN_TCI[14],push:OXM_OF_PKT_REG0[42],pop:NXM_OF_VLAN_TCI[14],pop:OXM_OF_PKT_REG0[42], prereqs=vlan.tci[12]
outport <-> inport; => actions=push:NXM_NX_REG6[],push:NXM_NX_REG7[],pop:NXM_NX_REG6[],pop:NXM_NX_REG7[], prereqs=1
-ip4.ttl--; => actions=dec_ttl, prereqs=ip4
+ip.ttl--; => actions=dec_ttl, prereqs=ip
+ip.ttl = 4; => actions=set_field:4->nw_ttl, prereqs=eth.type == 0x800 || eth.type == 0x86dd
# Contradictionary prerequisites (allowed but not useful):
ip4.src = ip6.src[0..31]; => actions=move:NXM_NX_IPV6_SRC[0..31]->NXM_OF_IP_SRC[], prereqs=eth.type == 0x800 && eth.type == 0x86dd
@@ -504,7 +505,7 @@ inport <-> reg0; => Can't exchange string field (inport) with integer field (reg
inport <-> big_string; => String fields inport and big_string are incompatible for exchange.
ip.proto <-> reg0[0..7]; => Field ip.proto is not modifiable.
reg0[0..7] <-> ip.proto; => Field ip.proto is not modifiable.
-ip4.ttl => Syntax error at end of input expecting `--'.
+ip.ttl => Syntax error at end of input expecting `--'.
]])
sed 's/ =>.*//' test-cases.txt > input.txt
sed 's/.* => //' test-cases.txt > expout