aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index fbf533cc9dce..7f092fa912bd 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -276,6 +276,13 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
276 276
277 /* Check if the address belongs to the host. */ 277 /* Check if the address belongs to the host. */
278 if (addr_type == IPV6_ADDR_MAPPED) { 278 if (addr_type == IPV6_ADDR_MAPPED) {
279 /* Binding to v4-mapped address on a v6-only socket
280 * makes no sense
281 */
282 if (np->ipv6only) {
283 err = -EINVAL;
284 goto out;
285 }
279 v4addr = addr->sin6_addr.s6_addr32[3]; 286 v4addr = addr->sin6_addr.s6_addr32[3];
280 if (inet_addr_type(net, v4addr) != RTN_LOCAL) { 287 if (inet_addr_type(net, v4addr) != RTN_LOCAL) {
281 err = -EADDRNOTAVAIL; 288 err = -EADDRNOTAVAIL;