aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/lockd/lockd.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 80d7e8a8257d..aa6fe7026de7 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -291,8 +291,11 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
291static inline int __nlm_privileged_request4(const struct sockaddr *sap) 291static inline int __nlm_privileged_request4(const struct sockaddr *sap)
292{ 292{
293 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; 293 const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
294 return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && 294
295 (ntohs(sin->sin_port) < 1024); 295 if (ntohs(sin->sin_port) > 1023)
296 return 0;
297
298 return ipv4_is_loopback(sin->sin_addr.s_addr);
296} 299}
297 300
298#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 301#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)