Bug 1116314
Summary: | netcf can not generate all-ones netmask on a interface | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Hu Jianwei <jiahu> |
Component: | netcf | Assignee: | Laine Stump <laine> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.6 | CC: | dyuan, honzhang, jsuchane, laine, mzhan |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | netcf-0.2.4-2.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-07-22 06:26:05 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
Hu Jianwei
2014-07-04 08:34:53 UTC
A fix for this has been pushed upstream: commit 09f03a2aa1ce5409536a72bd4b480fb2eae3dfac Author: Laine Stump <laine> Date: Tue Aug 19 23:14:26 2014 -0400 Fix netmask for prefix == 32 If an interface was defines with a network prefix of 32 (could be used for a point-to-point link), instead of translating into a netmask of 255.255.255.255, it would end up being 0.0.0.0. This behavior was caused by the function ipcalc_netmask() assuming that ~(0xffffffffu >> 32) would be 0xffffffffu, when in fact the result of shifting right a 32 bit number by 32 positions is undefined. As it happens, in the case of the code generated by gcc, the result of the above is 0, when it should in fact be 0xffffffffu. The safe way to deal with this is to simply special-case prefix == 32. The bug can not reproduce from netcf layer,but using virsh iface-* still can reproduce it. [root@longevity netcf]# rpm -q netcf netcf-0.2.4-2.el6.x86_64 [root@longevity netcf]# cat eth8.xml <interface type='ethernet' name='eth8'> <start mode='onboot'/> <mac address='00:1b:21:27:4e:88'/> <protocol family='ipv4'> <ip address='192.168.188.1' prefix='32'/> </protocol> </interface> [root@longevity netcf]# cat /etc/sysconfig/network-scripts/ifcfg-eth8 DEVICE=eth8 HWADDR=00:1b:21:27:4e:88 ONBOOT=yes BOOTPROTO=none IPADDR=192.168.188.1 NETMASK=255.255.255.255 [root@longevity netcf]# ncftool dumpxml eth8 <?xml version="1.0"?> <interface type="ethernet" name="eth8"> <start mode="onboot"/> <mac address="00:1b:21:27:4e:88"/> <protocol family="ipv4"> <ip address="192.168.188.1" prefix="32"/> </protocol> </interface> Using virsh iface-* cmds [root@longevity netcf]# rpm -q libvirt netcf-libs libvirt-0.10.2-49.el6.x86_64 netcf-libs-0.2.4-2.el6.x86_64 [root@longevity netcf]# cat eth8.xml <interface type='ethernet' name='eth8'> <start mode='onboot'/> <mac address='00:1b:21:27:4e:88'/> <protocol family='ipv4'> <ip address='192.168.188.1' prefix='32'/> </protocol> </interface> [root@longevity netcf]# virsh iface-define eth8.xml Interface eth8 defined from eth8.xml [root@longevity netcf]# virsh iface-dumpxml eth8 <interface type='ethernet' name='eth8'> <start mode='onboot'/> <mac address='00:1b:21:27:4e:88'/> <protocol family='ipv4'> <ip address='192.168.188.1'/> </protocol> </interface> [root@longevity netcf]# cat /etc/sysconfig/network-scripts/ifcfg-eth8 DEVICE=eth8 HWADDR=00:1b:21:27:4e:88 ONBOOT=yes BOOTPROTO=none IPADDR=192.168.188.1 NETMASK=0.0.0.0 Please help me check it, thanks. (In reply to Hu Jianwei from comment #8) > Using virsh iface-* cmds > [root@longevity netcf]# rpm -q libvirt netcf-libs > libvirt-0.10.2-49.el6.x86_64 > netcf-libs-0.2.4-2.el6.x86_64 > > [root@longevity netcf]# cat eth8.xml > <interface type='ethernet' name='eth8'> > <start mode='onboot'/> > <mac address='00:1b:21:27:4e:88'/> > <protocol family='ipv4'> > <ip address='192.168.188.1' prefix='32'/> > </protocol> > </interface> > [root@longevity netcf]# virsh iface-define eth8.xml > Interface eth8 defined from eth8.xml > > [root@longevity netcf]# virsh iface-dumpxml eth8 > <interface type='ethernet' name='eth8'> > <start mode='onboot'/> > <mac address='00:1b:21:27:4e:88'/> > <protocol family='ipv4'> > <ip address='192.168.188.1'/> > </protocol> > </interface> > > [root@longevity netcf]# cat /etc/sysconfig/network-scripts/ifcfg-eth8 > DEVICE=eth8 > HWADDR=00:1b:21:27:4e:88 > ONBOOT=yes > BOOTPROTO=none > IPADDR=192.168.188.1 > NETMASK=0.0.0.0 > > Please help me check it, thanks. Sorry, I made a mistake just now, should restart libvirtd after updating netcf packages. [root@longevity netcf-0.2.4]# service libvirtd restart Stopping libvirtd daemon: [ OK ] Starting libvirtd daemon: [ OK ] [root@longevity netcf]# virsh iface-define eth8.xml Interface eth8 defined from eth8.xml [root@longevity netcf]# virsh iface-dumpxml eth8 <interface type='ethernet' name='eth8'> <start mode='onboot'/> <mac address='00:1b:21:27:4e:88'/> <protocol family='ipv4'> <ip address='192.168.188.1' prefix='32'/> </protocol> </interface> [root@longevity netcf]# cat /etc/sysconfig/network-scripts/ifcfg-eth8 DEVICE=eth8 HWADDR=00:1b:21:27:4e:88 ONBOOT=yes BOOTPROTO=none IPADDR=192.168.188.1 NETMASK=255.255.255.255 The bug has been fixed, changed to Verified. 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 |