Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 113830

Summary: associate_order="forceany" doesn't force like associate_order="preferredonly"
Product: Gentoo Linux Reporter: Daevid Vincent <daevid>
Component: [OLD] baselayoutAssignee: Roy Marples (RETIRED) <uberlord>
Status: VERIFIED TEST-REQUEST    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fixes the issue

Description Daevid Vincent 2005-11-28 11:55:19 UTC
I run Gentoo with an internal mini-pci
 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC
 (rev 01)

 *  net-wireless/madwifi-driver
       Latest version available: 0.1_pre20050420-r1
       Latest version installed: 0.1_pre20050420-r1
 *  net-wireless/madwifi-tools
       Latest version available: 0.1_pre20050420
       Latest version installed: 0.1_pre20050420

 i set in /etc/conf.d/wireless the flag
 preferred_aps=( "MATRIX" "IN" )
 first being my home network, the second being my work network.
 if i set the associate_order flag to 'any' or 'forceany', while at my
 home, i would expect to associate to 'MATRIX'. However, more often than
 not, it tries to associate with a neighbors WAP. If I set to
 'preferredonly', then i get onto my network.

 associate_order="preferredonly"
 #associate_order="forceany"
 #associate_order_ath0="any"

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




I posted this on the madwifi bug tracker and this is the reply I got:

#180: associate_order="forceany" doesn't force like 
associate_order="preferredonly"
--------------------------------+-------------------------------------------
  Reporter:  daevid@daevid.com  |       Owner:             
      Type:  defect             |      Status:  new        
  Priority:  minor              |   Milestone:             
 Component:  madwifi: other     |     Version:  madwifi-old
Resolution:                     |    Keywords:             
--------------------------------+-------------------------------------------
Comment (by mrenzmann):

 This is a Gentoo-specific problem, related to the scripts that come along
 with the driver or the distribution. So our bug tracker seems to be the
 wrong place to report this problem. Unless the driver shows unexpected
 behaviour (in this case you should reopen this ticket and add relevant
 details in a comment) you should either contact the package maintainer or
 file a bug in Gentoo's [http://bugs.gentoo.org/ bugzilla].

-- 
Ticket URL: <http://madwifi.org/ticket/180>
Madwifi <http://madwifi.org/>
Multiband Atheros Driver for Wireless Fidelity
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-11-28 12:04:28 UTC
So don't set forceany, why do you expect two different options to behave the
same? Read the comments in wireless.example.
Comment 2 Daevid Vincent 2005-11-28 12:42:22 UTC
I don't expect them to behave the same. I expect them to work as described.

According to the documentation and also the wiki page here:
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4

"any", just as it says, will associate with ANY AP it finds first basically. 
Not very helpful when I'm at home or work, where there are many APs around and 
I want to attach to a very specific one. So, I can't use that one.

any - Default behaviour 

preferredonly - We will only connect to visible APs in the preferred list 

forcepreferred - We will forceably connect to APs in the preferred order if 
they are not found in a scan  

forcepreferredonly - Do not scan for APs, instead just try to connect to each 
one in order  

forceany - Same as forcepreferred + connect to any other available AP 

If I use just 'forcepreferred', then I have to change this freakin' file every 
time I'm out at a coffee shop or something.

The choice "foreany" is exactly what I want, and all I'm asking for is the 
driver to work as defined. Connect to my preferred networks (IN ORDER) and 
then if none are found, connect to any found.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-11-29 01:45:29 UTC
Reporter neglected to attach emerge --info
Comment 4 Daevid Vincent 2005-12-04 20:33:25 UTC
Here is my 'emerge --info', however I fail to see what that has to do with
anything. The driver compiles and installs fine. I'm online using it now. The
problem is that a config setting isn't working as documented. It's a logic flaw,
not a compilation problem.

emerge --info
Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2,
2.6.14-gentoo-r2 i686)
=================================================================
System uname: 2.6.14-gentoo-r2 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
Gentoo Base System version 1.6.13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.2.3-r6, 2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown
/usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks fixpackages keepwork parallel-fetch
sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/
http://gentoo.mirrors.tds.net/gentoo http://gentoo.chem.wisc.edu/gentoo/
ftp://213.186.33.38/gentoo-distfiles/"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aalib acl acpi alsa apm arts audiofile avi berkdb bitmap-fonts bzip2
cdr crypt curl eds emboss encode esd evo exif expat fam flac foomaticdb fortran
gd gdbm ggi gif glut gmp gnome gpm gstreamer gtk gtk2 idn imagemagick imlib ipv6
java jpeg kde lcms libg++ libwww mad mhash mikmod mmx mng motif mozilla mp3 mpeg
mysql ncurses nls nptl nptlonly nvidia ogg oggvorbis opengl oss pam pcmcia pcre
pda pdflib perl png python qt quicktime readline recode ruby samba sdl slang
spell sse ssl svga tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb
vhosts vorbis wifi xine xml2 xmms xv xvid zlib linguas_en userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 5 Roy Marples (RETIRED) gentoo-dev 2005-12-04 23:20:51 UTC
Created attachment 74085 [details, diff]
Fixes the issue
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-12-04 23:21:22 UTC
Please test the above patch 
Comment 7 Daevid Vincent 2005-12-05 00:13:24 UTC
(In reply to comment #6)
> Please test the above patch 

I would love to, please give me exact details on how to apply this and re-
compile. I'm a user of gentoo, not a developer.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2005-12-05 01:47:10 UTC
cd /
patch -p0 < /path/to/patch
Comment 9 Daevid Vincent 2005-12-05 01:57:38 UTC
(In reply to comment #8)
> cd /
> patch -p0 < /path/to/patch

really? then how do I 'emerge'? I've tried this kind of thing before and it 
always complains about MD5 failures and stuff...
Comment 10 Roy Marples (RETIRED) gentoo-dev 2005-12-05 02:11:03 UTC
It patches your live filesystem as it's only a script and not a binary 
 
However, it slots quite happily into an ebuild also 
Edit /usr/portage/sys-apps/baselayout/baselayout-1.11.13.ebuild and put this 
at the end of the  src_unpack() function 
 
epatch "/path/to/patch" 
 
Then you can emerge it with the patch included. 
Comment 11 Daevid Vincent 2005-12-15 14:42:08 UTC
finally got around to trying this, but it doesn't seem to work still...   
   
locutus ~ # cd /   
locutus / # patch -p0 < /root/iwconfig.patch   
patching file lib/rcscripts/net.modules.d/iwconfig   
   
in file /etc/conf.d/wireless   
preferred_aps=( "MATRIX" "IN" "RedLine" )   
   
I would now expect to connect to "IN" as that is my work's AP   
   
locutus conf.d # /etc/init.d/net.ath0 start   
 * Caching service dependencies ...                                                                                               
[ ok ]   
 * Starting ath0   
 *   Loading networking modules for ath0   
 *     modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa   
 *       iwconfig provides wireless   
 *       ifconfig provides interface   
 *       dhcpcd provides dhcp   
 *   Configuring wireless network for ath0   
 *   Connecting to "ANY" (WEP Disabled) ...                                                                                       
[ ok ]   
 *     ath0 connected to "abcpacific" at 00:06:25:A4:34:AE   
 *     in managed mode (WEP disabled)   
 *   Configuring ath0 for "abcpacific" ...                                                                                        
[ ok ]   
 *   Bringing up ath0   
 *     Configuration not set for ath0 - assuming dhcp   
 *     dhcp   
 *       Running dhcpcd ...                                                                                                       
[ ok ]   
 *       ath0 received address 192.168.1.122   
locutus conf.d # /etc/init.d/net.ath0 restart   
 * Stopping ath0   
 *   Loading networking modules for ath0   
 *     modules: iwconfig essidnet iptunnel ifconfig iproute2 dhcpcd pump apipa   
 *   Bringing down ath0   
 *     Stopping dhcpcd on ath0 ...                                                                                                
[ ok ]   
 *     Shutting down ath0 ...                                                                                                     
[ ok ]   
 * Starting ath0   
 *   Loading networking modules for ath0   
 *     modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa   
 *       iwconfig provides wireless   
 *       ifconfig provides interface   
 *       dhcpcd provides dhcp   
 *   Configuring wireless network for ath0   
 *   Connecting to "ANY" (WEP Disabled) ...                                                                                       
[ ok ]   
 *     ath0 connected to "testlab_1100b" at 00:40:96:A4:96:43   
 *     in managed mode (WEP disabled)   
 *   Configuring ath0 for "testlab_1100b" ...                                                                                     
[ ok ]   
 *   Bringing up ath0   
 *     Configuration not set for ath0 - assuming dhcp   
 *     dhcp   
 *       Running dhcpcd ...                                                                                                       
[ ok ]   
 *       ath0 received address 172.16.2.20   
  
 why does it always say ' Connecting to "ANY" (WEP Disabled) ... '  
   
I will try this from home and see if it works there, as that was the original 
place I saw the problems (same notebook computer though) 
Comment 12 Roy Marples (RETIRED) gentoo-dev 2005-12-15 15:14:13 UTC
I guess you have essid_ath0="ANY" set somewhere ..... 
Don't set essid_ath0 at all! 
Comment 13 Daevid Vincent 2005-12-15 15:18:33 UTC
Well hot damn... what do you know. 

I feel stupid now. I bet that was the problem all along.

Everything just worked now!