Bug 179963 - ntpd(8) tries to bind IFDISABLED IPv6 addresses
Summary: ntpd(8) tries to bind IFDISABLED IPv6 addresses
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 13:20 UTC by vsjcfm
Modified: 2018-06-23 00:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vsjcfm 2013-06-25 13:20:02 UTC
ntpd tries to bind IPv6 addresses even if the none of them configured. You can see the following errors (but sometimes ntpd starts without errors):

Jun 25 14:43:43 pxe kernel: Jun 25 14:43:43 pxe ntpd[701]: bind() fd 27, family AF_INET6, port 123, scope 1, addr fe80::250:56ff:febf:12, mcast=0 flags=0x11 fails: Can't assign requested address
Jun 25 14:43:43 pxe kernel: Jun 25 14:43:43 pxe ntpd[701]: unable to create socket on em0 (7) for fe80::250:56ff:febf:12#123

But it still binds to IFDISABLED auto-address:
root@pxe:~# sockstat | grep ntpd
root     ntpd       701   3  dgram  -> /var/run/logpriv
root     ntpd       701   20 udp4   *:123                 *:*
root     ntpd       701   21 udp6   *:123                 *:*
root     ntpd       701   22 udp4   10.0.0.16:123         *:*
root     ntpd       701   23 udp6   ::1:123               *:*
root     ntpd       701   24 udp6   fe80:3::1:123         *:*
root     ntpd       701   25 udp4   127.0.0.1:123         *:*
root     ntpd       701   27 udp6   fe80:1::250:56ff:febf:12:123 *:*
root@pxe:~#

Configs below:

root@pxe:~# ifconfig 
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 00:50:56:bf:00:12
        inet 10.0.0.16 netmask 0xffffffe0 broadcast 10.0.0.31
        inet6 fe80::250:56ff:febf:12%em0 prefixlen 64 scopeid 0x1 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
ipfw0: flags=8801<UP,SIMPLEX,MULTICAST> metric 0 mtu 65536
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@pxe:~# cat /etc/ntp.conf 
#
# $FreeBSD: releng/9.1/etc/ntp.conf 239608 2012-08-23 04:57:56Z delphij $
#
# Default NTP servers for the FreeBSD operating system.
#
# Don't forget to enable ntpd in /etc/rc.conf with:
# ntpd_enable="YES"
#
# The driftfile is by default /var/db/ntpd.drift, check
# /etc/defaults/rc.conf on how to change the location.
#

server ntp.lds.net.ua iburst maxpoll 9
restrict ntp.lds.net.ua nomodify nopeer noquery notrap
server ntp1.lds.net.ua iburst maxpoll 9
restrict ntp1.lds.net.ua nomodify nopeer noquery notrap
server ntp2.lds.net.ua iburst maxpoll 9
restrict ntp2.lds.net.ua nomodify nopeer noquery notrap
restrict 127.0.0.1
restrict -6 ::1
restrict default ignore

server 127.127.1.0
restrict 127.127.1.0
fudge 127.127.1.0 stratum 10

restrict netmon.lds.local nomodify nopeer notrap
restrict netmon.lds.net.ua nomodify nopeer notrap
root@pxe:~# egrep "^ifconfig|^ntpd" /etc/rc.conf
ifconfig_em0="inet 10.0.0.16 netmask 255.255.255.224"
ntpd_enable="YES"
ntpd_config="/etc/ntp.conf"
ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift"
ntpd_sync_on_start="YES"
root@pxe:~#

How-To-Repeat: Just enable ntpd on a machine without configured IPv6 addresses.
Comment 1 vsjcfm 2014-07-11 11:56:57 UTC
I can't see this problem anymore.
Comment 2 Jeremie Le Hen freebsd_committer freebsd_triage 2014-07-13 17:13:48 UTC
I'm reopening this bug as this happens to me on a recent -CURRENT.  I don't have IPv6 configured, although it is enabled in the kernel.  Thus it seems that for all my UP interfaces, I get a link-local address which ntpd(8) tries to use, despite the interface being flagged with IFDISABLED.
Comment 3 Ian Lepore freebsd_committer freebsd_triage 2018-06-23 00:29:21 UTC
It appears this problem no longer occurs in ntpd 4.2.8, tested on 12-current and 11.2-stable.