Add IPv6 dual-stack support

This commit is contained in:
Daniel
2020-11-02 14:18:42 +01:00
parent d4dea212dd
commit 914418876d
5 changed files with 140 additions and 70 deletions

View File

@@ -16,16 +16,19 @@ type tcpTable struct {
fetchOnceAgain utils.OnceAgain
fetchTable func() (connections []*socket.ConnectionInfo, listeners []*socket.BindInfo, err error)
dualStack *tcpTable
}
var (
tcp4Table = &tcpTable{
version: 4,
fetchTable: getTCP4Table,
}
tcp6Table = &tcpTable{
version: 6,
fetchTable: getTCP6Table,
}
tcp4Table = &tcpTable{
version: 4,
fetchTable: getTCP4Table,
dualStack: tcp6Table,
}
)