11_usagi_fix 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c
  2. --- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002
  3. +++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002
  4. @@ -448,6 +448,15 @@
  5. int len, mask_len, i = 0;
  6. char ch;
  7. + /*
  8. + * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
  9. + * different between KAME and Solaris8. While KAME returns
  10. + * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here.
  11. + */
  12. + if (STRN_EQ(string, "::ffff:", 7)
  13. + && dot_quad_addr(string + 7) != INADDR_NONE)
  14. + return (masked_match4(net_tok, mask_tok, string + 7));
  15. +
  16. memset(&hints, 0, sizeof(hints));
  17. hints.ai_family = AF_INET6;
  18. hints.ai_socktype = SOCK_STREAM;
  19. @@ -457,13 +466,6 @@
  20. memcpy(&addr, res->ai_addr, sizeof(addr));
  21. freeaddrinfo(res);
  22. - if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
  23. - if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
  24. - || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
  25. - return (NO);
  26. - return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
  27. - }
  28. -
  29. /* match IPv6 address against netnumber/prefixlen */
  30. len = strlen(net_tok);
  31. if (*net_tok != '[' || net_tok[len - 1] != ']')
  32. diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c
  33. --- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002
  34. +++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002
  35. @@ -228,7 +228,7 @@
  36. hints.ai_family = sin->sa_family;
  37. hints.ai_socktype = SOCK_STREAM;
  38. hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
  39. - if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
  40. + if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
  41. freeaddrinfo(res0);
  42. res0 = NULL;
  43. tcpd_warn("host name/name mismatch: "