2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

381. [bug] Check for IPV6_RECVPKTINFO and use it instead of

IPV6_PKTINFO if found. [RT #229]
This commit is contained in:
Brian Wellington
2000-08-10 00:05:45 +00:00
parent 63fa0d3cf4
commit cd7ffa4c12
2 changed files with 19 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.153 2000/08/01 01:31:27 tale Exp $ */
/* $Id: socket.c,v 1.154 2000/08/10 00:05:43 bwelling Exp $ */
#include <config.h>
@@ -1201,14 +1201,27 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
#endif /* SO_TIMESTAMP */
#if defined(ISC_PLATFORM_HAVEIPV6)
#ifdef IPV6_RECVPKTINFO
/* 2292bis */
if ((pf == AF_INET6)
&& (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
(void *)&on, sizeof (on)) < 0)) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_RECVPKTINFO) "
"failed: %s",
sock->fd, strerror(errno));
}
#else
/* 2292 */
if ((pf == AF_INET6)
&& (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO,
(void *)&on, sizeof (on)) < 0)) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, IPV6_PKTINFO) failed: %s",
"setsockopt(%d, IPV6_PKTINFO) "
"failed: %s",
sock->fd, strerror(errno));
}
#endif /* IPV6_RECVPKTINFO */
#ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/
/* use minimum MTU */
if (pf == AF_INET6) {