Bug 18435 - doesn't work if there are options for another profile
Summary: doesn't work if there are options for another profile
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: NetworkManager (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Mikhail Efremov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-04 00:36 MSK by Ivan Zakharyaschev
Modified: 2011-04-18 18:37 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2009-01-04 00:36:54 MSK
etcnet-0.9.7-alt0.M41.1
NetworkManager-0.7.0-alt3.svn.r3930.M41.8

What I did:

I installed Desktop 4.1.1RC 2008/11/15, and set up eth0 to use DHCP.

When I booted, NM controlled wlan0 (could be observed through the applet in KDE, or in /var/log/messages). Good.

Then, I added /etc/net/ifaces/wlan0/ and /etc/net/ifaces/wlan0/options:

$ cat /etc/net/ifaces/wlan0/options 
TYPE=eth
NM_CONTROLLED=yes
ONBOOT=yes
$ 

My intention was not to change the default behaviour of using NM for wlan0. (I needed this in order to make up another profile where it will be different.)
And NM worked after a reboot. It could be seen through the KDE applet (there is a list of accessible wireless networks) or /var/log/messages (the last messages):

Jan  4 00:21:24 localhost NetworkManager: <info>  (wlan0): device state change: 1 -> 2 
Jan  4 00:21:24 localhost NetworkManager: <info>  (wlan0): preparing device. 
Jan  4 00:21:24 localhost NetworkManager: <info>  (wlan0): deactivating device. 
Jan  4 00:21:24 localhost NetworkManager: <info>  (wlan0): device state change: 2 -> 3 
Jan  4 00:21:24 localhost NetworkManager: <info>  (wlan0): supplicant interface state change: 1 -> 2. 

Good.

But then I actually added /etc/net/ifaces/wlan0/options#TIBET:

[root@localhost wlan0]# cat options#TIBET 
TYPE=eth
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=ipv4ll[root@localhost wlan0]# 

And after a reboot (with no netprofile given), NM doesn't work anymore. 

Here are the messages that appear after this file is added:
Jan  4 00:33:17 localhost NetworkManager: <info>  (wlan0): now unmanaged 
Jan  4 00:33:17 localhost NetworkManager: <info>  (wlan0): device state change: 3 -> 1 
Jan  4 00:33:17 localhost NetworkManager: <info>  (wlan0): cleaning up... 
Jan  4 00:33:17 localhost NetworkManager: <info>  (wlan0): taking down device. 


Although NM shouldn't care about this file -- it's not the current profile.
Comment 1 Ivan Zakharyaschev 2009-01-04 00:39:35 MSK
Expected: If one adds smth like /etc/net/ifaces/wlan0/options#TIBET, NM is still controlling wlan0 (because the current default netprofile has NM_CONTROLLED=yes in /etc/net/ifaces/wlan0/options).
Comment 2 Ivan Zakharyaschev 2009-01-04 04:22:04 MSK
Workaround and a cleaner solution at the same time -- naming the ifaces with different configurations differently:

after patching the etcnet code for smoother operation with renamings with the patches https://bugzilla.altlinux.org/show_bug.cgi?id=11786#c1 and https://bugzilla.altlinux.org/show_bug.cgi?id=18416#c1 ,

rename from ifaces/wlan0/options to ifaces/wlan/options,
rename from ifaces/wlan0/options#TIBET to ifaces/wtibet/options

and add:

$ cat iftab
# -*- conf-space -*-

# wlan0 is evil!

wlan mac 00:19:d2:* arp 1
# Selecting by the driver seems not to work for wireless.
# So, I'm using MAC.
# MAC matches both wlan0 and wmaster0; that's why I need ARP as well.
$ cat iftab#TIBET 
# -*- conf-space -*-

# wlan0 is evil!

wtibet mac 00:19:d2:* arp 1
# Selecting by the driver seems not to work for wireless.
# So, I'm using MAC.
# MAC matches both wlan0 and wmaster0; that's why I need ARP as well.
$ 

After this, wlan is the default NM-controlled iface. And switching to TIBET works fine. 

(I have not yet tested switching back from TIBET to the default: will it be successfully NM-controlled as a result?)

((Just talk.) I'm going to always follow this principle of naming different "logical" ifaces (for different purposes) on the same device differently -- it's more clear, for example, for writing iptables rules).
Comment 3 Mikhail Efremov 2011-04-13 17:42:46 MSK
I will fix it in Sisyphus at last.
Comment 4 Repository Robot 2011-04-18 18:37:54 MSK
NetworkManager-0.8.3.999-alt1.git20110415 -> sisyphus:

* Fri Apr 15 2011 Mikhail Efremov <sem@altlinux> 0.8.3.999-alt1.git20110415
- etcnet-alt:
    + Added more tests.
    + Handle MAC from iplink file.
    + Handle route metric.
    + Honor current etcnet network profile (closes: #18435).
    + Various fixes.
    + Allow tab as tokens delimiter.
- Add 80-etcnet-post dispatcher script.
- Add 30-efw dispatcher script (closes: #21834).
- Suppress annoying messages.
- init script: Use the new Sleep() method.
- init script: Disconnect all ifaces on stop.
- ntpd hook: Don't create garbage in /tmp.
- Set cp1251 as prefered encoding for Cyrillic langs (closes: #25404).
- upstream git snapshot (NM_0_8 branch).