mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
Fix the IPv4RouteParser regular expression
The IPv4RouteParser regular expression fails to match when there is nothing after the interface name like in the following case: $ ip route default via 10.1.52.1 dev eth0 10.1.52.0/23 dev eth0 proto kernel scope link src 10.1.52.148
This commit is contained in:
parent
85c2d0b4fa
commit
47c37c066c
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
// only matches gateway lines
|
||||
var IPv4RouteParser = regexp.MustCompile(`^(default|[0-9\.]+)\svia\s([0-9\.]+)\sdev\s(\w+)\s.*$`)
|
||||
var IPv4RouteParser = regexp.MustCompile(`^(default|[0-9\.]+)\svia\s([0-9\.]+)\sdev\s(\w+)(?:\s.*|)$`)
|
||||
var IPv4RouteTokens = 4
|
||||
var IPv4RouteCmd = "ip"
|
||||
var IPv4RouteCmdOpts = []string{"route"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue