[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 00038) Re: sin6_scope_id and 2.2.x kernel



In article <20001118200432.B10801@xxxxxxxxxx> (at Sat, 18 Nov 2000 20:04:32 +0100), Arkadiusz Miskiewicz <misiek@xxxxxxxxxx> says:

> (, or usagi linux-2.2.x).
> when we were testing it we got problems such as invalid argument
> in connect() even for global v6 addresses etc so it was unusable.

Does this fix your problem?

Index: net/ipv6/af_inet6.c
===================================================================
RCS file: /cvsroot/usagi/kernel/linux22/net/ipv6/af_inet6.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- net/ipv6/af_inet6.c	2000/10/17 03:29:35	1.2
+++ net/ipv6/af_inet6.c	2000/11/20 05:03:31	1.3
@@ -201,8 +201,8 @@
 		return sk->prot->bind(sk, uaddr, addr_len);
 		
 	/* Check these errors (active socket, bad address length, double bind). */
-	if ((sk->state != TCP_CLOSE)			||
-	    (addr_len < sizeof(struct sockaddr_in6))	||
+	if ((sk->state != TCP_CLOSE)		||
+	    (addr_len < SIN6_LEN_RFC2133)	||
 	    (sk->num != 0))
 		return -EINVAL;
 		
Index: net/ipv6/raw.c
===================================================================
RCS file: /cvsroot/usagi/kernel/linux22/net/ipv6/raw.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- net/ipv6/raw.c	2000/10/17 03:29:35	1.2
+++ net/ipv6/raw.c	2000/11/20 05:03:31	1.3
@@ -151,7 +151,7 @@
 			 */ 
 			sk->bound_dev_if = addr->sin6_scope_id;
 		}
-#ifndef CONFIG_IPV6_LOOSE_SOCPE_ID
+#ifndef CONFIG_IPV6_LOOSE_SCOPE_ID
 		if (sk->bound_dev_if == 0)
 			return -EINVAL;
 #endif
@@ -386,7 +386,7 @@
 	fl.fl6_flowlabel = 0;
 
 	if (sin6) {
-		if (addr_len < sizeof(struct sockaddr_in6)) 
+		if (addr_len < SIN6_LEN_RFC2133)
 			return(-EINVAL);
 
 		if (sin6->sin6_family && sin6->sin6_family != AF_INET6) 
Index: net/ipv6/tcp_ipv6.c
===================================================================
RCS file: /cvsroot/usagi/kernel/linux22/net/ipv6/tcp_ipv6.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- net/ipv6/tcp_ipv6.c	2000/10/17 03:29:35	1.2
+++ net/ipv6/tcp_ipv6.c	2000/11/20 05:03:31	1.3
@@ -390,7 +390,7 @@
 	if(!ipv6_addr_any(&np->daddr))
 		return -EINVAL;
 	
-	if (addr_len < sizeof(struct sockaddr_in6)) 
+	if (addr_len < SIN6_LEN_RFC2133)
 		return(-EINVAL);
 
 	if (usin->sin6_family && usin->sin6_family != AF_INET6) 
Index: net/ipv6/udp.c
===================================================================
RCS file: /cvsroot/usagi/kernel/linux22/net/ipv6/udp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- net/ipv6/udp.c	2000/10/17 03:29:35	1.2
+++ net/ipv6/udp.c	2000/11/20 05:03:31	1.3
@@ -213,7 +213,7 @@
 		goto ipv4_connected;
 	}
 
-	if (addr_len < sizeof(*usin)) 
+	if (addr_len < SIN6_LEN_RFC2133)
 	  	return(-EINVAL);
 
 	if (usin->sin6_family && usin->sin6_family != AF_INET6) 
@@ -809,7 +809,7 @@
 		if (sin6->sin6_family == AF_INET)
 			return udp_sendmsg(sk, msg, ulen);
 
-		if (addr_len < sizeof(*sin6))
+		if (addr_len < SIN6_LEN_RFC2133)
 			return(-EINVAL);
 
 		if (sin6->sin6_family && sin6->sin6_family != AF_INET6)

-- 
Hideaki YOSHIFUJI @ USAGI Project  <yoshfuji@xxxxxxxxxxxxxx>
PGP5i FP: F731 6599 5EB2 BBA7 1515  1323 1806 A96F 5700 6B25