- (djm) Bug #180: Set ToS bits on IPv4-in-IPv6 mapped addresses. Based on
patch from openssh@misc.tecq.org
diff --git a/ChangeLog b/ChangeLog
index 8d91fdf..da3c1e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
- (djm) Bug #137, #209: fix make problems for scard/Ssh.bin, do uudecode
during distprep only
- (djm) Disable PAM password expiry until a complete fix for bug #188 exists
+ - (djm) Bug #180: Set ToS bits on IPv4-in-IPv6 mapped addresses. Based on
+ patch from openssh@misc.tecq.org
20020425
- (stevesk) [defines.h] remove USE_TIMEVAL; unused
@@ -513,4 +515,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
-$Id: ChangeLog,v 1.2087 2002/04/26 01:27:24 djm Exp $
+$Id: ChangeLog,v 1.2088 2002/04/26 06:54:34 djm Exp $
diff --git a/packet.c b/packet.c
index fcd47cb..258085d 100644
--- a/packet.c
+++ b/packet.c
@@ -277,9 +277,14 @@
memset(&to, 0, sizeof(to));
if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0)
return 0;
- if (to.ss_family != AF_INET)
- return 0;
- return 1;
+ if (to.ss_family == AF_INET)
+ return 1;
+#ifdef IPV4_IN_IPV6
+ if (to.ss_family == AF_INET6 &&
+ IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr))
+ return 1;
+#endif
+ return 0;
}
/* Sets the connection into non-blocking mode. */