Bug 1528365

Summary: Passing compressed IPv6 address to ocf::heartbeat:IPaddr2 leads to IPv6 DAD trouble
Product: Red Hat Enterprise Linux 7 Reporter: Robert Scheck <redhat-bugzilla>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: agk, amemon, cluster-maint, ctowsley, fdinitto, mjuricek, mlisik, ngore, nwahl, oalbrigt, phagara, robert.scheck
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: resource-agents-4.1.1-38.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1751700 (view as bug list) Environment:
Last Closed: 2020-03-31 19:47:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1751700    

Description Robert Scheck 2017-12-21 16:01:17 UTC
Description of problem:
Passing a compressed IPv6 address by running

  pcs resource create ipv6 ocf:heartbeat:IPaddr2 \
    ip=2001:db8:c1234:5::107e:c0a8:2e04 cidr_netmask=96 \
    op monitor interval=60s

succeeds at the first glance but then poorly fails to ever bring up this
pacemaker resource, it just fails and leads to

  Failed Actions:
  […] exitreason='run_send_ua failed.', […]

And /var/log/messages also provides some errors regarding this (I stripped
the leading date and hostname in the log entries below):

IPaddr2(ipv6_tux)[853]: INFO: Adding inet6 address 2001:db8:c1234:5::107e:c0a8:2e04/96 to device ens192 (with preferred_lft forever)
IPaddr2(ipv6_tux)[853]: INFO: /usr/libexec/heartbeat/send_ua -i 200 -c 5 2001:db8:c1234:5::107e:c0a8:2e04 96 ens192
IPaddr2(ipv6_tux)[1359]: ERROR: Failed to add 2001:db8:c1234:5::107e:c0a8:2e04
lrmd[27797]:  notice: ipv6_start_0:1359:stderr [ ocf-exit-reason:Failed to add 2001:db8:c1234:5::107e:c0a8:2e04 ]

and

kernel: IPv6: ens192: IPv6 duplicate address 2001:db8:c1234:5:0:107e:c0a8:2e04 detected!
IPaddr2(ipv6_tux)[31739]: ERROR: IPv6 address collision 2001:db8:c1234:5::107e:c0a8:2e04 [DAD]
IPaddr2(ipv6_tux)[31739]: ERROR: run_send_ua failed.

If I however pass a non-compressed IPv6 address by running

  pcs resource update ipv6 \
    ip=2001:db8:c1234:5:0:107e:c0a8:2e04 cidr_netmask=96

it succeeds not only at the first glance, but really works without any IPv6
DAD issues.

Note: IPv6 address has been obsfuscated for this RHBZ using an IPv6 address
according to RFC 5737 (documentation range).

Version-Release number of selected component (if applicable):
resource-agents-3.9.5-105.el7_4.3.x86_64

How reproducible:
See above.

Actual results:
Passing compressed IPv6 address to ocf::heartbeat:IPaddr2 leads to IPv6 DAD 
trouble.

Expected results:
Passing compressed IPv6 address to ocf::heartbeat:IPaddr2 should be either
not possible (lead to a failure) or should not lead to IPv6 DAD trouble by
expanding the IPv6 address itself before using it (second preferred to be a
bit more admin friendly).

Comment 2 Robert Scheck 2017-12-22 19:34:02 UTC
Cross-filed ticket 01999293 at the Red Hat customer portal.

Comment 3 Oyvind Albrigtsen 2018-01-16 13:36:52 UTC
:c1234: there can only be 4 hexadecimal digits per group.

Comment 4 Robert Scheck 2018-01-16 14:06:01 UTC
(In reply to Oyvind Albrigtsen from comment #3)
> :c1234: there can only be 4 hexadecimal digits per group.

Sorry, this happened due to obsfuscation for this report. Use :c123: or
:1234: to reproduce this issue.

Comment 5 Oyvind Albrigtsen 2018-01-16 15:01:50 UTC
Oh.

It seems like the issue is due to ":: is not used to shorten just a single 0 field.", so "ip a" shows your address with :0:, but if you replace :0:0: or more with :: "ip a" shows it as expected.

Comment 6 Robert Scheck 2018-01-16 16:35:52 UTC
I might be wrong, but I would assume 2001:db8:c123:5::107e:c0a8:2e04 is
still a valid IPv6 notation, isn't it?

Comment 9 Oyvind Albrigtsen 2018-02-21 12:31:59 UTC
https://github.com/ClusterLabs/resource-agents/pull/1109

Comment 19 Oyvind Albrigtsen 2019-09-12 10:44:19 UTC
Patch to use ip route get: https://github.com/ClusterLabs/resource-agents/pull/1396

Comment 20 Oyvind Albrigtsen 2019-09-12 10:58:04 UTC
Additional patch: https://github.com/ClusterLabs/resource-agents/pull/1397

Comment 26 errata-xmlrpc 2020-03-31 19:47:12 UTC
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.

https://access.redhat.com/errata/RHBA-2020:1067