From b301f7db35ec88edab15e5c11ca69f08a8291efa Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Sun, 1 Nov 2009 19:31:03 +0000 Subject: [PATCH] --- yaml --- r: 171108 b: refs/heads/master c: 685c7944055b9de51ff509719070afae92b3dbe1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv4/icmp.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index e790869a7f5e..47a4f3e08618 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c148fc2e30c988f7e3ac91738b2c03f1cef44849 +refs/heads/master: 685c7944055b9de51ff509719070afae92b3dbe1 diff --git a/trunk/net/ipv4/icmp.c b/trunk/net/ipv4/icmp.c index 84adb5754c96..fe11f60ce41b 100644 --- a/trunk/net/ipv4/icmp.c +++ b/trunk/net/ipv4/icmp.c @@ -501,15 +501,16 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) if (!(rt->rt_flags & RTCF_LOCAL)) { struct net_device *dev = NULL; + rcu_read_lock(); if (rt->fl.iif && net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr) - dev = dev_get_by_index(net, rt->fl.iif); + dev = dev_get_by_index_rcu(net, rt->fl.iif); - if (dev) { + if (dev) saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK); - dev_put(dev); - } else + else saddr = 0; + rcu_read_unlock(); } tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) |