All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [PATCH] netfilter: byte order issue in nf_ct_seqadj_set
Date: Sat, 16 Nov 2013 20:37:46 -0800	[thread overview]
Message-ID: <20131117043745.GA12111@home> (raw)

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

In commit 41d73ec053d2, sequence number adjustments were moved to a separate
file.  Unfortunately, a necessary ntohl call was removed when the call to 
adjust_tcp_sequence was collapsed into nf_ct_seqadj_set.  As reported by
Dawid Stawiarsk, this broke the FTP NAT helper.  Add back the byte order
conversions.

Fixes: 41d73ec053d2 ("netfilter: nf_conntrack: make sequence number adjustments usuable without NAT")
Signed-off-by: Phil Oester <kernel@linuxace.com>


[-- Attachment #2: patch-seqadj --]
[-- Type: text/plain, Size: 679 bytes --]

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;
 	}

             reply	other threads:[~2013-11-17  4:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17  4:37 Phil Oester [this message]
2013-11-19 14:36 ` [PATCH] netfilter: byte order issue in nf_ct_seqadj_set Pablo Neira Ayuso

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=20131117043745.GA12111@home \
    --to=kernel@linuxace.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.