Improve support for disabled IPv6 stack

This commit is contained in:
Daniel
2023-03-29 14:57:32 +02:00
parent fa98f1ea6d
commit 4b29eed2cf
4 changed files with 40 additions and 15 deletions

View File

@@ -29,6 +29,11 @@ var (
tcp4Table = &tcpTable{
version: 4,
fetchTable: getTCP4Table,
dualStack: tcp6Table,
}
)
// EnableTCPDualStack adds the TCP6 table to the TCP4 table as a dual-stack.
// Must be called before any lookup operation.
func EnableTCPDualStack() {
tcp4Table.dualStack = tcp6Table
}