|
|
- From ecb2314601247924fee94550611c9d886fa0f990 Mon Sep 17 00:00:00 2001
- From: Brent Cook <bcook@openbsd.org>
- Date: Sat, 13 Aug 2016 14:22:02 -0500
- Subject: [PATCH 13/13] set IPV6_V6ONLY if we are binding to an IPv6 address
-
- ---
- src/usr.sbin/ntpd/server.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
- diff --git a/src/usr.sbin/ntpd/server.c b/src/usr.sbin/ntpd/server.c
- index cbaa115..dd554e6 100644
- --- a/src/usr.sbin/ntpd/server.c
- +++ b/src/usr.sbin/ntpd/server.c
- @@ -42,6 +42,9 @@ setup_listeners(struct servent *se, struct ntpd_conf *lconf, u_int *cnt)
- size_t sa6len = sizeof(struct in6_addr);
- u_int new_cnt = 0;
- int tos = IPTOS_LOWDELAY;
- +#ifdef IPV6_V6ONLY
- + int on = 1;
- +#endif
- #ifdef SO_RTABLE
- int rdomain = 0;
- #endif
- @@ -134,6 +137,12 @@ setup_listeners(struct servent *se, struct ntpd_conf *lconf, u_int *cnt)
- IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) == -1)
- log_warn("setsockopt IPTOS_LOWDELAY");
-
- +#ifdef IPV6_V6ONLY
- + if (la->sa.ss_family == AF_INET6 && setsockopt(la->fd,
- + IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1)
- + log_warn("setsockopt IPV6_V6ONLY");
- +#endif
- +
- #ifdef SO_RTABLE
- if (la->rtable != -1 &&
- setsockopt(la->fd, SOL_SOCKET, SO_RTABLE, &la->rtable,
- --
- 2.10.1
-
|