Package: wavemon
Version: 0.4.0b-11
Severity: normal
Tags: patch

I have two wireless cards on my notebook: eth1 and eth2. Despite I
specify the "-i eth2" option, wavemon gets signal and noise levels
from the eth1 interface. The summary instead displays the correct
interface name.

I traced the problem into iw_if.c: the function s_handler() calls
iw_getstat() with the first parameter being "eth1", ignoring command
line and configuration file.

I changed the first parameter in "conf->ifname", and now the program
works fine:

iw_getstat(conf->ifname, &iw_stats, iw_stats_cache, conf->slotsize, 
conf->random);

I cannot guarantee that this is a perfect patch, but it is working
here.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-686 (SMP w/1 CPU core)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages wavemon depends on:
ii  libc6                     2.6.1-1+b1     GNU C Library: Shared libraries
ii  libncurses5               5.6+20070908-1 Shared libraries for terminal hand

wavemon recommends no packages.

-- no debconf information
--- wavemon-0.4.0b.orig/iw_if.c
+++ wavemon-0.4.0b/iw_if.c
@@ -481,7 +481,7 @@
 
 void s_handler(int signum)
 {
-    iw_getstat(ll_get(((struct conf_item *)ll_get(conf_items, 0))->list, 0), 
&iw_stats, iw_stats_cache, conf->slotsize, conf->random);
+    iw_getstat(conf->ifname, &iw_stats, iw_stats_cache, conf->slotsize, 
conf->random);
     if (iw_stat_redraw) iw_stat_redraw();
 }
 

Reply via email to