ovn-northd: Only add ARP reply flows for logical ports that are up.
authorNuman Siddique <nusiddiq@redhat.com>
Mon, 21 Dec 2015 14:27:16 +0000 (19:57 +0530)
committerBen Pfaff <blp@ovn.org>
Mon, 11 Jan 2016 17:56:43 +0000 (09:56 -0800)
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>
ovn/northd/ovn-northd.8.xml
ovn/northd/ovn-northd.c

index fa7675b..1b2912e 100644 (file)
 
     <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>
index d8e4824..4f03287 100644 (file)
@@ -950,6 +950,12 @@ lport_is_enabled(const struct nbrec_logical_port *lport)
     return !lport->enabled || *lport->enabled;
 }
 
+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)
 {
@@ -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;