diff --git a/src/enum_net.cpp b/src/enum_net.cpp index 34c981980..b467922ab 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -70,6 +70,19 @@ namespace libtorrent } return address(); } + +#if (defined __APPLE__ && __MACH__) || defined __FreeBSD__ || defined __NetBSD__ \ + || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__ + + bool verify_sockaddr(sockaddr_in* sin) + { + return (sin->sin_len == sizeof(sockaddr_in) + && sin->sin_family == AF_INET) + || (sin->sin_len == sizeof(sockaddr_in6) + && sin->sin_family == AF_INET6); + } +#endif + } bool in_subnet(address const& addr, ip_interface const& iface) @@ -222,14 +235,6 @@ namespace libtorrent #if (defined __APPLE__ && __MACH__) || defined __FreeBSD__ || defined __NetBSD__ \ || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__ - bool verify_sockaddr(sockaddr_in* sin) - { - return (sin->sin_len == sizeof(sockaddr_in) - && sin->sin_family == AF_INET) - || (sin->sin_len == sizeof(sockaddr_in6) - && sin->sin_family == AF_INET6); - } - struct rt_msg { rt_msghdr m_rtm;