From 5574e028dc0ed802d4954b577151cc09c9687ee5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 3 Sep 2020 12:06:07 +0200 Subject: [rebootcontrol] WOL: Make UDP-Port and c2c discovery configurable The port setting only applies to WOL-packets sent from the satellite server. Testing the reachability of client subnets between each other is usually pointless, since a subnet that is reachable from another subnet can also be reached form the satelitte server, unless some fancy firewall rules are in place. --- modules-available/rebootcontrol/inc/rebootcontrol.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules-available/rebootcontrol/inc') diff --git a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php index bb3bcd0c..a8018004 100644 --- a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php +++ b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php @@ -7,6 +7,10 @@ class RebootControl const KEY_AUTOSCAN_DISABLED = 'rebootcontrol.disable.scan'; + const KEY_SCAN_CLIENT_TO_CLIENT = 'rebootcontrol.scan.c2c'; + + const KEY_UDP_PORT = 'rebootcontrol.port'; + const REBOOT = 'REBOOT'; const KEXEC_REBOOT = 'KEXEC_REBOOT'; const SHUTDOWN = 'SHUTDOWN'; @@ -240,10 +244,15 @@ class RebootControl if (!is_array($macaddr)) { $macaddr = [$macaddr]; } + $port = (int)Property::get(RebootControl::KEY_UDP_PORT); + if ($port < 1 || $port > 65535) { + $port = 9; + } return Taskmanager::submit('WakeOnLan', [ 'ip' => $bcast, 'password' => $passwd === false ? '' : $passwd, 'macs' => $macaddr, + 'port' => $port, ]); } -- cgit v1.2.3-55-g7522