Reworked update code, split v4/v6 updates

- collect dns updatees individually, so that we clear A and AAAA separately if and only if needed.
- made nft AddIP call more resilient against partial updates
- updated nft processing code to no longer add nil to a v4/v6 set which would end in an invalid call to AddIP when updating nft. call it individually now.
- updated samples with real world traces from an AVM Box
This commit is contained in:
2021-09-25 11:56:50 +02:00
parent a23043ba5f
commit 45d4e45bb1
4 changed files with 38 additions and 14 deletions

View File

@ -65,6 +65,9 @@ func (nut *NFTUpdateTable) FindOrAddSet(SetName string, IP6 bool) (*NFTUpdateSet
}
func (nu *NFTUpdate) AddIP(TableName string, SetName string, IP net.IP) error {
if IP == nil {
return nil
}
ip6 := (IP.To4() == nil)
nut := nu.FindOrAddTable(TableName)
nus, err := nut.FindOrAddSet(SetName, ip6)