arp-spoofer: Use netip package
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2023-02-19 23:33:26 +01:00
commit 4cf006c4f8
2 changed files with 13 additions and 9 deletions

View file

@ -4,6 +4,7 @@ import (
"flag"
"log"
"net"
"net/netip"
)
func main() {
@ -16,9 +17,9 @@ func main() {
log.Fatal("Unable to find interface to do ARP spoof:", err)
}
ipS := net.ParseIP(*ipspoof)
if ipS == nil {
log.Fatal("No IP given to ARP spoof. Skipping it")
ipS, err := netip.ParseAddr(*ipspoof)
if err != nil {
log.Fatalf("No IP given to ARP spoof (%s). Skipping it", err.Error())
}
// Start ARP spoofing