Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Nov 2003 19:33:21 +0100 (CET)
From:      Markus Brueffer <brueffer@phoenix-systems.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/59089: [maintainer update] deskutils/superkaramba: improve network device detection
Message-ID:  <20031109183321.BBB051F9@maquis.hitnet.rwth-aachen.de>
Resent-Message-ID: <200311091840.hA9Ie68e097304@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59089
>Category:       ports
>Synopsis:       [maintainer update] deskutils/superkaramba: improve network device detection
>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:   Sun Nov 09 10:40:06 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Markus Brueffer
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD cheops.phoenix 5.1-CURRENT FreeBSD 5.1-CURRENT #10: Tue Nov 4 20:05:23 CET 2003 brueffer@cheops.phoenix:/usr/obj/usr/src/sys/CHEOPS i386

>Description:
	Update port: deskutils/superkaramba:

	- update patch-networkdevice.cpp to improve network device detection
	- bump PORTREVISION	

>How-To-Repeat:
>Fix:

--- superkaramba.diff begins here ---
diff -ruN superkaramba.orig/Makefile superkaramba/Makefile
--- superkaramba.orig/Makefile	Sun Nov  9 18:45:10 2003
+++ superkaramba/Makefile	Sun Nov  9 18:46:07 2003
@@ -6,6 +6,7 @@
 
 PORTNAME=		superkaramba
 PORTVERSION=		0.33
+PORTREVISION=		1
 CATEGORIES=		deskutils kde
 MASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	netdragon
diff -ruN superkaramba.orig/files/patch-networksensor.cpp superkaramba/files/patch-networksensor.cpp
--- superkaramba.orig/files/patch-networksensor.cpp	Sun Nov  9 18:45:10 2003
+++ superkaramba/files/patch-networksensor.cpp	Sun Nov  9 18:45:26 2003
@@ -1,6 +1,6 @@
 --- src/networksensor.cpp.orig	Mon Apr 21 15:17:03 2003
-+++ src/networksensor.cpp	Sat Nov  8 19:51:04 2003
-@@ -7,14 +7,67 @@
++++ src/networksensor.cpp	Sun Nov  9 18:34:35 2003
+@@ -7,14 +7,65 @@
   *   the Free Software Foundation; either version 2 of the License, or     *
   *   (at your option) any later version.                                   *
   ***************************************************************************/
@@ -11,7 +11,6 @@
 +#include <net/route.h>
 +#endif
 +
-+#include <stdio.h>
  #include "networksensor.h"
  
  NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval )
@@ -40,27 +39,26 @@
 +    */
 +
 +   if_number = -1;
++   int if_gw = -1;
 +
 +   for (int i = 1; i <= n; ++i) {
 +      name[4] = i;
 +      /* Get data for iface-number i */
 +      sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0);
 +
-+      if ( device == "" ) {
-+         /* Does the interface hold the default route? */
-+         if ( if_mib.ifmd_flags & RTF_GATEWAY ) {
-+            if_number = i;
-+            break;
-+         }
-+      }
-+      else {
-+         /* We found the right interface? */
-+         if (QString(if_mib.ifmd_name) == device) {
-+            if_number = i;
-+            break;
-+         }
++      /* We found the right interface? */
++      if (QString(if_mib.ifmd_name) == device) {
++         if_number = i;
++         break;
 +      }
++
++      /* Does the interface hold the default route? */
++      if ( if_mib.ifmd_flags & RTF_GATEWAY )
++         if_gw = i;
 +   }
++
++   if ((if_number == -1) && (if_gw != -1))
++      if_number = if_gw;
 +#else
     if( device == "" )
     	device = "eth0";
@@ -69,7 +67,7 @@
       getInOutBytes(receivedBytes,transmittedBytes);
      netTimer.start();
  
-@@ -24,6 +77,27 @@
+@@ -24,6 +75,27 @@
  }
  void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const
  {
@@ -97,7 +95,7 @@
      QFile file("/proc/net/dev");
      QString line;
      if ( file.open(IO_ReadOnly | IO_Translate) )
-@@ -49,6 +123,7 @@
+@@ -49,6 +121,7 @@
          }
      file.close();
      }
--- superkaramba.diff ends here ---



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031109183321.BBB051F9>