Skip to content

Commit

Permalink
ovn-northd: no logical router icmp response for directed broadcasts
Browse files Browse the repository at this point in the history
Responding to icmp queries where the L3 destination is a directed broadcast
was not being properly handled, causing the reply to be sent to all logical
ports except for the one port that should receive it.

This is a proposal for using choice B in the mail discussion; where icmp
queries to broadcast are simply not responded by the logical router.

Reported-at: http://openvswitch.org/pipermail/discuss/2016-June/021610.html
Signed-off-by: Flavio Fernandes <[email protected]>
Signed-off-by: Justin Pettit <[email protected]>
  • Loading branch information
flavio-fernandes authored and justinpettit committed Jun 23, 2016
1 parent c47cb7e commit e9bc5de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
23 changes: 9 additions & 14 deletions ovn/northd/ovn-northd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,15 @@ output;
<li>
<p>
ICMP echo reply. These flows reply to ICMP echo requests received
for the router's IP address. Let <var>A</var> be an IP address or
broadcast address owned by a router port. Then, for each
<var>A</var>, a priority-90 flow matches on <code>ip4.dst ==
<var>A</var></code> and <code>icmp4.type == 8 &amp;&amp; icmp4.code
== 0</code> (ICMP echo request). These flows use the following
actions where, if <var>A</var> is unicast, then <var>S</var> is
<var>A</var>, and if <var>A</var> is broadcast, <var>S</var> is the
router's IP address in <var>A</var>'s network:
for the router's IP address. Let <var>A</var> be an IP address
owned by a router port. Then, for each <var>A</var>, a priority-90
flow matches on <code>ip4.dst == <var>A</var></code> and <code>
icmp4.type == 8 &amp;&amp; icmp4.code == 0</code> (ICMP echo
request). The port of the router that receives the echo request
does not matter. Also, the ip.ttl of the echo request packet is not
checked, so it complies with RFC 1812, section 4.2.2.9. These flows
use the following actions where <var>S</var> is the router's IP
address:
</p>

<pre>
Expand All @@ -507,12 +508,6 @@ icmp4.type = 0;
inport = ""; /* Allow sending out inport. */
next;
</pre>

<p>
Similar flows match on <code>ip4.dst == 255.255.255.255</code> and
each individual <code>inport</code>, and use the same actions in
which <var>S</var> is a function of <code>inport</code>.
</p>
</li>

<li>
Expand Down
5 changes: 2 additions & 3 deletions ovn/northd/ovn-northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1960,9 +1960,8 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
* (i.e. the incoming locally attached net) does not matter.
* The ip.ttl also does not matter (RFC1812 section 4.2.2.9) */
match = xasprintf(
"(ip4.dst == "IP_FMT" || ip4.dst == "IP_FMT") && "
"icmp4.type == 8 && icmp4.code == 0",
IP_ARGS(op->ip), IP_ARGS(op->bcast));
"ip4.dst == "IP_FMT" && icmp4.type == 8 && icmp4.code == 0",
IP_ARGS(op->ip));
char *actions = xasprintf(
"ip4.dst = ip4.src; "
"ip4.src = "IP_FMT"; "
Expand Down

0 comments on commit e9bc5de

Please sign in to comment.