From 4c7bf534f5ffeae80c31baaf5d73fc1ee5402290 Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Mon, 21 Dec 2015 19:57:16 +0530 Subject: [PATCH] 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 [blp@ovn.org updated ovn-northd(8)] Signed-off-by: Ben Pfaff --- ovn/northd/ovn-northd.8.xml | 14 +++++++++++--- ovn/northd/ovn-northd.c | 15 +++++++++++++++ 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 @@
  • - Priority-150 flows that matches ARP requests to each known IP address - A of logical port P, and respond ARP replies - directly with corresponding Ethernet address E: +

    + Priority-150 flows that matches ARP requests to each known IP address + A of logical port P, and respond with ARP + replies directly with corresponding Ethernet address E: +

    +
     eth.dst = eth.src;
     eth.src = E;
    @@ -219,6 +222,11 @@ outport = P;
     inport = ""; /* Allow sending out inport. */
     output;
             
    + +

    + These flows are omitted for logical ports (other than router ports) + that are down. +

  • 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 @@ -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; -- 2.20.1