diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-06-07 18:34:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-09 21:06:13 -0400 |
commit | cfa087f689402438e3cb0f077e649d01c871b0e7 (patch) | |
tree | 0284b1ef6a086fae77da311cc2f9efd6588a77dc /net/ipv4/icmp.c | |
parent | 88e7594a9775e54dcd421cb246406dce62e48bee (diff) |
icmp: RCU conversion in icmp_address_reply()
- rcu_read_lock() already held by caller
- use __in_dev_get_rcu() instead of in_dev_get() / in_dev_put()
- remove goto out;
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index d65e9215bcd7..bdb6c71e72a6 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -925,6 +925,7 @@ static void icmp_address(struct sk_buff *skb) | |||
925 | /* | 925 | /* |
926 | * RFC1812 (4.3.3.9). A router SHOULD listen all replies, and complain | 926 | * RFC1812 (4.3.3.9). A router SHOULD listen all replies, and complain |
927 | * loudly if an inconsistency is found. | 927 | * loudly if an inconsistency is found. |
928 | * called with rcu_read_lock() | ||
928 | */ | 929 | */ |
929 | 930 | ||
930 | static void icmp_address_reply(struct sk_buff *skb) | 931 | static void icmp_address_reply(struct sk_buff *skb) |
@@ -935,12 +936,12 @@ static void icmp_address_reply(struct sk_buff *skb) | |||
935 | struct in_ifaddr *ifa; | 936 | struct in_ifaddr *ifa; |
936 | 937 | ||
937 | if (skb->len < 4 || !(rt->rt_flags&RTCF_DIRECTSRC)) | 938 | if (skb->len < 4 || !(rt->rt_flags&RTCF_DIRECTSRC)) |
938 | goto out; | 939 | return; |
939 | 940 | ||
940 | in_dev = in_dev_get(dev); | 941 | in_dev = __in_dev_get_rcu(dev); |
941 | if (!in_dev) | 942 | if (!in_dev) |
942 | goto out; | 943 | return; |
943 | rcu_read_lock(); | 944 | |
944 | if (in_dev->ifa_list && | 945 | if (in_dev->ifa_list && |
945 | IN_DEV_LOG_MARTIANS(in_dev) && | 946 | IN_DEV_LOG_MARTIANS(in_dev) && |
946 | IN_DEV_FORWARD(in_dev)) { | 947 | IN_DEV_FORWARD(in_dev)) { |
@@ -958,9 +959,6 @@ static void icmp_address_reply(struct sk_buff *skb) | |||
958 | mp, dev->name, &rt->rt_src); | 959 | mp, dev->name, &rt->rt_src); |
959 | } | 960 | } |
960 | } | 961 | } |
961 | rcu_read_unlock(); | ||
962 | in_dev_put(in_dev); | ||
963 | out:; | ||
964 | } | 962 | } |
965 | 963 | ||
966 | static void icmp_discard(struct sk_buff *skb) | 964 | static void icmp_discard(struct sk_buff *skb) |