]> git.proxmox.com Git - ovs.git/commitdiff
ovn: Allow SNAT traffic destined to router ip.
authorChandra Sekhar Vejendla <csvejend@us.ibm.com>
Thu, 28 Jul 2016 04:34:06 +0000 (21:34 -0700)
committerGurucharan Shetty <guru@ovn.org>
Thu, 28 Jul 2016 14:44:38 +0000 (07:44 -0700)
When router ip is used as SNAT IP, traffic destined to router
ip should not be dropped.

Fixes: 4685e523695c ("ovn: Support multiple addresses on a single logical
router port.")
Signed-off-by: Chandra Sekhar Vejendla <csvejend@us.ibm.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
ovn/northd/ovn-northd.c

index 716f1232f0cdd722adfdfabcaae37e05502e9f36..3047b762fea8570054e7c5c2977897ed8b7ca56b 100644 (file)
@@ -2689,12 +2689,17 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
         ds_put_cstr(&match, "ip4.dst == {");
         bool has_drop_ips = false;
         for (int i = 0; i < op->lrp_networks.n_ipv4_addrs; i++) {
+            bool snat_ip_is_router_ip = false;
             for (int j = 0; j < n_snat_ips; j++) {
                 /* Packets to SNAT IPs should not be dropped. */
                 if (op->lrp_networks.ipv4_addrs[i].addr == snat_ips[j]) {
-                    continue;
+                    snat_ip_is_router_ip = true;
+                    break;
                 }
             }
+            if (snat_ip_is_router_ip) {
+                continue;
+            }
             ds_put_format(&match, "%s, ",
                           op->lrp_networks.ipv4_addrs[i].addr_s);
             has_drop_ips = true;