Bug 1760800

Summary: IPv6 static addresses represented in the expanded notation are not accepted
Product: Red Hat Enterprise Linux 8 Reporter: Miguel Duarte Barroso <mduarted>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: fge, jiji, jishi, kanderso, network-qe
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-0.1.1-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1779853 (view as bug list) Environment:
Last Closed: 2020-02-04 12:27:08 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: 1779853    
Attachments:
Description Flags
state for setting ipv6 static address in the expanded notation
none
verified none

Description Miguel Duarte Barroso 2019-10-11 11:02:20 UTC
Created attachment 1624697 [details]
state for setting ipv6 static address in the expanded notation

Description of problem:
nmstate does not accept setting static ipv6 addresses represented on the expanded notation on interfaces.

Version-Release number of selected component (if applicable):
nmstate-0.0.8-15.el8.noarch


How reproducible:
always


Steps to Reproduce:
1. create a veth interface, managed by nm, using the following script:
  ip link add veth1 type veth peer name veth2
  ip link set veth1 up
  ip link set veth2 up
  nmcli device set veth1 managed yes
  nmcli device set veth2 managed yes

2. use nmstatectl to provision the state provided in the attachment: 
  $ nmstatectl set ipv6_expanded_notation_on_iface.yml


Actual results:
2019-10-11 12:49:36,463 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/3 rollback executed: dbus.Dictionary({dbus.String('/org/freedesktop/NetworkManager/Devices/1'): dbus.UInt32(0), dbus.String('/org/freedesktop/NetworkManager/Devices/2'): dbus.UInt32(0), dbus.String('/org/freedesktop/NetworkManager/Devices/3'): dbus.UInt32(0), dbus.String('/org/freedesktop/NetworkManager/Devices/33'): dbus.UInt32(0), dbus.String('/org/freedesktop/NetworkManager/Devices/32'): dbus.UInt32(0)}, signature=dbus.Signature('su'))
Traceback (most recent call last):
  File "/usr/bin/nmstatectl", line 11, in <module>
    load_entry_point('nmstate==0.0.8', 'console_scripts', 'nmstatectl')()
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 62, in main
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 220, in apply
    statedata, args.verify, args.commit, args.timeout
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 240, in apply_state
    checkpoint = libnmstate.apply(state, verify_change, commit, timeout)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 66, in apply
    state.State(desired_state), verify_change, commit, rollback_timeout
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 150, in _apply_ifaces_state
    _verify_change(desired_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 196, in _verify_change
    desired_state.verify_interfaces(current_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/state.py", line 257, in verify_interfaces
    self._assert_interfaces_equal(other_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/state.py", line 485, in _assert_interfaces_equal
    current_state.interfaces[ifname],
libnmstate.error.NmstateVerificationError: 
desired
=======
---
name: veth1
type: ethernet
state: up
ipv4:
  dhcp: false
  enabled: false
ipv6:
  address:
  - ip: 2001:0db8:85a3:0000:0000:8a2e:0370:7331
    prefix-length: 64
  autoconf: false
  dhcp: false
  enabled: true
mac-address: 2E:FC:CA:1D:11:A7
mtu: 1500

current
=======
---
name: veth1
type: ethernet
state: up
ipv4:
  dhcp: false
  enabled: false
ipv6:
  address:
  - ip: 2001:db8:85a3::8a2e:370:7331
    prefix-length: 64
  autoconf: false
  dhcp: false
  enabled: true
mac-address: 2E:FC:CA:1D:11:A7
mtu: 1500

difference
==========
--- desired
+++ current
@@ -7,7 +7,7 @@
   enabled: false
 ipv6:
   address:
-  - ip: 2001:0db8:85a3:0000:0000:8a2e:0370:7331
+  - ip: 2001:db8:85a3::8a2e:370:7331
     prefix-length: 64
   autoconf: false
   dhcp: false


Expected results:
Configuration applied successfully.

Comment 2 Miguel Duarte Barroso 2019-10-24 11:32:25 UTC
Gris, I'm assuming you'll take it from here - i.e. handle the release side of things.

Let me know if you need anything from me.

Comment 3 Gris Ge 2019-12-02 03:01:44 UTC
Hi Miguel,

This bug is fixed in RHEL 8.1.1.

Comment 5 Mingyu Shi 2019-12-04 04:10:03 UTC
Created attachment 1641875 [details]
verified

DISTRO=RHEL-8.1.1-20191202.n.3
[root@hp-dl388g8-04 /etc]0# rpm -q nmstate
nmstate-0.1.1-5.el8.noarch

see the attachment for details

cat ipv6_addr.yml 
---
interfaces:
  - name: veth1
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 3000:0000:0000:0000:0000:0000:0000:0000
        prefix-length: 64
      enabled: true
  - name: veth1_ep
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 0000:0000:0000:0000:0000:0000:0000:0100
        prefix-length: 64
      enabled: true
  - name: veth2
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 0000:0000:000F:0000:0000:0000:0000:0100
        prefix-length: 64
      enabled: true
  - name: veth2_ep
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 3001:db8::1:1:1:1:1
        prefix-length: 64
      enabled: true
  - name: veth3
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 3001:db8:0:0:0:0:2:1
        prefix-length: 64
      enabled: true
  - name: veth3_ep
    type: ethernet
    state: up
    ipv6:
      address:
      - ip: 3001:db8::0:1
        prefix-length: 64
      enabled: true
  - name: dummy0
    type: dummy
    state: up
    ipv6:
      address:
      - ip: '3002:0:0:1:0:0:0:1'
        prefix-length: 64
      - ip: 3003:dB8:0:0:1:0:0:1
        prefix-length: 64
      - ip: 3004:db8::1:0:0:1
        prefix-length: 64
      - ip: 3005:DB8:0:0:1::1
        prefix-length: 64
      - ip: 0:0:0:0:0:FFFF:192.0.2.1
        prefix-length: 64
      - ip: ::FFFF:192.0.2.2
        prefix-length: 64
      - ip: 03:0000:000:00:0::4
        prefix-length: 64
      enabled: true

Comment 7 errata-xmlrpc 2020-02-04 12:27:08 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:0350