openssh 3.1p1: ToS trouble

Oliver Wellnitz oliver at tecq.org
Fri Mar 22 18:36:33 EST 2002


In article <20020319131547.GB18652 at faui02> you wrote:
> openssh sets TOS for packet_connection_is_ipv4() only

I made a patch which solves my ToS issue.  However, I do not use Kerberos
which also uses packet_connection_is_ipv4(), so if anyone can test it I
would like to hear about it.


--- openssh-3.1p1/packet.c	Tue Mar  5 02:31:29 2002
+++ openssh-3.1p1-v4inv6-ToS/packet.c	Thu Mar 21 13:43:01 2002
@@ -178,13 +178,24 @@
 {
 	struct sockaddr_storage to;
 	socklen_t tolen = sizeof(to);
+	struct sockaddr_in6 *to6;
 
 	memset(&to, 0, sizeof(to));
 	if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0)
 		return 0;
-	if (to.ss_family != AF_INET)
+	switch (to.ss_family) {
+	case AF_INET:
+		return 1;
+#ifdef IPV4_IN_IPV6
+	case AF_INET6:
+		to6 = (struct sockaddr_in6 *)&to;
+		if (IN6_IS_ADDR_V4MAPPED(&to6->sin6_addr)) 
+			return 1;
 		return 0;
-	return 1;
+#endif
+	default:   
+		return 0;
+	}
 }
 
 /* Sets the connection into non-blocking mode. */



More information about the openssh-unix-dev mailing list