diff options
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index e1caa1abe5d1..49a74cc79dc8 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -637,12 +637,12 @@ EXPORT_SYMBOL(icmp_send); | |||
637 | 637 | ||
638 | static void icmp_unreach(struct sk_buff *skb) | 638 | static void icmp_unreach(struct sk_buff *skb) |
639 | { | 639 | { |
640 | const struct net_protocol *ipprot; | ||
640 | const struct iphdr *iph; | 641 | const struct iphdr *iph; |
641 | struct icmphdr *icmph; | 642 | struct icmphdr *icmph; |
642 | int hash, protocol; | ||
643 | const struct net_protocol *ipprot; | ||
644 | u32 info = 0; | ||
645 | struct net *net; | 643 | struct net *net; |
644 | u32 info = 0; | ||
645 | int protocol; | ||
646 | 646 | ||
647 | net = dev_net(skb_dst(skb)->dev); | 647 | net = dev_net(skb_dst(skb)->dev); |
648 | 648 | ||
@@ -731,9 +731,8 @@ static void icmp_unreach(struct sk_buff *skb) | |||
731 | */ | 731 | */ |
732 | raw_icmp_error(skb, protocol, info); | 732 | raw_icmp_error(skb, protocol, info); |
733 | 733 | ||
734 | hash = protocol & (MAX_INET_PROTOS - 1); | ||
735 | rcu_read_lock(); | 734 | rcu_read_lock(); |
736 | ipprot = rcu_dereference(inet_protos[hash]); | 735 | ipprot = rcu_dereference(inet_protos[protocol]); |
737 | if (ipprot && ipprot->err_handler) | 736 | if (ipprot && ipprot->err_handler) |
738 | ipprot->err_handler(skb, info); | 737 | ipprot->err_handler(skb, info); |
739 | rcu_read_unlock(); | 738 | rcu_read_unlock(); |