diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-07-29 13:41:46 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-31 22:04:54 -0700 |
commit | 072d79a31a3b870b49886f4347e23f81b7eca3ac (patch) | |
tree | e007177c6d42e63a610ba0a8a811c0b4b1c0841a /net/sched | |
parent | 6d1d1d398cb7db7a12c5d652d50f85355345234f (diff) | |
download | op-kernel-dev-072d79a31a3b870b49886f4347e23f81b7eca3ac.zip op-kernel-dev-072d79a31a3b870b49886f4347e23f81b7eca3ac.tar.gz |
act_nat: fix wild pointer
pskb_may_pull() may change skb pointers, so adjust icmph after pskb_may_pull().
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_nat.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 724553e..ea008f5 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c @@ -218,6 +218,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) goto drop; + icmph = (void *)(skb_network_header(skb) + ihl); iph = (void *)(icmph + 1); if (egress) addr = iph->daddr; |