[ovs-dev] [PATCH v3] ovn: Allow SNAT traffic destined to router ip

Guru Shetty guru at ovn.org
Thu Jul 28 14:47:07 UTC 2016


On 18 July 2016 at 09:57, Chandra S Vejendla <csvejend at us.ibm.com> wrote:

> 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 at us.ibm.com>
>

I applied this as we do have a test provided by Dongjun and fixes a bug.
But that is a system test case. Do consider providing non-system unit test.


> ---
>  ovn/northd/ovn-northd.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> index 7ce509d..78c3a7d 100644
> --- a/ovn/northd/ovn-northd.c
> +++ b/ovn/northd/ovn-northd.c
> @@ -2399,11 +2399,16 @@ 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 nat_ip_is_router_ip = false;
>              for (int j = 0; j < n_nat_ips; j++) {
>                  if (op->lrp_networks.ipv4_addrs[i].addr == nat_ips[j]) {
> -                    continue;
> +                    nat_ip_is_router_ip = true;
> +                    break;
>                  }
>              }
> +            if (nat_ip_is_router_ip) {
> +                continue;
> +            }
>              ds_put_format(&match, "%s, ",
>                            op->lrp_networks.ipv4_addrs[i].addr_s);
>              has_drop_ips = true;
> --
> 2.6.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list