summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorNuman Siddique <nusiddiq@redhat.com>2015-12-21 19:57:16 +0530
committerBen Pfaff <blp@ovn.org>2016-01-11 09:56:43 -0800
commit4c7bf534f5ffeae80c31baaf5d73fc1ee5402290 (patch)
tree8ee27f567e6684fedf2867a9e8b6b149dba18641 /ovn
parenta274c2c390498cb78d49d5f08e3412081bb2ee5c (diff)
downloadopenvswitch-4c7bf534f5ffeae80c31baaf5d73fc1ee5402290.tar.gz
ovn-northd: Only add ARP reply flows for logical ports that are up.
Or if the logical port is a router port. Signed-off-by: Numan Siddique <nusiddiq@redhat.com> [blp@ovn.org updated ovn-northd(8)] Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/northd/ovn-northd.8.xml14
-rw-r--r--ovn/northd/ovn-northd.c15
2 files changed, 26 insertions, 3 deletions
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index fa7675b60..1b2912e16 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -204,9 +204,12 @@
<ul>
<li>
- Priority-150 flows that matches ARP requests to each known IP address
- <var>A</var> of logical port <var>P</var>, and respond ARP replies
- directly with corresponding Ethernet address <var>E</var>:
+ <p>
+ Priority-150 flows that matches ARP requests to each known IP address
+ <var>A</var> of logical port <var>P</var>, and respond with ARP
+ replies directly with corresponding Ethernet address <var>E</var>:
+ </p>
+
<pre>
eth.dst = eth.src;
eth.src = <var>E</var>;
@@ -219,6 +222,11 @@ outport = <var>P</var>;
inport = ""; /* Allow sending out inport. */
output;
</pre>
+
+ <p>
+ These flows are omitted for logical ports (other than router ports)
+ that are down.
+ </p>
</li>
<li>
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index d8e482452..4f0328758 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -951,6 +951,12 @@ lport_is_enabled(const struct nbrec_logical_port *lport)
}
static bool
+lport_is_up(const struct nbrec_logical_port *lport)
+{
+ return !lport->up || *lport->up;
+}
+
+static bool
has_stateful_acl(struct ovn_datapath *od)
{
for (size_t i = 0; i < od->nbs->n_acls; i++) {
@@ -1178,6 +1184,15 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
continue;
}
+ /*
+ * Add ARP reply flows if either the
+ * - port is up or
+ * - port type is router
+ */
+ if (!lport_is_up(op->nbs) && strcmp(op->nbs->type, "router")) {
+ continue;
+ }
+
for (size_t i = 0; i < op->nbs->n_addresses; i++) {
struct eth_addr ea;
ovs_be32 ip;