[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[2120]
From:       owes () users ! sourceforge ! net
Date:       2008-11-28 11:01:51
Message-ID: E1L616d-0004dU-V0 () d5vjzd1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 2120
          http://ipcop.svn.sourceforge.net/ipcop/?rev=2120&view=rev
Author:   owes
Date:     2008-11-28 11:01:51 +0000 (Fri, 28 Nov 2008)

Log Message:
-----------
Do not use udevadm info but info from /sys/class/net/eth*

Modified Paths:
--------------
    ipcop/trunk/src/installer/networking.c

Modified: ipcop/trunk/src/installer/networking.c
===================================================================
--- ipcop/trunk/src/installer/networking.c	2008-11-28 09:36:57 UTC (rev 2119)
+++ ipcop/trunk/src/installer/networking.c	2008-11-28 11:01:51 UTC (rev 2120)
@@ -151,8 +151,7 @@
 }
 
 
-/*  Get kernel module for device using udevinfo.
-    This looks like a hack (and it is), suggestions as to how to do this differently \
are welcome. +/*  Get kernel module for device using \
                /sys/class/net/interface/device/driver/module.
 */
 static char *getkernelmodule(char *device)
 {
@@ -163,26 +162,16 @@
 
     strcpy(module_buffer, "");
 
-    /*  Ask udevinfo about the device, use grep to limit the output for easier \
                interpretation.
-        We expect one line with something like '    DRIVERS=="e100"'
-    */
-    snprintf(command, STRING_SIZE, "/sbin/udevadm info -a -p /sys/class/net/%s | \
/bin/grep -m 1 \"DRIVERS==\"", device); +    snprintf(command, STRING_SIZE, "ls -l \
/sys/class/net/%s/device/driver/module", device);  
     f = popen(command, "r");
     if (fgets(line, STRING_SIZE, f) != NULL) {
         stripnl(line);
-        if ((ptr = strchr(line, '"')) != NULL) {
-            /* ptr now points to "e100" */
+        if ((ptr = strrchr(line, '/')) != NULL) {
+            /* ptr now points to /e100 */
             ptr++;
-            if (*ptr != '"') {
-                /* got a driver, remove trailing " */
-                char *t = strchr(ptr, '"');
-
-                if (t != NULL) {
-                    *t = 0;
-                }
-                
-                /* temporarily store it */ 
+            if (*ptr) {
+                /* temporarily store driver */ 
                 strcpy(module_buffer, ptr);
             }
         }


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic