libnet.patch 522 B

123456789101112131415
  1. --- src/libnet_resolve.c.orig Tue Aug 20 16:56:01 2002
  2. +++ src/libnet_resolve.c Tue Aug 20 16:56:01 2002
  3. @@ -218,7 +218,11 @@
  4. if (use_name == LIBNET_RESOLVE)
  5. {
  6. +#if defined(__FreeBSD__) || defined(__linux__)
  7. if (!(host_ent = gethostbyname2(host_name, AF_INET6)))
  8. +#else
  9. + if (!(host_ent = gethostbyname(host_name)) || host_ent->h_addrtype != AF_INET6)
  10. +#endif
  11. {
  12. snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
  13. "libnet_name2addr6(): %s", strerror(errno));