summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd79299)
raw | patch | inline | side by side (parent: bd79299)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 19:40:01 +0000 (19:40 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 19:40:01 +0000 (19:40 +0000) |
- OpenSuse Closes #799
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17311 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17311 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history | |
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 992dda4c3cbadf1065374365ae6bae7b9d7520ad..9417ecb16a6d00b29de1ad71887647951b0a405d 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
use XML::Simple;
use File::Basename;
use File::Spec;
+use Net::ARP;
use Fcntl;
# Workaround: need pure perl to make it work with UTF-8 :-(
$result = "00:00:00:00:00:00";
}
} else {
- my $SIOCGIFHWADDR= 0x8927; # man 2 ioctl_list
-
# A configured MAC Address should always override a guessed value
if ($client_mac_address and length($client_mac_address) > 0 and not($client_mac_address eq "00:00:00:00:00:00")) {
$result= $client_mac_address;
}
else {
- socket SOCKET, PF_INET, SOCK_DGRAM, getprotobyname('ip')
- or die "socket: $!";
-
- if(ioctl SOCKET, $SIOCGIFHWADDR, $ifreq) {
- my ($if, $mac)= unpack 'h36 H12', $ifreq;
-
- if (length($mac) > 0) {
- $mac=~ m/^([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/;
- $mac= sprintf("%s:%s:%s:%s:%s:%s", $1, $2, $3, $4, $5, $6);
- $result = $mac;
- }
- }
+ $result = Net::ARP::get_mac($ifreq);
}
}
}
index 197a09cc6e0625771a61e0302786c786642cffaf..8d3caad0a4452ca9dafedff61cc99c4bcfa8402c 100644 (file)
sub get_mac_for_interface {
my $ifreq= shift;
my $result;
- if ($ifreq && length($ifreq) > 0) {
+ if ($ifreq && length($ifreq) > 0) {
if($ifreq eq "all") {
$result = "00:00:00:00:00:00";
} else {