1
0
mirror of https://github.com/bettercap/bettercap.git synced 2025-03-12 04:36:03 -07:00

Merge pull request from konradh/ndp-spoof-unset-neighbour

Fix: Allow clearing ndp.spoof.neighbour to disable neighbor advertisements
This commit is contained in:
Simone Margaritelli 2024-08-07 16:35:22 +02:00 committed by GitHub
commit 9bf1474615
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -37,7 +37,7 @@ func NewNDPSpoofer(s *session.Session) *NDPSpoofer {
mod.AddParam(session.NewStringParameter("ndp.spoof.neighbour",
"fe80::1",
session.IPv6Validator,
`^([:a-fA-F0-9]{6,})?$`,
"Neighbour IPv6 address to spoof, clear to disable NA."))
mod.AddParam(session.NewStringParameter("ndp.spoof.prefix", "d00d::", "",
@ -103,6 +103,8 @@ func (mod *NDPSpoofer) Configure() error {
} else {
if err, neigh = mod.StringParam("ndp.spoof.neighbour"); err != nil {
return err
} else if neigh == "" {
mod.neighbour = nil
} else if mod.neighbour = net.ParseIP(neigh); mod.neighbour == nil {
return fmt.Errorf("can't parse neighbour address %s", neigh)
}