Skip to content

Commit

Permalink
Listen for 234 byte packets too, which is WOL with password
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottESanDiego committed May 13, 2021
1 parent 899e83a commit dd49f4b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions virtwold.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
// Assumes the VM has a static MAC configured
// Assumes libvirtd connection is at /var/run/libvirt/libvirt-sock
//
// Filters on len=144 (WOL packet) and len=234 (WOL packet with password)

package main

Expand All @@ -25,9 +27,9 @@ import (
)

func main() {
var iface string // Interface we'll listen on
var buffer = int32(1600) // Buffer for packets received
var filter = "udp and broadcast and len = 144" // PCAP filter to catch UDP WOL packets
var iface string // Interface we'll listen on
var buffer = int32(1600) // Buffer for packets received
var filter = "udp and broadcast and (len = 144 or len=234)" // PCAP filter to catch UDP WOL packets

flag.StringVar(&iface, "interface", "", "Network interface name to listen on")
flag.Parse()
Expand Down

0 comments on commit dd49f4b

Please sign in to comment.