aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Oester <kernel@linuxace.com>2013-11-16 20:37:46 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-15 15:31:43 -0800
commitf1b9e32a923e2d6991e8a5f21cb8a390b158ddbb (patch)
tree0ea3f385f34d677c30ec0ad8d6a01e10957b55df
parent040b47c80e0d3bca9db9353fe44ca044c273624a (diff)
netfilter: fix wrong byte order in nf_ct_seqadj_set internal information
commit 23dfe136e2bf8d9ea1095704c535368a9bc721da upstream. In commit 41d73ec053d2, sequence number adjustments were moved to a separate file. Unfortunately, the sequence numbers that are stored in the nf_ct_seqadj structure are expressed in host byte order. The necessary ntohl call was removed when the call to adjust_tcp_sequence was collapsed into nf_ct_seqadj_set. This broke the FTP NAT helper. Fix it by adding back the byte order conversions. Reported-by: Dawid Stawiarski <dawid.stawiarski@netart.pl> Signed-off-by: Phil Oester <kernel@linuxace.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/netfilter/nf_conntrack_seqadj.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index 5f9bfd060de..17c1bcb182c 100644
--- a/net/netfilter/nf_conntrack_seqadj.c
+++ b/net/netfilter/nf_conntrack_seqadj.c
@@ -41,8 +41,8 @@ int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
spin_lock_bh(&ct->lock);
this_way = &seqadj->seq[dir];
if (this_way->offset_before == this_way->offset_after ||
- before(this_way->correction_pos, seq)) {
- this_way->correction_pos = seq;
+ before(this_way->correction_pos, ntohl(seq))) {
+ this_way->correction_pos = ntohl(seq);
this_way->offset_before = this_way->offset_after;
this_way->offset_after += off;
}