summaryrefslogtreecommitdiffstats
path: root/net/sched/act_nat.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-29 13:41:46 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-31 22:04:54 -0700
commit072d79a31a3b870b49886f4347e23f81b7eca3ac (patch)
treee007177c6d42e63a610ba0a8a811c0b4b1c0841a /net/sched/act_nat.c
parent6d1d1d398cb7db7a12c5d652d50f85355345234f (diff)
downloadlinux-072d79a31a3b870b49886f4347e23f81b7eca3ac.tar.bz2
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/act_nat.c')
-rw-r--r--net/sched/act_nat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 724553e8ed7b..ea008f57fc83 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;