diff options
Diffstat (limited to 'net/sched/act_nat.c')
-rw-r--r-- | net/sched/act_nat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 570949417f38..724553e8ed7b 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -205,7 +205,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
205 | { | 205 | { |
206 | struct icmphdr *icmph; | 206 | struct icmphdr *icmph; |
207 | 207 | ||
208 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) | 208 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph))) |
209 | goto drop; | 209 | goto drop; |
210 | 210 | ||
211 | icmph = (void *)(skb_network_header(skb) + ihl); | 211 | icmph = (void *)(skb_network_header(skb) + ihl); |
@@ -215,6 +215,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
215 | (icmph->type != ICMP_PARAMETERPROB)) | 215 | (icmph->type != ICMP_PARAMETERPROB)) |
216 | break; | 216 | break; |
217 | 217 | ||
218 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) | ||
219 | goto drop; | ||
220 | |||
218 | iph = (void *)(icmph + 1); | 221 | iph = (void *)(icmph + 1); |
219 | if (egress) | 222 | if (egress) |
220 | addr = iph->daddr; | 223 | addr = iph->daddr; |