From 0b582e0ca240c9a809f2fed2d3bf3bb339f2b365 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 15 Dec 2008 15:44:44 -0800 Subject: Fix 3991: Unable to configure DHCP server on a multinetted interface. --- scripts/VyattaMisc.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/VyattaMisc.pm b/scripts/VyattaMisc.pm index 7072908..89d68d6 100755 --- a/scripts/VyattaMisc.pm +++ b/scripts/VyattaMisc.pm @@ -56,10 +56,12 @@ sub getInterfacesIPadresses { $is_intf_interface_type = 1; } if ($is_intf_interface_type > 0) { - $intf_ips[$intf_ips_index] = + my @ips = (); + @ips = `ip addr show $intf_system 2>/dev/null | grep inet | grep -v inet6 | awk '{print \$2}'`; - if (!($intf_ips[$intf_ips_index] eq '')){ - $intf_ips_index++; + chomp @ips; + if (scalar(@ips) > 0){ + push @intf_ips, @ips; } } } -- cgit v1.2.3