GUACAMOLE-513: Make packet size a constant.

This commit is contained in:
Nick Couchman 2020-03-18 15:34:01 -04:00
parent 45e46bd245
commit 0feda1fa2f
2 changed files with 8 additions and 1 deletions

View File

@ -40,5 +40,12 @@
*/
#define GUAC_WOL_DEFAULT_WAIT_TIME 60
/**
* The size of the magic Wake-on-LAN packet to send to wake a remote host. This
* consists of 6 bytes of 0xFF, and then the MAC address repeated 16 times.
* https://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet
*/
#define GUAC_WOL_PACKET_SIZE 102
#endif /* GUAC_WOL_CONSTANTS_H */

View File

@ -99,7 +99,7 @@ static ssize_t __guac_wol_send_packet(const char* broadcast_addr,
int guac_wol_wake(const char* mac_addr, const char* broadcast_addr) {
unsigned char wol_packet[102];
unsigned char wol_packet[GUAC_WOL_PACKET_SIZE];
unsigned int dest_mac[6];
/* Parse mac address and return with error if parsing fails. */