Bug 969052 - ntpd incorrectly compares IPv6 addresses (does not compare scope_id)
ntpd incorrectly compares IPv6 addresses (does not compare scope_id)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ntp (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Miroslav Lichvar
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 10:45 EDT by Milos Vyletel
Modified: 2013-11-21 04:52 EST (History)
3 users (show)

See Also:
Fixed In Version: ntp-4.2.6p5-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 04:52:34 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
upstream patch (931 bytes, patch)
2013-05-30 10:45 EDT, Milos Vyletel
no flags Details | Diff

  None (edit)
Description Milos Vyletel 2013-05-30 10:45:23 EDT
Created attachment 754910 [details]
upstream patch

Description of problem:
When I was looking into why ntpd does not listen on link-local IPv6
address of my interface I noticed that if two or more interfaces share
same IPv6 link-local address ntpd thinks they are duplicate.

SOCKCMP is comparing two sockaddr structures but it is not
taking scope id in case of IPv6 into account. Beacuse of this if
there are multiple virtual interfaces (bridges/vlans) on top of same
physical interface which ends up having same link-local IPv6 address
ntpd will not listen on all of them but only on the first one because
it consideres other ones as duplicates.

Following patch adds scope id into equation and ntpd no longer thinks
they are duplicate if they are on different interface.

Here's list of interfaces in our configuration that have same link-local
IP (same physical parent)

12: control: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 00:26:55:85:74:b8 brd ff:ff:ff:ff:ff:ff
    inet 169.254.143.3/24 brd 169.254.143.255 scope global control
    inet6 fe80::226:55ff:fe85:74b8/64 scope link
       valid_lft forever preferred_lft forever
13: bond0.3@bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:26:55:85:74:b8 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::226:55ff:fe85:74b8/64 scope link
       valid_lft forever preferred_lft forever
14: mgmt: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 00:26:55:85:74:b8 brd ff:ff:ff:ff:ff:ff
    inet 10.240.6.34/24 brd 10.240.6.255 scope global mgmt
    inet6 fe80::226:55ff:fe85:74b8/64 scope link
       valid_lft forever preferred_lft forever


Version-Release number of selected component (if applicable):
ntp-4.2.4p8-3.el6

How reproducible:
always

Steps to Reproduce:
1. service ntpd start

Actual results:
from /var/log/messages

May 29 11:58:05 localhost ntpd[8082]: ntpd 4.2.4p8@1.1612-o Sat May 11 08:28:45 UTC 2013 (1)
May 29 11:58:05 localhost ntpd[8082]: precision = 0.108 usec
May 29 11:58:05 localhost ntpd[8082]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
May 29 11:58:05 localhost ntpd[8082]: Listening on interface #1 wildcard, ::#123 Disabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #2 vnet1, fe80::fc54:ff:fe98:2055#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #3 lo, ::1#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #4 mgmt, fe80::226:55ff:fe85:74b8#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #5 vnet0, fe80::fc54:ff:fe93:d67e#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #6 lo, 127.0.0.1#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #7 control, 169.254.143.3#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on interface #8 mgmt, 10.240.6.34#123 Enabled
May 29 11:58:06 localhost ntpd[8082]: Listening on routing socket on fd #25 for interface updates
May 29 11:58:06 localhost ntpd[8082]: kernel time sync status 2040
May 29 11:58:06 localhost ntpd[8082]: frequency initialized 3.799 PPM from /var/lib/ntp/drift


Expected results:
May 29 13:47:07 localhost ntpd[15903]: ntpd 4.2.4p8@1.1612-o Wed May 29 17:45:15 UTC 2013 (1)
May 29 13:47:07 localhost ntpd[15904]: precision = 0.150 usec
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #1 wildcard, ::#123 Disabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #2 vnet1, fe80::fc54:ff:fe98:2055#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #3 lo, ::1#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #4 mgmt, fe80::226:55ff:fe85:74b8#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #5 control, fe80::226:55ff:fe85:74b8#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #6 bond0.3, fe80::226:55ff:fe85:74b8#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #7 vnet0, fe80::fc54:ff:fe93:d67e#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #8 lo, 127.0.0.1#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #9 control, 169.254.143.3#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on interface #10 mgmt, 10.240.6.34#123 Enabled
May 29 13:47:07 localhost ntpd[15904]: Listening on routing socket on fd #27 for interface updates
May 29 13:47:07 localhost ntpd[15904]: kernel time sync status 2040
May 29 13:47:07 localhost ntpd[15904]: frequency initialized 3.799 PPM from /var/lib/ntp/drift


Additional info:
Note that patch was taken from upstream ntp-stable repository. It was sumbitted as fix for
http://bugs.ntp.org/show_bug.cgi?id=771
Comment 6 errata-xmlrpc 2013-11-21 04:52:34 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1593.html

Note You need to log in before you can comment on or make changes to this bug.