summaryrefslogtreecommitdiff
path: root/ovn/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-10-18 12:45:57 -0700
committerBen Pfaff <blp@nicira.com>2015-10-19 08:46:18 -0700
commitb49708371ed6e8d131958e3d602d49072db59bc1 (patch)
tree042d53921fd3af3dac85ca52a2d188f2ef63e095 /ovn/lib
parent667e2b0b745436165889664cb78cc96c4c534d1c (diff)
downloadopenvswitch-b49708371ed6e8d131958e3d602d49072db59bc1.tar.gz
ovn: Implement the ability to send a packet back out its input port.
Otherwise logical router ARP replies won't work as implemented. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'ovn/lib')
-rw-r--r--ovn/lib/expr.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c
index 8a69e3e6a..f30500e89 100644
--- a/ovn/lib/expr.c
+++ b/ovn/lib/expr.c
@@ -19,6 +19,7 @@
#include "dynamic-string.h"
#include "json.h"
#include "lex.h"
+#include "logical-fields.h"
#include "match.h"
#include "ofp-actions.h"
#include "shash.h"
@@ -2810,8 +2811,17 @@ parse_assignment(struct expr_context *ctx, const struct simap *ports,
uint32_t port = simap_get(ports, c->string);
bitwise_put(port, &sf->value,
sf->field->n_bytes, 0, sf->field->n_bits);
- bitwise_put(UINT64_MAX, &sf->mask,
- sf->field->n_bytes, 0, sf->field->n_bits);
+ bitwise_one(&sf->mask, sf->field->n_bytes, 0, sf->field->n_bits);
+
+ /* If the logical input port is being zeroed, clear the OpenFlow
+ * ingress port also, to allow a packet to be sent back to its
+ * origin. */
+ if (!port && sf->field->id == MFF_LOG_INPORT) {
+ sf = ofpact_put_SET_FIELD(ofpacts);
+ sf->field = mf_from_id(MFF_IN_PORT);
+ bitwise_one(&sf->mask,
+ sf->field->n_bytes, 0, sf->field->n_bits);
+ }
}
exit_destroy_cs: