Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 681082

Summary: Could define an interface while the same name interface already exists
Product: Red Hat Enterprise Linux 6 Reporter: zhanghaiyan <yoyzhang>
Component: netcfAssignee: Laine Stump <laine>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dyuan, llim
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-03 06:57:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhanghaiyan 2011-03-01 03:26:12 UTC
Description of problem:
Could define an interface while the same name interface already exists, and then, it causes confusion

Version-Release number of selected component (if applicable):
- kernel-2.6.32-117.el6.x86_64
- netcf-0.1.7-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Prepare eth0-modified.xml which has different mac address with eth0
# cat eth0-modified.xml 
<interface type="ethernet" name="eth0">
  <start mode="onboot"/>
  <mac address="00:25:64:A7:1F:4F"/>
  <protocol family="ipv4">
    <dhcp/>
  </protocol>
</interface>

2. # ncftool 
ncftool> list
eth0
lo
ncftool> dumpxml eth0
<?xml version="1.0"?>
<interface type="ethernet" name="eth0">
  <start mode="onboot"/>
  <mac address="00:25:64:A7:1F:4D"/>
  <protocol family="ipv4">
    <dhcp/>
  </protocol>
</interface>

ncftool> define eth0-modified.xml 
Defined interface eth0
ncftool> dumpxml eth0
<?xml version="1.0"?>
<interface type="ethernet" name="eth0">
  <start mode="onboot"/>
  <mac address="00:25:64:A7:1F:4F"/>
  <protocol family="ipv4">
    <dhcp/>
  </protocol>
</interface>

ncftool> 

  
Actual results:
the 2nd eth0 still can defined successfully while eth0 already exists and active.
after 2 eth0 exist, the dumpxml command displays the 2nd interface's xml info and it certainly causes confusion.

Expected results:
Do pre-check before defining interface and only one same name interface is allowed to be defined.


Additional info:

Comment 2 Laine Stump 2011-03-01 09:10:44 UTC
This is expected behavior - when you define an interface with the same name as an existing interface, the new definition will replace the old definition. Is that what you see?

Comment 3 zhanghaiyan 2011-03-01 09:24:39 UTC
from ncftool > dumpxml eth0, the new definition replaces old definition
but from # ifconfig eth0 and /etc/sysconfig/network-scripts/ifcfg-eth0 it is still old definition, is that expected ?
I think it is a little confusing users

Comment 4 Laine Stump 2011-03-01 13:05:41 UTC
The output of "ifconfig eth0" (ie the "live" status of the interface) doesn't change until you do an ifdown / ifup of the interface. This is similar to the way that changing the config of a virtual guest doesn't take effect until you stop and restart the guest.

Are you sure about the contents of ifcfg-eth0? The output of "dumpxml eth0" is directly derived from ifcfg-eth0 every time it is called, so it seems unlikely that they wouldn't match. Please re-check this part.

Comment 5 zhanghaiyan 2011-03-02 02:25:47 UTC
Sorry, I rechecked the result, and found that both ncftool>dumpxml eth0 and ifcfg-eth0 is replaced as new definition. 'ifconfig eth0' is still old definition.
Seems that is expected result.