fix StackAsync losing ARP handler on reset during DHCP result assimilation

This commit is contained in:
Patricio Whittingslow
2025-12-28 15:33:10 -03:00
parent f6bc73ee6c
commit a2886423a2
+9 -1
View File
@@ -169,7 +169,7 @@ func (s *StackAsync) resetARP() error {
if addr.Is6() { if addr.Is6() {
proto = ethernet.TypeIPv6 proto = ethernet.TypeIPv6
} }
return s.arp.Reset(arp.HandlerConfig{ err := s.arp.Reset(arp.HandlerConfig{
HardwareAddr: mac[:], HardwareAddr: mac[:],
ProtocolAddr: addr.AsSlice(), ProtocolAddr: addr.AsSlice(),
MaxQueries: 3, MaxQueries: 3,
@@ -177,6 +177,14 @@ func (s *StackAsync) resetARP() error {
HardwareType: 1, HardwareType: 1,
ProtocolType: proto, ProtocolType: proto,
}) })
if err != nil {
return err
}
err = s.link.Register(&s.arp)
if err != nil {
return err
}
return nil
} }
// Prand32 generates a pseudo random 32-bit unsigned integer from the internal state and advances the seed. // Prand32 generates a pseudo random 32-bit unsigned integer from the internal state and advances the seed.