Skip to content

Commit

Permalink
fix: allow clearing ndp.spoof.neighbour to disable neighbor advertise…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
konradh committed Jan 24, 2024
1 parent 924ff57 commit 5af1be3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ndp_spoof/ndp_spoof.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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::", "",
Expand Down Expand Up @@ -99,6 +99,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)
}
Expand Down

0 comments on commit 5af1be3

Please sign in to comment.