From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 4/7] netfilter: fix wrong byte order in nf_ct_seqadj_set internal information
Date: Thu, 21 Nov 2013 10:05:25 +0100 [thread overview]
Message-ID: <1385024728-4057-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1385024728-4057-1-git-send-email-pablo@netfilter.org>
From: Phil Oester <kernel@linuxace.com>
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>
---
net/netfilter/nf_conntrack_seqadj.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index 5f9bfd0..17c1bcb 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;
}
--
1.7.10.4
next prev parent reply other threads:[~2013-11-21 9:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 9:05 [PATCH 0/7] netfilter fixes for net Pablo Neira Ayuso
2013-11-21 9:05 ` [PATCH 1/7] netfilter: fix connlimit Kconfig prompt string Pablo Neira Ayuso
2013-11-21 9:05 ` [PATCH 2/7] netfilter: synproxy: send mss option to backend Pablo Neira Ayuso
2013-11-21 9:05 ` [PATCH 3/7] netfilter: synproxy: correct wscale option passing Pablo Neira Ayuso
2013-11-22 17:19 ` Sergei Shtylyov
2013-11-21 9:05 ` Pablo Neira Ayuso [this message]
2013-11-22 17:16 ` [PATCH 4/7] netfilter: fix wrong byte order in nf_ct_seqadj_set internal information Sergei Shtylyov
2013-11-21 9:05 ` [PATCH 5/7] netfilter: nft_compat: fix error path in nft_parse_compat() Pablo Neira Ayuso
2013-11-21 9:05 ` [PATCH 6/7] netfilter: nf_conntrack: decrement global counter after object release Pablo Neira Ayuso
2013-11-21 9:05 ` [PATCH 7/7] netfilter: ebt_ip6: fix source and destination matching Pablo Neira Ayuso
2013-11-21 17:45 ` [PATCH 0/7] netfilter fixes for net David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385024728-4057-5-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).