summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_nat_helper.c
diff options
context:
space:
mode:
authorPatrick McHardy2013-07-28 22:54:10 +0200
committerPablo Neira Ayuso2013-07-31 19:54:51 +0200
commit2d89c68ac78ae432038ef23371d2fa949d725d43 (patch)
tree9eb19fc7550976ff633849e95c752a34f19df4f2 /net/netfilter/nf_nat_helper.c
parentnetfilter: nf_nat: fix locking in nf_nat_seq_adjust() (diff)
downloadkernel-qcow2-linux-2d89c68ac78ae432038ef23371d2fa949d725d43.tar.gz
kernel-qcow2-linux-2d89c68ac78ae432038ef23371d2fa949d725d43.tar.xz
kernel-qcow2-linux-2d89c68ac78ae432038ef23371d2fa949d725d43.zip
netfilter: nf_nat: change sequence number adjustments to 32 bits
Using 16 bits is too small, when many adjustments happen the offsets might overflow and break the connection. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_nat_helper.c')
-rw-r--r--net/netfilter/nf_nat_helper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/nf_nat_helper.c b/net/netfilter/nf_nat_helper.c
index a7262ed055c6..ff4a589e3e39 100644
--- a/net/netfilter/nf_nat_helper.c
+++ b/net/netfilter/nf_nat_helper.c
@@ -68,13 +68,13 @@ adjust_tcp_sequence(u32 seq,
}
/* Get the offset value, for conntrack */
-s16 nf_nat_get_offset(const struct nf_conn *ct,
+s32 nf_nat_get_offset(const struct nf_conn *ct,
enum ip_conntrack_dir dir,
u32 seq)
{
struct nf_conn_nat *nat = nfct_nat(ct);
struct nf_nat_seq *this_way;
- s16 offset;
+ s32 offset;
if (!nat)
return 0;
@@ -143,7 +143,7 @@ static int enlarge_skb(struct sk_buff *skb, unsigned int extra)
}
void nf_nat_set_seq_adjust(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
- __be32 seq, s16 off)
+ __be32 seq, s32 off)
{
if (!off)
return;
@@ -370,7 +370,7 @@ nf_nat_seq_adjust(struct sk_buff *skb,
struct tcphdr *tcph;
int dir;
__be32 newseq, newack;
- s16 seqoff, ackoff;
+ s32 seqoff, ackoff;
struct nf_conn_nat *nat = nfct_nat(ct);
struct nf_nat_seq *this_way, *other_way;
int res;