Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179422 - Bad selection of duplicated access points in iwconfig.sh
Summary: Bad selection of duplicated access points in iwconfig.sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-22 13:04 UTC by Patricio Mendoza
Modified: 2007-07-11 15:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patricio Mendoza 2007-05-22 13:04:56 UTC
Then multiple APs with the same MAC address exists, the net.ethX init.d script (using functions defined in other scripts) selects the AP with the best quality.

The iwconfig.sh script has the routine to strip duplicates, but it has an error: it always pick the last AP. There is an error in the quality comparision and selection.

Reproducible: Always

Steps to Reproduce:
I can't reproduce it, I don't have APs with the same MAC. But it could be reproduced if:

1. Put near one AP in a place with APs with the same MAC
2. Start net.ethX script with --verbose option (to see the list of AP)
3. Look at the selected AP. It should be the last (not necessarily the best one) 


Expected Results:  
It's supposed to select the best AP instead of the last one. 

I have the package: baselayout-1.12.9-r2

A diff of a proposed solution:

-------------------------------------------------------------------------------
*** iwconfig.sh.orig    2007-05-22 08:24:18.000000000 -0400
--- /lib/rcscripts/net/iwconfig.sh      2007-05-22 08:54:49.000000000 -0400
*************** iwconfig_scan() {
*** 531,537 ****
                for (( j=i+1; j<x; j++)) ; do
                        if [[ ${mac[i]} == "${mac[j]}" ]] ; then
                                if [[ ${qual[i]} -gt ${qual[j]} ]] ; then
!                                       y="${j}"
                                else
                                        y="${j}"
                                fi
--- 531,537 ----
                for (( j=i+1; j<x; j++)) ; do
                        if [[ ${mac[i]} == "${mac[j]}" ]] ; then
                                if [[ ${qual[i]} -gt ${qual[j]} ]] ; then
!                                       y="${i}"
                                else
                                        y="${j}"
                                fi
-------------------------------------------------------------------------------

emerge --info

Portage 2.1.2.2 (default-linux/x86/2007.0/desktop, gcc-4.1.1/vanilla, glibc-2.5-r2, 2.6.20-gentoo-r1 i686)
=================================================================
System uname: 2.6.20-gentoo-r1 i686 Intel(R) Pentium(R) M processor 1.60GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Wed, 16 May 2007 13:00:01 +0000
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.3.5-r3, 2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=pentium-m -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://www.las.ic.unicamp.br/pub/gentoo/"
LC_ALL="en_US.UTF-8"
LINGUAS="es en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/portage-xgl /usr/portage/local/layman/xeffects"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac aalib acl acpi aim alsa amr arts bash-completion berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dga dri dvd dvdr dvdread eds emacs emboss encode esd evo evolution exif fam fbcon firefox fortran gdbm gif gmail gnome gphoto2 gpm gstreamer gtk gtk2 hal iconv icq ieee1394 imagemagick imap imlib ipv6 isdnlog jabber jpeg kde kerberos ldap libg++ mad maildir mbox midi mikmod mime mmap mmx motif mp3 mpeg msn mule nas ncurses nls nptl nptlonly nsplugin ogg opengl oscar oss pam pcre pdf pdflib perl png pop pppd python qt qt3 qt3support qt4 quicktime readline reflection samba sasl sdl session smartcard sockets sox spell spl sse sse2 ssl svg tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts unicode usb v4l vcd vorbis wifi win32codecs wmf wxwindows x86 xinerama xml xorg xpm xv xvid yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es en" USERLAND="GNU" VIDEO_CARDS="fbdev i810"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-07-11 15:11:55 UTC
We have this fixed in our svn repo now, thanks.