add ipv6 to xnet.StackAsync (#107)

* add ipv6 to xnet.StackAsync

* dns improvements

* improve DNS workings of StackAsync

* add tentative ICMPv6

* work on prefixes and fix some small bugs, plan UDP/TCP6

* fix bugs in StackAsync and ipv4.Prefix.Contains

* update arpsubtable

* completely remove legacy internet.StackIP for StackIPv4/v6

* ipv4/ipv6 tcp/udp

* add TCP6/UDP6 dialing APIs

* add xnet.Stack6 interface

* more ipv6 integration into StackAsync; various tweaks to lneto and documentation+TODOs

* add stack6 tests

* replace netip.Prefix with ipv4.Prefix where it makes sense
This commit is contained in:
Pat Whittingslow
2026-05-13 15:31:18 -03:00
committed by GitHub
parent 7d5830d7ab
commit a2970b923d
44 changed files with 1938 additions and 395 deletions
+5 -4
View File
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/soypat/lneto/ethernet"
"github.com/soypat/lneto/ipv4"
"github.com/soypat/lneto/tcp"
)
@@ -21,7 +22,7 @@ func TestSubnetTable_PatchEgressMAC_WhenGatewayMAC(t *testing.T) {
var st subnetTable
st.reset(4, 2)
st.subnet = netip.MustParsePrefix("10.0.0.0/24")
st.subnet4 = ipv4.PrefixFrom(clientIP, 24)
// Learn client MAC from a simulated ingress frame (client→server SYN).
ingressFrame := makeMinimalIPv4Frame(serverMAC, clientMAC, clientIP, serverIP)
@@ -62,8 +63,8 @@ func TestStackAsync_ListenerSynAckAddressedToClient(t *testing.T) {
if err != nil {
t.Fatal(err)
}
sv.SetGateway6(routerMAC)
sv.SetSubnet(netip.MustParsePrefix("10.0.0.0/24"))
sv.SetGatewayHardwareAddr(routerMAC)
sv.SetSubnet4(sv.Addr4(), 24)
pool, err := NewTCPPool(TCPPoolConfig{
PoolSize: 1,
@@ -97,7 +98,7 @@ func TestStackAsync_ListenerSynAckAddressedToClient(t *testing.T) {
if err != nil {
t.Fatal(err)
}
client.SetGateway6(serverMAC)
client.SetGatewayHardwareAddr(serverMAC)
var clConn tcp.Conn
if err = clConn.Configure(tcp.ConnConfig{