diff options
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index c75efbdc71cb..0c78ef1e5dde 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -253,9 +253,8 @@ static inline bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, | |||
253 | 253 | ||
254 | /* Limit if icmp type is enabled in ratemask. */ | 254 | /* Limit if icmp type is enabled in ratemask. */ |
255 | if ((1 << type) & net->ipv4.sysctl_icmp_ratemask) { | 255 | if ((1 << type) & net->ipv4.sysctl_icmp_ratemask) { |
256 | if (!rt->peer) | 256 | struct inet_peer *peer = rt_get_peer_create(rt, fl4->daddr); |
257 | rt_bind_peer(rt, fl4->daddr, 1); | 257 | rc = inet_peer_xrlim_allow(peer, |
258 | rc = inet_peer_xrlim_allow(rt->peer, | ||
259 | net->ipv4.sysctl_icmp_ratelimit); | 258 | net->ipv4.sysctl_icmp_ratelimit); |
260 | } | 259 | } |
261 | out: | 260 | out: |