Begin work on source address caching (linux)

This commit is contained in:
Mathias Hall-Andersen
2017-09-24 21:35:25 +02:00
parent c545d63bb9
commit eefa47b0f9
5 changed files with 273 additions and 11 deletions
+5
View File
@@ -29,6 +29,11 @@ func (a *AtomicBool) Set(val bool) {
atomic.StoreInt32(&a.flag, flag)
}
func toInt32(n uint32) int32 {
mask := uint32(1 << 31)
return int32(-(n & mask) + (n & ^mask))
}
func min(a uint, b uint) uint {
if a > b {
return b