diff options
author | Li RongQing <lirongqing@baidu.com> | 2019-02-11 10:52:54 +0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-11 17:55:32 -0800 |
commit | 78a0b2721fc8a3664d99380d55a43638847a9c8f (patch) | |
tree | 18aa309ad93e68e51d43f664bbcf306c70600609 /lib | |
parent | 175b9a6401da76994bac955ebc9f440634e63d55 (diff) | |
download | openvswitch-78a0b2721fc8a3664d99380d55a43638847a9c8f.tar.gz |
conntrack: Remove unnecessary check in process_ftp_ctl_v4
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/conntrack.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c index 6b46d0ca3..315a19e9e 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -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; |