[ovs-dev] [PATCH] ovn-northd: Drop redundant matching constraints in build_stateful().

Ben Pfaff blp at ovn.org
Thu Oct 6 01:27:54 UTC 2016


ip4.dst implies ip, udp.dst implies udp, and tcp.dst implies tcp.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 ovn/northd/ovn-northd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 4668d9e..9bb49e8 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2708,12 +2708,12 @@ build_stateful(struct ovn_datapath *od, struct hmap *lflows)
             /* New connections in Ingress table. */
             char *action = xasprintf("ct_lb(%s);", node->value);
             struct ds match = DS_EMPTY_INITIALIZER;
-            ds_put_format(&match, "ct.new && ip && ip4.dst == %s", ip_address);
+            ds_put_format(&match, "ct.new && ip4.dst == %s", ip_address);
             if (port) {
                 if (lb->protocol && !strcmp(lb->protocol, "udp")) {
-                    ds_put_format(&match, " && udp && udp.dst == %d", port);
+                    ds_put_format(&match, " && udp.dst == %d", port);
                 } else {
-                    ds_put_format(&match, " && tcp && tcp.dst == %d", port);
+                    ds_put_format(&match, " && tcp.dst == %d", port);
                 }
                 ovn_lflow_add(lflows, od, S_SWITCH_IN_STATEFUL,
                               120, ds_cstr(&match), action);
-- 
2.1.3




More information about the dev mailing list