# ntpd 4.2.8 issues

## pakjebakmeel

Hi all,

My NTP daemon has been running fine for ages until I received the update to version 4.2.8 (to fix those newly found vulnerabilities). It was not longer functioning. After enabling debug logging I found this:

```
24 Dec 14:30:44 ntpd[29664]: 0.0.0.0 c01d 0d kern kernel time sync enabled

24 Dec 14:30:44 ntpd[29664]: 0.0.0.0 c012 02 freq_set kernel -1.129 PPM

24 Dec 14:30:44 ntpd[29664]: 0.0.0.0 c016 06 restart

24 Dec 14:30:44 ntpd[29664]: retrying DNS ntp.ubuntu.com: EAI_SYSTEM 17: File exists
```

When I replace the DNS name in my /etc/ntp.conf to use the IP address it works

```
24 Dec 14:36:01 ntpd[29664]: 0.0.0.0 c01d 0d kern kernel time sync disabled

24 Dec 14:36:05 ntpd[29884]: 0.0.0.0 c01d 0d kern kernel time sync enabled

24 Dec 14:36:05 ntpd[29884]: 0.0.0.0 c012 02 freq_set kernel -1.129 PPM

24 Dec 14:36:05 ntpd[29884]: 0.0.0.0 c016 06 restart

24 Dec 14:36:06 ntpd[29884]: 0.0.0.0 c615 05 clock_sync

24 Dec 14:36:13 ntpd[29884]: 0.0.0.0 061b 0b leap_event
```

DNS resolution is working fine on this box, just NTP seems affected.

Also when using a different server:

```
24 Dec 14:50:43 ntpd[12875]: 0.0.0.0 c01d 0d kern kernel time sync disabled

24 Dec 14:50:45 ntpd[12993]: 0.0.0.0 c01d 0d kern kernel time sync enabled

24 Dec 14:50:45 ntpd[12993]: 0.0.0.0 c012 02 freq_set kernel -1.129 PPM

24 Dec 14:50:45 ntpd[12993]: 0.0.0.0 c016 06 restart

24 Dec 14:50:45 ntpd[12993]: retrying DNS ntp3.remco.org: EAI_SYSTEM 4: Interrupted system call
```

Then I use the IP address in the config instead of the DNS name and it works again. Here is the config for completeness:

```
gentoo ntp # cat /etc/ntp.conf

# NOTES:

# DHCP clients can append or replace NTP configuration files.

# You should consult your DHCP client documentation about its

# default behaviour and how to change it.

server ntp.remco.org iburst

server ntp2.remco.org iburst

server ntp3.remco.org iburst

#server 91.189.89.199 iburst

logfile /var/log/ntp/ntp.log

logconfig=all

driftfile       /var/lib/ntp/ntp.drift

disable monitor

restrict default limited kod nomodify notrap nopeer noquery

restrict 127.0.0.1

restrict 192.168.10.10
```

It seems that I can no longer use DNS names in the server lines in the config file since the last update.

----------

## pakjebakmeel

Small update here, it seemed that using IP addresses instead of DNS names fixed my issues. Unfortunately the daemon crashes after some hours. I have enabled debug logging to find the cause:

```
 4 Mar 05:05:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:05:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:10:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:10:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:15:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:15:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:20:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:20:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:25:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:25:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:30:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:30:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:35:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:35:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:40:28 ntpd[27369]: ./../lib/isc/unix/ifiter_getifaddrs.c:99: unexpected error:

 4 Mar 05:40:28 ntpd[27369]: getting interface addresses: getifaddrs: Resource temporarily unavailable

 4 Mar 05:40:28 ntpd[27369]: Too many errors.  Shutting up.

 4 Mar 06:00:02 ntpd[27369]: fatal out of memory (4048 bytes)

 4 Mar 06:00:02 ntpd[27369]: 0.0.0.0 061d 0d kern kernel time sync disabled
```

Apparently this is a know bug (that has been open for quite I while): https://bugs.gentoo.org/show_bug.cgi?id=533966

A patch (from the Arch community) was proposed here: https://bugs.archlinux.org/task/41593

I have applied this patch using the user patch method described here: http://wiki.gentoo.org/wiki//etc/portage/patches and installed the patched version.

Let's wait and see what happens..

----------

