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

@@ -22,6 +22,8 @@ type udpTable struct {
states map[string]map[string]*udpState
statesLock sync.Mutex
dualStack *udpTable
}
type udpState struct {
@@ -41,17 +43,18 @@ const (
)
var (
udp4Table = &udpTable{
version: 4,
fetchTable: getUDP4Table,
states: make(map[string]map[string]*udpState),
}
udp6Table = &udpTable{
version: 6,
fetchTable: getUDP6Table,
states: make(map[string]map[string]*udpState),
}
udp4Table = &udpTable{
version: 4,
fetchTable: getUDP4Table,
states: make(map[string]map[string]*udpState),
dualStack: udp6Table,
}
)
// CleanUDPStates cleans the udp connection states which save connection directions.