#15013·gvisor

当栈通过 `tcp.Forwarder` 接受请求时, SYN in TIME_WAIT 会被丢弃

作者: everanium创建于 2026年9月25日更新于 2026年9月25日
标签type: bug

// Reproducer: with a tcp.Forwarder as the TCP protocol handler, a SYN that // reuses the 4-tuple of an endpoint in TIME_WAIT is dropped without a reply // until TIME_WAIT expires, even though its sequence number is above the old // connection's RcvNxt (RFC 1122's reopen case). // // The stack is driven through a channel endpoint: the test plays the peer, // injecting segments and reading what the stack sends. package repro

import ( "context" "testing" "time"

    "gvisor.dev/gvisor/pkg/buffer"
    "gvisor.dev/gvisor/pkg/tcpip"
    "gvisor.dev/gvisor/pkg/tcpip/header"
    "gvisor.dev/gvisor/pkg/tcpip/link/channel"
    "gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
    "gvisor.dev/gvisor/pkg/tcpip/stack"
    "gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
    "gvisor.dev/gvisor/pkg/waiter"

)

// Reproducer: with a tcp.Forwarder as the TCP protocol handler, a SYN that // reuses the 4-tuple of an endpoint in TIME_WAIT is dropped without a reply // until TIME_WAIT expires, even though its sequence number is above the old // connection's RcvNxt (RFC 1122's reopen case). // // The stack is driven through a channel endpoint: the test plays the peer, // injecting segments and reading what the stack sends. package repro