diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-07-29 09:41:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-01 01:04:54 -0400 |
commit | 072d79a31a3b870b49886f4347e23f81b7eca3ac (patch) | |
tree | e007177c6d42e63a610ba0a8a811c0b4b1c0841a /net | |
parent | 6d1d1d398cb7db7a12c5d652d50f85355345234f (diff) |
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')
-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 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, | |||
218 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) | 218 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) |
219 | goto drop; | 219 | goto drop; |
220 | 220 | ||
221 | icmph = (void *)(skb_network_header(skb) + ihl); | ||
221 | iph = (void *)(icmph + 1); | 222 | iph = (void *)(icmph + 1); |
222 | if (egress) | 223 | if (egress) |
223 | addr = iph->daddr; | 224 | addr = iph->daddr; |