Skip to content

Commit

Permalink
ovn-northd: Ability to loop-back in a router.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
  • Loading branch information
shettyg committed Jun 15, 2016
1 parent d15ad7c commit f961026
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ovn/northd/ovn-northd.c
Expand Up @@ -2278,6 +2278,16 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_INPUT, 60,
match, "drop;");
free(match);

/* When destination IP address is in the same subnet as the
* router port, the packet may need to be eventually sent
* back the same port. For cases like that, allow sending
* out the inport. */
match = xasprintf("ip4.dst == "IP_FMT"/"IP_FMT,
IP_ARGS(op->network), IP_ARGS(op->mask));
ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_INPUT, 20,
match, "inport = \"\"; next;");
free(match);
}

/* NAT in Gateway routers. */
Expand Down

0 comments on commit f961026

Please sign in to comment.