[ovs-dev] [PATCH ovn] ovn-northd: Warn for >1 IPv4 in build_lrouter_force_snat_flows_op().

Ben Pfaff blp at ovn.org
Wed Feb 24 23:26:49 UTC 2021


The comments here point out that more than one IPv4 address is a
problem (versus more than 2 IPv6 addresses), but the code doesn't match.

I didn't test this, it's just an observation from reading code and
comments.

Signed-off-by: Ben Pfaff <blp at ovn.org>
CC: Numan Siddique <numans at ovn.org>
Fixes: c6e21a23bd8c ("northd: Provide the Gateway router option 'lb_force_snat_ip' to take router port ips.")
---
 northd/ovn-northd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 85022d36c6ae..ac872aadea3d 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -9164,7 +9164,7 @@ build_lrouter_force_snat_flows_op(struct ovn_port *op,
                       op->lrp_networks.ipv4_addrs[0].addr_s);
         ovn_lflow_add(lflows, op->od, S_ROUTER_OUT_SNAT, 110,
                       ds_cstr(match), ds_cstr(actions));
-        if (op->lrp_networks.n_ipv4_addrs > 2) {
+        if (op->lrp_networks.n_ipv4_addrs > 1) {
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
             VLOG_WARN_RL(&rl, "Logical router port %s is configured with "
                               "multiple IPv4 addresses.  Only the first "
-- 
2.29.2



More information about the dev mailing list