@@ -197,15 +197,15 @@ sub get_dev_info {
@lines = `ifconfig $eth`;
foreach $line (@lines) {
# get IP address
- if ($line =~ /inet addr/) {
- $line =~ s/^\s+inet addr://g;
+ if ($line =~ /inet (addr)?/) {
+ $line =~ s/^\s+inet (addr)?:?//g;
@fields = split(/\s+/, $line);
$ipv4_addr{$eth} = $fields[0];
}
# get ethernet mtu
- if ($line =~ /MTU:/) {
- $line =~ s/^.*MTU://g;
+ if ($line =~ /(MTU|mtu)[: ]/) {
+ $line =~ s/^.*(MTU|mtu)[: ]//g;
@fields = split(/\s+/, $line);
$eth_mtu{$eth} = $fields[0];
}
net-tools 2.0 has changed the ifconfig format: eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.127 netmask 255.255.255.0 broadcast 10.0.2.255 Fix the regexp to support both older and newer versions of net-tools Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com> --- providers/rxe/rxe_cfg.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)