Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2013 15:13:56 +0300 (EEST)
From:      Sayetsky Anton <vsjcfm@gmail.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/179963: ntpd(8) tries to bind IFDISABLED IPv6 addresses
Message-ID:  <201306251213.r5PCDu9L076491@jw.lds.net.ua>
Resent-Message-ID: <201306251220.r5PCK2t5057313@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         179963
>Category:       bin
>Synopsis:       ntpd(8) tries to bind IFDISABLED IPv6 addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 25 12:20:02 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Sayetsky Anton
>Release:        FreeBSD 9.1-RELEASE-p3 amd64
>Organization:
>Environment:
System: FreeBSD pxe.local 9.1-RELEASE-p2 FreeBSD 9.1-RELEASE-p2 #0: Sun Apr 28 16:07:37 EEST 2013     root@pxe.local:/usr/obj/usr/src/sys/PXESRV  amd64 

>Description:
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.

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306251213.r5PCDu9L076491>