Bug 1208894

Summary: Remove extraneous single quotes from IPV6ADDR_SECONDARIES
Product: Red Hat Enterprise Linux 6 Reporter: Laine Stump <laine>
Component: netcfAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dyuan, honzhang, mzhan, virt-bugs
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: netcf-0.2.4-3.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1170941 Environment:
Last Closed: 2015-07-22 06:26:11 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:

Description Laine Stump 2015-04-03 17:58:09 UTC
+++ This bug was initially created as a clone of Bug #1170941 +++

Description of problem:
An extra set of quotes is added to IPV6ADDR_SECONDARIES in the ifcfg file.

How reproducible:
100%

Steps to Reproduce:
[root@localhost ~]# cat enp2s0.xml
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>
[root@localhost ~]# virsh iface-define enp2s0.xml
Interface enp2s0 defined from enp2s0.xml

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE=enp2s0
ONBOOT=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
DHCPV6C=no
IPV6ADDR=2002::200/64
IPV6ADDR_SECONDARIES="'2002::201/64 2002::202/64'"
[root@localhost ~]# virsh iface-dumpxml enp2s0
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>

[root@localhost ~]# virsh iface-start enp2s0
Interface enp2s0 started

[root@localhost ~]# virsh iface-dumpxml enp2s0
<interface type='ethernet' name='enp2s0'>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='fe80::21b:21ff:fe27:4ece' prefix='64'/>
  </protocol>
  <link speed='1000' state='up'/>
  <mac address='00:1b:21:27:4e:ce'/>
</interface>

[root@localhost ~]# ip ad show enp2s0
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1b:21:27:4e:ce brd ff:ff:ff:ff:ff:ff
    inet6 2002::200/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::21b:21ff:fe27:4ece/64 scope link
       valid_lft forever preferred_lft forever

Actual results:
As shown above steps, IPV6ADDR_SECONDARIES setting in ifcfg files was being set with an extra set of single quotes.

Expected results:
fix it

Additional info:
Should like below:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE=enp2s0
ONBOOT=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
DHCPV6C=no
IPV6ADDR=2002::200/64
IPV6ADDR_SECONDARIES="2002::201/64 2002::202/64"
[root@localhost ~]# virsh iface-start enp2s0
Interface enp2s0 started

[root@localhost ~]# virsh iface-dumpxml enp2s0
<interface type='ethernet' name='enp2s0'>
  <protocol family='ipv6'>
    <ip address='2002::202' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::200' prefix='64'/>
    <ip address='fe80::21b:21ff:fe27:4ece' prefix='64'/>
  </protocol>
  <link speed='1000' state='up'/>
  <mac address='00:1b:21:27:4e:ce'/>
</interface>

[root@localhost ~]# ip ad show enp2s0
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1b:21:27:4e:ce brd ff:ff:ff:ff:ff:ff
    inet6 2002::202/64 scope global
       valid_lft forever preferred_lft forever
    inet6 2002::201/64 scope global
       valid_lft forever preferred_lft forever
    inet6 2002::200/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::21b:21ff:fe27:4ece/64 scope link
       valid_lft forever preferred_lft forever

--- Additional comment from Hu Jianwei on 2015-03-06 03:00:15 EST ---

I sent a patch to upstream before:
https://lists.fedorahosted.org/pipermail/netcf-devel/2014-December/000915.html

Please review it.

--- Additional comment from Laine Stump on 2015-03-07 03:04:48 EST ---

The above patch has been pushed upstream:

commit 597032732156e03af15bdbd0c4a0e7a89e66a8f3
Author: Jianwei Hu <jiahu>
Date:   Fri Dec 5 14:26:22 2014 +0800

    Remove extraneous single quotes from IPV6ADDR_SECONDARIES

Comment 1 Laine Stump 2015-04-03 17:59:04 UTC
This bug is very easy to reproduce / test for fix, and the patch is trivial with no danger of causing other regressions.

Comment 5 Hu Jianwei 2015-04-20 05:44:00 UTC
Verified as below:

[root@ibm-x3650m3-04 ~]# rpm -q libvirt netcf-libs
libvirt-0.10.2-53.el6.x86_64
netcf-libs-0.2.4-3.el6.x86_64

[root@ibm-x3650m3-04 ~]# cat nic.xml 
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>

[root@ibm-x3650m3-04 ~]# virsh iface-define nic.xml
Interface enp2s0 defined from nic.xml

[root@ibm-x3650m3-04 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE="enp2s0"
ONBOOT="yes"
IPV6INIT="yes"
IPV6_AUTOCONF="no"
DHCPV6C="no"
IPV6ADDR="2002::200/64"
IPV6ADDR_SECONDARIES="2002::201/64 2002::202/64"

[root@ibm-x3650m3-04 ~]# virsh iface-dumpxml enp2s0
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>

The extraneous single quotes have been removed from ifcfg-XXX, we can get expected results, moved to Verified.

Comment 7 errata-xmlrpc 2015-07-22 06:26:11 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://rhn.redhat.com/errata/RHBA-2015-1307.html