Skip to content

Commit 7bcbf81

Browse files
Julian Anastasovdavem330
authored andcommitted
ipvs: avoid oops for passive FTP
Fix Passive FTP problem in ip_vs_ftp: - Do not oops in nf_nat_set_seq_adjust (adjust_tcp_sequence) when iptable_nat module is not loaded Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5e4e757 commit 7bcbf81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/ipvs/ip_vs_ftp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <linux/netfilter.h>
4646
#include <net/netfilter/nf_conntrack.h>
4747
#include <net/netfilter/nf_conntrack_expect.h>
48+
#include <net/netfilter/nf_nat.h>
4849
#include <net/netfilter/nf_nat_helper.h>
4950
#include <linux/gfp.h>
5051
#include <net/protocol.h>
@@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
359360
buf_len = strlen(buf);
360361

361362
ct = nf_ct_get(skb, &ctinfo);
362-
if (ct && !nf_ct_is_untracked(ct)) {
363+
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
363364
/* If mangling fails this function will return 0
364365
* which will cause the packet to be dropped.
365366
* Mangling can only fail under memory pressure,

0 commit comments

Comments
 (0)