remove NodeARP in favor of arp.Handler; fix bug in IP stack node handling; use registerNode where applicable

This commit is contained in:
soypat
2025-07-14 19:48:29 -03:00
parent 1549e563e9
commit 61c66a2e58
9 changed files with 29 additions and 32 deletions
+2 -2
View File
@@ -224,7 +224,7 @@ func run() (err error) {
type Stack struct {
link internet.StackEthernet
ip internet.StackIP
arp internet.NodeARP
arp arp.Handler
udps internet.StackPorts
dhcp dhcpv4.Client
dns dns.Client
@@ -427,7 +427,7 @@ func (s *Stack) ResultResolveHardwareAddress6(ip netip.Addr) (hw [6]byte, err er
if err != nil {
return hw, err
} else if len(hwslice) != 6 {
panic("unreachable slice hw leng")
panic("unreachable slice hw length")
}
return [6]byte(hwslice), nil
}
+1 -1
View File
@@ -181,7 +181,7 @@ type Stack struct {
ethernet internet.StackEthernet
ip internet.StackIP
tcpports internet.StackPorts
arp internet.NodeARP
arp arp.Handler
}
func (stack *Stack) Reset(ourMAC, gwMAC [6]byte, ip netip.Addr, mtu int) (err error) {
+1 -1
View File
@@ -195,7 +195,7 @@ func NewEthernetTCPStack(ourMAC, gwMAC [6]byte, ip netip.AddrPort, mtu uint16, s
if err != nil {
return nil, nil, err
}
err = ipStack.RegisterTCPConn(&conn)
err = ipStack.Register(&conn)
if err != nil {
return nil, nil, err
}