Skip to content

Commit

Permalink
ovn-northd: Only add ARP reply flows for logical ports that are up.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
numansiddique authored and blp committed Jan 11, 2016
1 parent a274c2c commit 4c7bf53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ovn/northd/ovn-northd.8.xml
Expand Up @@ -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>;
Expand All @@ -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>
Expand Down
15 changes: 15 additions & 0 deletions ovn/northd/ovn-northd.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4c7bf53

Please sign in to comment.