fix: do not attempt mac lookup if gateway is empty

This commit is contained in:
Simone Margaritelli 2024-08-18 13:43:43 +02:00
parent 23e074b686
commit b0d56e4f5e

View file

@ -16,7 +16,7 @@ func FindGateway(iface *Endpoint) (*Endpoint, error) {
if gateway == iface.IpAddress {
Debug("gateway is the interface")
return iface, nil
} else {
} else if gateway != "" {
// we have the address, now we need its mac
mac, err := ArpLookup(iface.Name(), gateway, false)
if err != nil {