All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: byte order issue in nf_ct_seqadj_set
@ 2013-11-17  4:37 Phil Oester
  2013-11-19 14:36 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2013-11-17  4:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfilter: byte order issue in nf_ct_seqadj_set
  2013-11-17  4:37 [PATCH] netfilter: byte order issue in nf_ct_seqadj_set Phil Oester
@ 2013-11-19 14:36 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-11-19 14:36 UTC (permalink / raw)
  To: Phil Oester; +Cc: netfilter-devel

On Sat, Nov 16, 2013 at 08:37:46PM -0800, Phil Oester wrote:
> 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.

Applied, thanks Phil.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-19 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-17  4:37 [PATCH] netfilter: byte order issue in nf_ct_seqadj_set Phil Oester
2013-11-19 14:36 ` Pablo Neira Ayuso

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.