Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 100622
Summary: | Hotplug (/etc/hotplug/net.agent?) should call nameif if /etc/mactab exists. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux Beta | Reporter: | Aleksey Nogin <aleksey> | ||||||
Component: | initscripts | Assignee: | Bill Nottingham <notting> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | Brock Organ <borgan> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | beta1 | CC: | rvokal | ||||||
Target Milestone: | --- | Keywords: | FutureFeature | ||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Enhancement | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2003-09-03 23:29:18 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: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 82507, 100643 | ||||||||
Attachments: |
|
Description
Aleksey Nogin
2003-07-23 18:46:27 UTC
Can you describe exactly how this fails for you? It works for me currently with hotplug. What does your network configuration look like? Created attachment 93088 [details]
A patch to /etc/hotplug/net.agent
Here is an example patch that works for me.
> Can you describe exactly how this fails for you? It works for me currently with
> hotplug. What does your network configuration look like?
I have 3 devices:
a) built-in 3c905C (preferred name - eth0)
b) built-in PCMCIA wireless card (preferred name - wvlan0)
c) another 3c905C in a docking statin (preferred name - eth1)
By default, I get "a" -> eth0, "b" -> eth1 when not docked and "a" -> eth0, "c"
-> eth1, "b" -> eth2 when docked (so I have a problem with two different cards
getting the eth1 name in different cases). Creating /etc/mactab does not help.
Adding HWADDR=... lines to /etc/sysconfig/network-scripts/ifcfg-{eth1,wvlan0}
does not help (note that in undocked case, "b" gets ifup'ed as eth1 when "c" is
simply not there!)
OK, this is more a bug with ifup, then. I'll try and reprocuce the setup with my laptop. With HWADDR= in all the config files, this needs to work without hotplug modifications. Not sure how that would work - how would ifup even know to look at /etc/sysconfig/network-scripts/ifcfg-wvlan0 ??? Reads the hwaddr for the device passed to it, looks for the config file with that hwaddr. Is this better for you with initscripts-7.29-x? Still only works if I apply the given patch and supply the /etc/macaddr. With initscripts-7.30-1 and without my patch, inserting WaveLan card (that I wish to be called wvlan0 while the default name is eth1) causes "/sbin/ifup eth1" to be called. This prints out: /sbin/ifup: line 146: local: can only be used in a function interface 'eth1' not found After that it proceeds to bring up the interface under the wrong name (eth1). The problem is - the fix _has_ to go into hotplug and it _has_ to be _before_ /sbin/ifup is called! Here is the _proof_: without it by the time "/sbin/ifup eth1" is called, the ifup script has no way of distinguishing between the two scenarious: 1) ifup is called by the user - and thus "eth1" refers to the "desired" name of the device - e.g. we need to find the device with the HWADDR specified in cfcfg-eth1, rename it _to_ eth1 and bring up. 2) ifup is called by hotplug - and thus "eth1" is the "accidental" current name of whatever device that needs to be brough up - _after_ it is renamed _from_ eth1 to an appropriate xyz such that ifcfg-xyz has HWADDR specified to be what eth1 currently has... ----------------- Let me give a concrete example. Suppose you have two devices - A and B. Suppose that currently we have currently eth0 has HWaddr B currently eth1 has HWaddr A cfcfg-eth0 has "HWADDR=A" cfcfg-eth1 has "HWADDR=B" and "/sbin/ifup eth0" is called. What interface do you bring up??? If ifup was called by the user, obviously user thinks that eth0 is device A (since this is what user wrote in configs). But if ifup was called by hotplug, that manes that device B was just plugged in and it is device B that needs to be brough up! The only was this can be resolved is if you can trust hotplug to resolve the name before calling ifup, as my patch provides (or something similar - may be grep cfcfg-* instead of mactab, as my patch does). Ugh, you're right. Since we don't populate mactab, it will have to go grepping the config files. Created attachment 94181 [details]
patch to bring up the right config on insertion
Does this patch work ok for you without an /etc/mactab?
Added in hotplug-2002_04_02-20. |