summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ebbcd7d)
raw | patch | inline | side by side (parent: ebbcd7d)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Sep 2009 22:21:57 +0000 (22:21 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Sep 2009 22:21:57 +0000 (22:21 +0000) |
- Tested on my box and seems to work
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14216 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14216 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
index b3a43167718f6a03a631abf084648b2af918c64e..1301f6605f51f48e7b584d3117d6e5a2d22ad9bb 100644 (file)
# Eat header line
shift @ifs;
chomp @ifs;
+ my $iffallback = '';
+
+ # linux-vserver might have * as Iface due to hidden interfaces, set a default
+ foreach my $line(@ifs) {
+ my ($Iface,$Destination,$Gateway,$Flags,$RefCnt,$Use,$Metric,$Mask,$MTU,$Window,$IRTT)=split(/\s/, $line);
+ if ($Iface =~ m/^[^\*]+$/) {
+ $iffallback = $Iface;
+ }
+ }
+
foreach my $line(@ifs) {
my ($Iface,$Destination,$Gateway,$Flags,$RefCnt,$Use,$Metric,$Mask,$MTU,$Window,$IRTT)=split(/\s/, $line);
my $destination;
my $mask;
my ($d,$c,$b,$a)=unpack('a2 a2 a2 a2', $Destination);
+ if ($Iface =~ m/^[^\*]+$/) {
+ $iffallback = $Iface;
+ }
$destination= sprintf("%d.%d.%d.%d", hex($a), hex($b), hex($c), hex($d));
($d,$c,$b,$a)=unpack('a2 a2 a2 a2', $Mask);
$mask= sprintf("%d.%d.%d.%d", hex($a), hex($b), hex($c), hex($d));
if(new NetAddr::IP($remote_ip)->within(new NetAddr::IP($destination, $mask))) {
# destination matches route, save mac and exit
- $result= &get_ip($Iface);
+ #$result= &get_ip($Iface);
+
+ if ($Iface =~ m/^\*$/ ) {
+ $result= &get_ip($iffallback);
+ } else {
+ $result= &get_ip($Iface);
+ }
last;
}
}