From: Dave Hart Date: Sat, 24 Apr 2010 05:57:35 +0000 (+0000) Subject: [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. X-Git-Tag: NTP_4_2_7P26~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7f8781ab4db94442f0ed8129e0f0644f0b88868;p=thirdparty%2Fntp.git [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored. bk: 4bd2884flWG0Feb9cHu79hyADZLxqA --- diff --git a/ChangeLog b/ChangeLog index 2510bf327..673fd93a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ -* [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev). +* [Bug 1465] Make sure time from TS2100 is not invalid (backport from + ntp-dev). * [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc. +* [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. +* [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored. * Remove --with-arlib from br-flock. --- diff --git a/lib/isc/win32/include/isc/net.h b/lib/isc/win32/include/isc/net.h index b0bba80bb..33e688238 100644 --- a/lib/isc/win32/include/isc/net.h +++ b/lib/isc/win32/include/isc/net.h @@ -20,6 +20,8 @@ #ifndef ISC_NET_H #define ISC_NET_H 1 +#include + /* * Also define LWRES_IPV6_H to keep it from being included if liblwres is * being used, or redefinition errors will occur. @@ -187,37 +189,65 @@ typedef isc_uint16_t in_port_t; * Windows Sockets errors redefined as regular Berkeley error constants. * These are usually commented out in Windows NT to avoid conflicts with errno.h. * Use the WSA constants instead. + * Starting with VC9 (VC++ 2010) many of these are defined incompatibly + * by errno.h -- #undef the conflicting values, which are not relevant to + * Win32. */ +#undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK +#undef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS +#undef EALREADY #define EALREADY WSAEALREADY +#undef ENOTSOCK #define ENOTSOCK WSAENOTSOCK +#undef EDESTADDRREQ #define EDESTADDRREQ WSAEDESTADDRREQ +#undef EMSGSIZE #define EMSGSIZE WSAEMSGSIZE +#undef EPROTOTYPE #define EPROTOTYPE WSAEPROTOTYPE +#undef ENOPROTOOPT #define ENOPROTOOPT WSAENOPROTOOPT +#undef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#undef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP #define EPFNOSUPPORT WSAEPFNOSUPPORT +#undef EAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT +#undef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE +#undef EADDRNOTAVAIL #define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#undef ENETDOWN #define ENETDOWN WSAENETDOWN +#undef ENETUNREACH #define ENETUNREACH WSAENETUNREACH +#undef ENETRESET #define ENETRESET WSAENETRESET +#undef ECONNABORTED #define ECONNABORTED WSAECONNABORTED +#undef ECONNRESET #define ECONNRESET WSAECONNRESET +#undef ENOBUFS #define ENOBUFS WSAENOBUFS +#undef EISCONN #define EISCONN WSAEISCONN +#undef ENOTCONN #define ENOTCONN WSAENOTCONN #define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS +#undef ETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT +#undef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED +#undef ELOOP #define ELOOP WSAELOOP #define EHOSTDOWN WSAEHOSTDOWN +#undef EHOSTUNREACH #define EHOSTUNREACH WSAEHOSTUNREACH #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c index 3cad059ce..ece73de9e 100644 --- a/ntpd/ntp_parser.c +++ b/ntpd/ntp_parser.c @@ -2805,7 +2805,7 @@ yyreduce: estrdup("0.0.0.0"), AF_INET), create_address_node( - estrdup("255.255.255.255"), + estrdup("0.0.0.0"), AF_INET), (yyvsp[(4) - (4)].Queue), ip_file->line_no)); @@ -2823,7 +2823,7 @@ yyreduce: estrdup("::"), AF_INET6), create_address_node( - estrdup("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"), + estrdup("::"), AF_INET6), (yyvsp[(4) - (4)].Queue), ip_file->line_no)); diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y index 58b083e75..38fdf09c4 100644 --- a/ntpd/ntp_parser.y +++ b/ntpd/ntp_parser.y @@ -677,7 +677,7 @@ access_control_command estrdup("0.0.0.0"), AF_INET), create_address_node( - estrdup("255.255.255.255"), + estrdup("0.0.0.0"), AF_INET), $4, ip_file->line_no)); @@ -690,7 +690,7 @@ access_control_command estrdup("::"), AF_INET6), create_address_node( - estrdup("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"), + estrdup("::"), AF_INET6), $4, ip_file->line_no));