netfilter: byte order issue in nf_ct_seqadj_set
Subsystems (2)
PATCH 1/1 netfilter: byte order issue in nf_ct_seqadj_set
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 <[email protected]>
net/netfilter/nf_conntrack_seqadj.c +2 -2
@@ -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; }
Quoted 5 lines · Phil Oester
In commit
41d73ec053d2, sequence number adjustments were moved to a separate file. Unfortunately, a necessary ntohl call was removed when the call toadjust_tcp_sequencewas collapsed intonf_ct_seqadj_set. As reported by Dawid Stawiarsk, this broke the FTP NAT helper. Add back the byte order conversions.
Applied, thanks Phil.