diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/icmp.c | 3 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index f2eccd531746..17ff9fd7cdda 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -257,7 +257,8 @@ static inline bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, | |||
257 | struct inet_peer *peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, 1); | 257 | struct inet_peer *peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, 1); |
258 | rc = inet_peer_xrlim_allow(peer, | 258 | rc = inet_peer_xrlim_allow(peer, |
259 | net->ipv4.sysctl_icmp_ratelimit); | 259 | net->ipv4.sysctl_icmp_ratelimit); |
260 | inet_putpeer(peer); | 260 | if (peer) |
261 | inet_putpeer(peer); | ||
261 | } | 262 | } |
262 | out: | 263 | out: |
263 | return rc; | 264 | return rc; |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index fc09ef936636..58e4160fdcee 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1323,6 +1323,10 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi | |||
1323 | if (get_user(v, (u32 __user *)optval)) | 1323 | if (get_user(v, (u32 __user *)optval)) |
1324 | return -EFAULT; | 1324 | return -EFAULT; |
1325 | 1325 | ||
1326 | /* "pimreg%u" should not exceed 16 bytes (IFNAMSIZ) */ | ||
1327 | if (v != RT_TABLE_DEFAULT && v >= 1000000000) | ||
1328 | return -EINVAL; | ||
1329 | |||
1326 | rtnl_lock(); | 1330 | rtnl_lock(); |
1327 | ret = 0; | 1331 | ret = 0; |
1328 | if (sk == rtnl_dereference(mrt->mroute_sk)) { | 1332 | if (sk == rtnl_dereference(mrt->mroute_sk)) { |