diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 8e0f569b883e..ff3ec9822e36 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -277,8 +277,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
277 | { | 277 | { |
278 | struct inet6_dev *idev = NULL; | 278 | struct inet6_dev *idev = NULL; |
279 | struct ipv6hdr *hdr = skb->nh.ipv6h; | 279 | struct ipv6hdr *hdr = skb->nh.ipv6h; |
280 | struct sock *sk = icmpv6_socket->sk; | 280 | struct sock *sk; |
281 | struct ipv6_pinfo *np = inet6_sk(sk); | 281 | struct ipv6_pinfo *np; |
282 | struct in6_addr *saddr = NULL; | 282 | struct in6_addr *saddr = NULL; |
283 | struct dst_entry *dst; | 283 | struct dst_entry *dst; |
284 | struct icmp6hdr tmp_hdr; | 284 | struct icmp6hdr tmp_hdr; |
@@ -358,6 +358,9 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
358 | if (icmpv6_xmit_lock()) | 358 | if (icmpv6_xmit_lock()) |
359 | return; | 359 | return; |
360 | 360 | ||
361 | sk = icmpv6_socket->sk; | ||
362 | np = inet6_sk(sk); | ||
363 | |||
361 | if (!icmpv6_xrlim_allow(sk, type, &fl)) | 364 | if (!icmpv6_xrlim_allow(sk, type, &fl)) |
362 | goto out; | 365 | goto out; |
363 | 366 | ||
@@ -423,9 +426,9 @@ out: | |||
423 | 426 | ||
424 | static void icmpv6_echo_reply(struct sk_buff *skb) | 427 | static void icmpv6_echo_reply(struct sk_buff *skb) |
425 | { | 428 | { |
426 | struct sock *sk = icmpv6_socket->sk; | 429 | struct sock *sk; |
427 | struct inet6_dev *idev; | 430 | struct inet6_dev *idev; |
428 | struct ipv6_pinfo *np = inet6_sk(sk); | 431 | struct ipv6_pinfo *np; |
429 | struct in6_addr *saddr = NULL; | 432 | struct in6_addr *saddr = NULL; |
430 | struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; | 433 | struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; |
431 | struct icmp6hdr tmp_hdr; | 434 | struct icmp6hdr tmp_hdr; |
@@ -454,6 +457,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | |||
454 | if (icmpv6_xmit_lock()) | 457 | if (icmpv6_xmit_lock()) |
455 | return; | 458 | return; |
456 | 459 | ||
460 | sk = icmpv6_socket->sk; | ||
461 | np = inet6_sk(sk); | ||
462 | |||
457 | if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) | 463 | if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) |
458 | fl.oif = np->mcast_oif; | 464 | fl.oif = np->mcast_oif; |
459 | 465 | ||