mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
refact: refactored module status checks in Configure methods for consistency
This commit is contained in:
parent
a8e6b497a3
commit
1e7d99433e
13 changed files with 52 additions and 53 deletions
|
@ -77,6 +77,10 @@ func (s DHCP6Spoofer) Author() string {
|
|||
func (s *DHCP6Spoofer) Configure() error {
|
||||
var err error
|
||||
|
||||
if s.Running() {
|
||||
return session.ErrAlreadyStarted
|
||||
}
|
||||
|
||||
if s.Handle, err = pcap.OpenLive(s.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -354,9 +358,7 @@ func (s *DHCP6Spoofer) onPacket(pkt gopacket.Packet) {
|
|||
}
|
||||
|
||||
func (s *DHCP6Spoofer) Start() error {
|
||||
if s.Running() == true {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err := s.Configure(); err != nil {
|
||||
if err := s.Configure(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue