mirror of
https://github.com/soypat/lneto.git
synced 2026-09-12 01:29:30 +00:00
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:
+7
-7
@@ -201,8 +201,8 @@ func newTCPStacks(t testing.TB, randSeed int64, mtu int) (s1, s2 *StackAsync, c1
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s1.SetGateway6(s2.HardwareAddress())
|
||||
s2.SetGateway6(s1.HardwareAddress())
|
||||
s1.SetGatewayHardwareAddr(s2.HardwareAddr())
|
||||
s2.SetGatewayHardwareAddr(s1.HardwareAddr())
|
||||
buf := make([]byte, mtu*4)
|
||||
err = c1.Configure(tcp.ConnConfig{
|
||||
RxBuf: buf[:mtu],
|
||||
@@ -253,7 +253,7 @@ func noExchange(source int) tcpExpectExchange {
|
||||
func (tst *tester) TestTCPSetupAndEstablish(svStack, clStack *StackAsync, svConn, clConn *tcp.Conn, svPort, clPort uint16) {
|
||||
t := tst.t
|
||||
// Attach server and client connections to stacks.
|
||||
err := svStack.ListenTCP(svConn, svPort)
|
||||
err := svStack.ListenTCP4(svConn, svPort)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -453,8 +453,8 @@ func (tst *tester) TCPExchange(expect tcpExpectExchange, stack1, stack2 *StackAs
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
srcEth := src.HardwareAddress()
|
||||
dstEth := dst.HardwareAddress()
|
||||
srcEth := src.HardwareAddr()
|
||||
dstEth := dst.HardwareAddr()
|
||||
if !bytes.Equal(srcEth[:], tst.getData(protoEthernet, pcap.FieldClassSrc)) {
|
||||
t.Errorf("mismatched ethernet src addr %x", tst.getData(protoEthernet, pcap.FieldClassSrc))
|
||||
}
|
||||
@@ -511,8 +511,8 @@ func (tst *tester) ARPExchangeOnly(querying, target *StackAsync) {
|
||||
}
|
||||
tst.buf = tst.buf[:n]
|
||||
|
||||
qHw := querying.HardwareAddress()
|
||||
tgtHw := target.HardwareAddress()
|
||||
qHw := querying.HardwareAddr()
|
||||
tgtHw := target.HardwareAddr()
|
||||
broadcast := ethernet.BroadcastAddr()
|
||||
qIP := querying.Addr4()
|
||||
tgtIP := target.Addr4()
|
||||
|
||||
Reference in New Issue
Block a user