fix couple bugs in ARP and add benchmarks

This commit is contained in:
Patricio Whittingslow
2026-01-13 10:15:18 -03:00
parent a5af5b58ce
commit f51cdf74b6
3 changed files with 202 additions and 17 deletions
+11
View File
@@ -450,6 +450,17 @@ func (s *StackAsync) ResultResolveHardwareAddress6(ip netip.Addr) (hw [6]byte, e
return [6]byte(hwslice), nil
}
// DiscardResolveHardwareAddress6 discards a pending ARP query for the given IP address.
func (s *StackAsync) DiscardResolveHardwareAddress6(ip netip.Addr) error {
s.mu.Lock()
defer s.mu.Unlock()
if !ip.Is4() {
return errors.New("unsupported or invalid IP address")
}
addr := ip.As4()
return s.arp.DiscardQuery(addr[:])
}
type DHCPResults struct {
DNSServers []netip.Addr
Router netip.Addr