rework Results.tex to include gVisor findings

This commit is contained in:
2026-04-09 16:40:25 +02:00
parent 67238d1bd8
commit e25c230427
14 changed files with 1387 additions and 575 deletions
+31
View File
@@ -0,0 +1,31 @@
type SharedStream struct {
Stream *network.Stream
Lock *sync.Mutex
}
...
// Inside the TUN-read loop:
if found {
dst = route.Target.ID
go node.sendPacket(dst, packet, plen)
}
...
func (node *Node) sendPacket(dst peer.ID, packet []byte, plen int) {
// Check if we already have an open connection to the destination peer.
ms, ok := node.activeStreams[dst]
if ok {
if func() bool {
ms.Lock.Lock()
defer ms.Lock.Unlock()
// Write out the packet's length to the libp2p stream to ensure
// we know the full size of the packet at the other end.
err := binary.Write(*ms.Stream, binary.LittleEndian, uint16(plen))
if err == nil {
// Write the packet out to the libp2p stream.
_, err = (*ms.Stream).Write(packet[:plen])
...
}
...
}() { return }
}
...
}