old mode 100644
new mode 100755
@@ -2490,6 +2490,15 @@ op_put_networks(struct ds *ds, const struct ovn_port *op, bool add_bcast)
ds_put_cstr(ds, "}");
}
+static bool has_ip(ovs_be32 *ips, size_t size, ovs_be32 ip){
+ for (int i = 0; i < size; i++) {
+ if (ip == ips[i]) {
+ return true;
+ }
+ }
+ return false;
+}
+
static void
build_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
struct hmap *lflows)
@@ -2689,11 +2698,8 @@ 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++) {
- 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;
- }
+ if(has_ip(snat_ips, n_snat_ips, op->lrp_networks.ipv4_addrs[i].addr)){
+ continue;
}
ds_put_format(&match, "%s, ",
op->lrp_networks.ipv4_addrs[i].addr_s);
The lrouter drop the traffic to it's own port IPs unless the IPs are configured for SNAT. Now these flows are still built. Signed-off-by: Dongjun <dongj@dtdream.com> --- ovn/northd/ovn-northd.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) mode change 100644 => 100755 ovn/northd/ovn-northd.c