mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
fix: fixed gateway regexp for macOS (closes #645)
This commit is contained in:
parent
6755d8c880
commit
9c3790764a
2 changed files with 4 additions and 5 deletions
|
@ -25,7 +25,7 @@ func FindGateway(iface *Endpoint) (*Endpoint, error) {
|
|||
for _, line := range strings.Split(output, "\n") {
|
||||
if line = str.Trim(line); strings.Contains(line, ifName) {
|
||||
m := IPv4RouteParser.FindStringSubmatch(line)
|
||||
if len(m) == IPv4RouteTokens {
|
||||
if len(m) >= IPv4RouteTokens {
|
||||
Debug("FindGateway(%s) line '%s' matched with %v", iface.Name(), line, m)
|
||||
return IPv4RouteIsGateway(ifName, m, func(gateway string) (*Endpoint, error) {
|
||||
if gateway == iface.IpAddress {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue