Blob Blame History Raw
=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm	2010-07-27 22:03:30 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm	2012-07-09 19:20:00 +0000
@@ -11,7 +11,7 @@
   my $common = $params->{common};
   my @ip;
   foreach (`ifconfig`){
-    if(/^\s*inet add?r\s*:\s*(\S+)/){
+    if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
       ($1=~/127.+/)?next:push @ip, $1
     };
   }

=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2011-02-21 21:55:28 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-07-09 19:20:00 +0000
@@ -157,13 +157,12 @@
       $description = $driver = $ipaddress = $ipmask = $ipgateway = $macaddr = $pcislot = $status =  $type = $virtualdev = undef;
 
     } else { # In a section
-
-      $description = $1 if $line =~ /^(\S+)/; # Interface name
-      $ipaddress = $1 if $line =~ /inet addr:(\S+)/i;
-      $ipmask = $1 if $line =~ /\S*mask:(\S+)/i;
-      $macaddr = $1 if $line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i;
-      $status = 1 if $line =~ /^\s+UP\s/;
-      $type = $1 if $line =~ /link encap:(\S+)/i;
+        $description = $1 if ($line =~ /^(\S+):/ || $line =~ /^(\S+)/); # Interface name
+        $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
+        $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
+        $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+        $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
+        $type = $1 if $line =~ /link encap:(\S+)/i;
     }
 
 

=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-07-09 19:20:00 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-10 21:01:30 +0000
@@ -162,7 +162,7 @@
         $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
         $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
         $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
-        $type = $1 if $line =~ /link encap:(\S+)/i;
+        $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
     }
 
 

=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-10 21:01:30 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-20 22:03:51 +0000
@@ -161,7 +161,7 @@
         $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
         $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
         $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
-        $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
+        $status = $1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
         $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
     }
 

=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm	2012-07-09 19:20:00 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm	2012-09-23 15:42:02 +0000
@@ -11,7 +11,8 @@
   my $common = $params->{common};
   my @ip;
   foreach (`ifconfig`){
-    if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
+    if(/^\s*inet\s*(\S+)\s*netmask/){
+    #if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
       ($1=~/127.+/)?next:push @ip, $1
     };
   }

=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-20 22:03:51 +0000
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-23 15:42:02 +0000
@@ -158,10 +158,10 @@
 
     } else { # In a section
         $description = $1 if ($line =~ /^(\S+):/ || $line =~ /^(\S+)/); # Interface name
-        $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
-        $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
-        $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
-        $status = $1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
+        $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /inet (\S+)\s+netmask/i);
+        $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask (\S+)\s/i);
+        $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+        $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
         $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
     }
 

--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm.old	2012-09-23 18:46:04.177526820 +0200
+++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm	2012-09-23 18:52:24.019984283 +0200
@@ -162,7 +162,8 @@
         $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask (\S+)\s/i);
         $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
         $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
-        $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
+        $type = $1 if ($line =~ /link encap:(\S+)/i);
+        $type = $2 if ($line =~ /^\s+(loop|ether).*\((\S+)\)/i);
     }