summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0c50a66)
raw | patch | inline | side by side (parent: 0c50a66)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jul 2008 15:45:31 +0000 (15:45 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jul 2008 15:45:31 +0000 (15:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11530 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/server_server_com.pm | patch | blob | history |
diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm
index 819b10be616029d308908a6de67e40fd6191444e..e980dbad894755abf0a97fa429a00e5977521618 100644 (file)
my $host = $_;
my $ipaddr = '255.255.255.255';
my $port = getservbyname('discard', 'udp');
+ if (not defined $port) {
+ &main::daemon_log("$session_id ERROR: cannot determine port for wol $_: 'getservbyname('discard', 'udp')' failed!",1);
+ next;
+ }
my ($raddr, $them, $proto);
my ($hwaddr, $hwaddr_re, $pkt);
# Allocate socket and send packet
$raddr = gethostbyname($ipaddr);
+ if (not defined $raddr) {
+ &main::daemon_log("$session_id ERROR: cannot determine raddr for wol $_: 'gethostbyname($ipaddr)' failed!", 1);
+ next;
+ }
+
$them = pack_sockaddr_in($port, $raddr);
$proto = getprotobyname('udp');
socket(S, AF_INET, SOCK_DGRAM, $proto) or die "socket : $!";
setsockopt(S, SOL_SOCKET, SO_BROADCAST, 1) or die "setsockopt : $!";
-
send(S, $pkt, 0, $them) or die "send : $!";
close S;
}