ports/83381: [MAINTAINER] net/wmwifi: Unbreak with fwe or plip interfaces

Ulrich Spoerlein q at galgenberg.net
Wed Jul 13 13:50:14 UTC 2005


>Number:         83381
>Category:       ports
>Synopsis:       [MAINTAINER] net/wmwifi: Unbreak with fwe or plip interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 13 13:50:13 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Spoerlein
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD roadrunner 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Sun Jul  3 14:07:41 CEST
>Description:
The code walking the interface list will issue the SIOCGIFMEDIA ioctl
to every interface. This ioctl will fail on if_fwe and if_plip (and
probably others). Therefore make the failing ioctl() non-fatal and
issue a warning only.

Reported and tested by: martinko and Tuc at Beach House

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- wmwifi-0.4.patch begins here ---
Index: files/patch-wireless.c
===================================================================
RCS file: /home/ncvs/ports/net/wmwifi/files/patch-wireless.c,v
retrieving revision 1.1
diff -u -u -r1.1 patch-wireless.c
--- files/patch-wireless.c	7 Jul 2005 21:22:36 -0000	1.1
+++ files/patch-wireless.c	13 Jul 2005 13:44:24 -0000
@@ -1,5 +1,5 @@
---- src/wireless.c.orig	Sat Jul  2 14:41:48 2005
-+++ src/wireless.c	Sat Jul  2 14:41:53 2005
+--- src/wireless.c.orig	Tue Mar  9 20:39:17 2004
++++ src/wireless.c	Mon Jul 11 10:57:43 2005
 @@ -143,6 +143,7 @@
  
  	max = get_max_ifs();
@@ -8,3 +8,28 @@
  
  	if (old > max)
  		old = max; /* just be sure to not be out of bounds */
+@@ -193,9 +194,11 @@
+ 
+ 		if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
+ 		{
+-			perror("ioctl");
++			char str[128];
++			snprintf(str, 128, "ioctl for interface %s failed", ifmr.ifm_name);
+ 			close(s);
+-			exit(1);
++			warn(str);
++			continue;
+ 		}
+ 		close(s);
+ 		/* we cannot monitor interfaces in hostap mode, so just
+@@ -207,6 +210,10 @@
+ 			found++;
+ 		}
+ 	}
++
++	if (!found)
++	  return -1;
++
+ 	return index;
+ }
+ /* how many interfaces do we have? this includes non-wireless! */
Index: files/patch-wmwifi.c
===================================================================
RCS file: /home/ncvs/ports/net/wmwifi/files/patch-wmwifi.c,v
retrieving revision 1.1
diff -u -u -r1.1 patch-wmwifi.c
--- files/patch-wmwifi.c	7 Jul 2005 21:22:36 -0000	1.1
+++ files/patch-wmwifi.c	13 Jul 2005 13:44:24 -0000
@@ -1,10 +1,35 @@
---- src/wmwifi.c.orig	Sat Jul  2 14:54:17 2005
-+++ src/wmwifi.c	Sat Jul  2 14:54:21 2005
-@@ -67,6 +67,7 @@
+--- src/wmwifi.c.orig	Mon Jul 11 10:58:32 2005
++++ src/wmwifi.c	Mon Jul 11 11:01:27 2005
+@@ -67,9 +67,11 @@
      int ncolor = 0;
      struct wifi wfi;
  
+-	/* find a valid wireless interface */
 +    bzero(&wfi, sizeof(wfi));
- 	/* find a valid wireless interface */
++    /* find a valid wireless interface */
  #if __FreeBSD__
- 	wfi.ifnum = get_wlaniface(0, 1);
+-	wfi.ifnum = get_wlaniface(0, 1);
++    if ((wfi.ifnum = get_wlaniface(0, 1)) < 0)
++      errx(1, "No wireless interface found!");
+ #else
+     wfi.ifnum = 0;
+ #endif
+@@ -146,14 +148,16 @@
+ 		    break;
+ 		case Button2:
+ #ifdef __FreeBSD__
+-			wfi.ifnum = get_wlaniface(wfi.ifnum, 1);
++		    if ((wfi.ifnum = get_wlaniface(wfi.ifnum, 1)) < 0)
++			errx(1, "No wireless interface found!");
+ #else
+ 		    next_if(&wfi);
+ #endif
+ 		    break;
+ 		case Button3:
+ #ifdef __FreeBSD__
+-			wfi.ifnum = get_wlaniface(wfi.ifnum, -1);
++		    if ((wfi.ifnum = get_wlaniface(wfi.ifnum, -1)) < 0)
++		      errx(1, "No wireless interface found!");
+ #else
+ 		    prev_if(&wfi);
+ #endif
--- wmwifi-0.4.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list