-
Notifications
You must be signed in to change notification settings - Fork 832
net/wol: make UDP port configurable (default 9) #5448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
26b3484
7d154ec
24a3de4
42f587c
6d4f941
fa0ebfe
e2ad246
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| PLUGIN_NAME= wol | ||
| PLUGIN_VERSION= 2.5 | ||
| PLUGIN_REVISION= 4 | ||
| PLUGIN_REVISION= 5 | ||
|
touzenesmy marked this conversation as resolved.
Outdated
|
||
| PLUGIN_DEPENDS= wol | ||
| PLUGIN_COMMENT= Wake on LAN Service | ||
|
|
||
| .include "../../Mk/plugins.mk" | ||
| .include "../../Mk/plugins.mk" | ||
|
touzenesmy marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,9 @@ private function wakeHostByNode($wolent, &$result) | |
| return $result; | ||
| } | ||
| $broadcast_ip = escapeshellarg($this->calculateSubnetBroadcast($ipaddr, $cidr)); | ||
| $result['status'] = trim($backend->configdRun("wol wake {$broadcast_ip} " . escapeshellarg((string)$wolent->mac))); | ||
| $port = escapeshellarg((string)$wolent->port); | ||
| $mac = escapeshellarg((string)$wolent->mac); | ||
| $result['status'] = trim($backend->configdRun("wol wake {$port} {$broadcast_ip} {$mac}")); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to be rewritten for configdpRun() second argument is the array with all unescaped values.. ideally from getValue() and not string cast |
||
| } | ||
|
|
||
| private function getInterfaceIP($if) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| <model> | ||
| <mount>//wol</mount> | ||
| <description>Wake On Lan configuration</description> | ||
| <version>1.0.0</version> | ||
| <version>1.0.1</version> | ||
| <items> | ||
| <wolentry type="ArrayField"> | ||
| <interface type="InterfaceField"> | ||
|
|
@@ -16,7 +16,14 @@ | |
| <Default>00:00:00:00:00:00</Default> | ||
| <ValidationMessage>Should be 6 groups of 2 hex characters (a-fA-F0-9) separated by ':'.</ValidationMessage> | ||
| </mac> | ||
| <port type="IntegerField"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give PortField a try here https://docs.opnsense.org/development/frontend/models_fieldtypes.html#portfield
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, will be in next commit. Thanks for the input ! |
||
| <Required>Y</Required> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the issue with requiring this is now the user needs to input it or else validation fails. "9" isn't added automatically and the migration uses '4000' which would be automatic if we used that default ;)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <Default>9</Default> | ||
| <MinimumValue>1</MinimumValue> | ||
| <MaximumValue>65535</MaximumValue> | ||
| <ValidationMessage>UDP port must be an integer between 1 and 65535.</ValidationMessage> | ||
| </port> | ||
| <descr type="TextField"/> | ||
| </wolentry> | ||
| </items> | ||
| </model> | ||
| </model> | ||
|
touzenesmy marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [wake] | ||
| command:/usr/local/bin/wol -i | ||
| parameters: %s %s | ||
| command:/usr/local/bin/wol | ||
| parameters: -p %s -i %s %s | ||
| type:script | ||
| description:Wake-On-LAN for host with broadcast IP and MAC | ||
|
touzenesmy marked this conversation as resolved.
Outdated
|
||
| message:Waking up host %s %s | ||
| message:Waking up host on port %s with broadcast %s mac %s | ||
|
touzenesmy marked this conversation as resolved.
Outdated
|
||


Uh oh!
There was an error while loading. Please reload this page.