- updated to 4.2.8p15
[packages/ntp.git] / ntp-ipv6.patch
1 --- ntp-4.2.8p14/ntpdate/ntpdate.c      2020-04-06 19:32:04.312000000 +0200
2 +++ ntp-4.2.8p14/ntpdate/ntpdate.c      2020-04-06 19:35:19.513000000 +0200
3 @@ -1760,9 +1760,11 @@
4                 }
5  #ifdef IPV6_V6ONLY
6                 /* Restricts AF_INET6 socket to IPv6 communications (see RFC 2553bis-03) */
7 -               if (res->ai_family == AF_INET6)
8 -                       if (setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval)) < 0) {
9 +               if (res->ai_family == AF_INET6) {
10 +                       int i = setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval));
11 +                       if (i < 0 && errno != ENOPROTOOPT) {
12                                 msyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
13 +                       }
14                 }
15  #endif
16