diff options
-rw-r--r-- | include/linux/lockd/lockd.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 6ab0449bc828..80d7e8a8257d 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -299,8 +299,14 @@ static inline int __nlm_privileged_request4(const struct sockaddr *sap) | |||
299 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 299 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |
300 | { | 300 | { |
301 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; | 301 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; |
302 | return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) && | 302 | |
303 | (ntohs(sin6->sin6_port) < 1024); | 303 | if (ntohs(sin6->sin6_port) > 1023) |
304 | return 0; | ||
305 | |||
306 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_MAPPED) | ||
307 | return ipv4_is_loopback(sin6->sin6_addr.s6_addr32[3]); | ||
308 | |||
309 | return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK; | ||
304 | } | 310 | } |
305 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 311 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
306 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 312 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |