[ovs-dev] [PATCH v2 2/3] ofp-actions: Check that 'alg=ftp' matches on TCP.

Jarno Rajahalme jarno at ovn.org
Tue Sep 27 21:32:07 UTC 2016


Datapath flow setup fails when setting the FTP helper on an
unsupported IP protocol.  It is better to fail at the OpenFlow rule
set-up time instead.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
---
 lib/ofp-actions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 6fea508..f896f98 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -7031,7 +7031,8 @@ ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a,
         struct ofpact_conntrack *oc = ofpact_get_CT(a);
 
         if (!dl_type_is_ip_any(flow->dl_type)
-            || (flow->ct_state & CS_INVALID && oc->flags & NX_CT_F_COMMIT)) {
+            || (flow->ct_state & CS_INVALID && oc->flags & NX_CT_F_COMMIT)
+            || (oc->alg == IPPORT_FTP && flow->nw_proto != IPPROTO_TCP)) {
             inconsistent_match(usable_protocols);
         }
 
-- 
2.1.4




More information about the dev mailing list