Package: icewm
Version: 1.2.22-2
Severity: normal
Tags: patch

the NetworkStatusDevice of icewm can't handle IPv6 devices. This is due
to the fact that SIOCGIFCONF only return ipv4 information.

The attached patch creates a workaround for the linux-only
case, by using /proc/net/if_inet6 if it's available.
If it's not available, there's probably not an ipv6 device and we fall
back to SIOCGIFCONF.

Cheers,
Taco.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10-4
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages icewm depends on:
ii  icewm-common              1.2.22-2       wonderful Win95-OS/2-Motif-like wi
ii  imlib11                   1.9.14-17.1    Imlib is an imaging library for X 
ii  libaudiofile0             0.2.6-6        Open-source version of SGI's audio
hi  libc6                     2.3.5-4        GNU C Library: Shared libraries an
ii  libesd0                   0.2.36-1       Enlightened Sound Daemon - Shared 
ii  libfontconfig1            2.3.2-1        generic font configuration library
ii  libfreetype6              2.1.10-1       FreeType 2 font engine, shared lib
ii  libgcc1                   1:4.0.1-6      GCC support library
ii  libice6                   6.8.2.dfsg.1-5 Inter-Client Exchange library
ii  libjpeg62                 6b-10          The Independent JPEG Group's JPEG 
ii  libpng12-0                1.2.8rel-1     PNG library - runtime
ii  libsm6                    6.8.2.dfsg.1-5 X Window System Session Management
ii  libtiff4                  3.7.3-1        Tag Image File Format (TIFF) libra
ii  libungif4g                4.1.3-3        shared library for GIF images (run
ii  libx11-6                  6.8.2.dfsg.1-5 X Window System protocol client li
ii  libxext6                  6.8.2.dfsg.1-5 X Window System miscellaneous exte
ii  libxft2                   2.1.7-1        FreeType-based font drawing librar
ii  libxinerama1              6.8.2.dfsg.1-5 X Window System multi-head display
ii  libxrandr2                6.8.2.dfsg.1-5 X Window System Resize, Rotate and
ii  libxrender1               1:0.9.0-2      X Rendering Extension client libra
ii  xlibs                     6.8.2.dfsg.1-5 X Window System client libraries m
ii  zlib1g                    1:1.2.3-3      compression library - runtime

icewm recommends no packages.

-- no debconf information
diff -ur icewm-1.2.22.debian/src/apppstatus.cc icewm-1.2.22/src/apppstatus.cc
--- icewm-1.2.22.debian/src/apppstatus.cc	2005-07-17 18:00:10.000000000 +0200
+++ icewm-1.2.22/src/apppstatus.cc	2005-08-27 23:50:38.969880227 +0200
@@ -422,6 +422,20 @@
     }
     return false;
 #else
+#ifdef linux
+    FILE *fp;
+    fp = fopen("/proc/net/if_inet6", "r");
+    if ( fp ){
+        char buf[32];
+        while ( fscanf(fp, "%*s %*d %*d %*d %*d %s\n",  &buf) == 1 ){
+            if ( strncmp(fNetDev, buf, strlen(fNetDev))==0 ){
+                close(fp);
+                return true;
+            }
+        }
+        return false;
+    }
+#endif
     char buffer[32 * sizeof(struct ifreq)];
     struct ifconf ifc;
     struct ifreq *ifr;

Reply via email to