]> git.proxmox.com Git - mirror_ovs.git/commitdiff
conntrack: Remove unnecessary check in process_ftp_ctl_v4
authorLi RongQing <lirongqing@baidu.com>
Mon, 11 Feb 2019 02:52:54 +0000 (10:52 +0800)
committerBen Pfaff <blp@ovn.org>
Tue, 12 Feb 2019 01:55:32 +0000 (17:55 -0800)
It has been assured that both first and second int from ftp
command are not bigger than 255, so their combination(first
int << 8 +second int) must not bigger than 65535

Co-authored-by: Wang Li <wangli39@baidu.com>
Signed-off-by: Wang Li <wangli39@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Cc: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/conntrack.c

index 6b46d0ca3893132ea67bcf7bc4808ab4125cb259..315a19e9e3f4e9ce6476914e5c0740fe0e1e2778 100644 (file)
@@ -2997,12 +2997,7 @@ process_ftp_ctl_v4(struct conntrack *ct,
         return CT_FTP_CTL_INVALID;
     }
 
-    uint16_t port_lo_hs = value;
-    if (65535 - port_hs < port_lo_hs) {
-        return CT_FTP_CTL_INVALID;
-    }
-
-    port_hs |= port_lo_hs;
+    port_hs |= value;
     ovs_be16 port = htons(port_hs);
     ovs_be32 conn_ipv4_addr;