Skip to content

Commit

Permalink
let's just compare MAC address strings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeshaw committed Jan 31, 2019
1 parent e889ff6 commit 4a91a74
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions gyro.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package main

import (
"bytes"
"log"
"net"
"os"
"os/exec"
"time"
Expand All @@ -23,11 +21,6 @@ func main() {

log.Printf("Starting gyro at %s", time.Now().Format(time.RFC3339))

mac, err := net.ParseMAC(dashMAC)
if err != nil {
log.Fatalf("Unable to parse MAC address %q: %s", dashMAC, err)
}

dhcp, err := dhcp4.NewSnooperConn("0.0.0.0:67")
if err != nil {
log.Fatalf("Cannot start DHCP server: %s", err)
Expand All @@ -43,7 +36,7 @@ func main() {
continue
}

if !bytes.Equal(pkt.HardwareAddr, mac) {
if pkt.HardwareAddr.String() != dashMAC {
continue
}

Expand Down

0 comments on commit 4a91a74

Please sign in to comment.