summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-04-26 16:54:34 +1000
committerDamien Miller <djm@mindrot.org>2002-04-26 16:54:34 +1000
commitaa100c546c110c9d9f06ec67c8f28771a30f014b (patch)
tree2f2e243036038a6b8f3037e672b6c9d6b4141f1b /packet.c
parentae9d5af0dee1381afd17c757674b31afef1564ca (diff)
- (djm) Bug #180: Set ToS bits on IPv4-in-IPv6 mapped addresses. Based on
patch from openssh@misc.tecq.org
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/packet.c b/packet.c
index fcd47cbce..258085d29 100644
--- a/packet.c
+++ b/packet.c
@@ -277,9 +277,14 @@ packet_connection_is_ipv4(void)
277 memset(&to, 0, sizeof(to)); 277 memset(&to, 0, sizeof(to));
278 if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0) 278 if (getsockname(connection_out, (struct sockaddr *)&to, &tolen) < 0)
279 return 0; 279 return 0;
280 if (to.ss_family != AF_INET) 280 if (to.ss_family == AF_INET)
281 return 0; 281 return 1;
282 return 1; 282#ifdef IPV4_IN_IPV6
283 if (to.ss_family == AF_INET6 &&
284 IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr))
285 return 1;
286#endif
287 return 0;
283} 288}
284 289
285/* Sets the connection into non-blocking mode. */ 290/* Sets the connection into non-blocking mode. */