mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: checking udp layer decoding for dhcp6.spoof module
This commit is contained in:
parent
62825cd32a
commit
47b3be1b74
1 changed files with 4 additions and 0 deletions
|
@ -331,6 +331,10 @@ func (s *DHCP6Spoofer) onPacket(pkt gopacket.Packet) {
|
|||
var err error
|
||||
|
||||
udp := pkt.Layer(layers.LayerTypeUDP).(*layers.UDP)
|
||||
if udp == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// we just got a dhcp6 packet?
|
||||
if err = dhcp.UnmarshalBinary(udp.Payload); err == nil {
|
||||
eth := pkt.Layer(layers.LayerTypeEthernet).(*layers.Ethernet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue