diff mbox

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

Message ID 1475717274-30105-1-git-send-email-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 6, 2016, 1:27 a.m. UTC
ip4.dst implies ip, udp.dst implies udp, and tcp.dst implies tcp.

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

Comments

Justin Pettit Oct. 6, 2016, 11:19 p.m. UTC | #1
> On Oct 5, 2016, at 6:27 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> ip4.dst implies ip, udp.dst implies udp, and tcp.dst implies tcp.
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
Ben Pfaff Oct. 7, 2016, 3:50 p.m. UTC | #2
On Thu, Oct 06, 2016 at 04:19:59PM -0700, Justin Pettit wrote:
> 
> > On Oct 5, 2016, at 6:27 PM, Ben Pfaff <blp@ovn.org> wrote:
> > 
> > ip4.dst implies ip, udp.dst implies udp, and tcp.dst implies tcp.
> > 
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks, applied to master.
diff mbox

Patch

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);