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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user