wgengine/packet: rename types to reflect their v4-only-ness, document.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-11-09 15:34:03 -08:00
parent ebd96bf4a9
commit 19df6a2ee2
12 changed files with 196 additions and 181 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ func WrapTUN(logf logger.Logf, tdev tun.Device) *TUN {
// destination (the map keys).
//
// The map ownership passes to the TUN. It must be non-nil.
func (t *TUN) SetDestIPActivityFuncs(m map[packet.IP]func()) {
func (t *TUN) SetDestIPActivityFuncs(m map[packet.IP4]func()) {
t.destIPActivity.Store(m)
}
@@ -282,7 +282,7 @@ func (t *TUN) Read(buf []byte, offset int) (int, error) {
defer parsedPacketPool.Put(p)
p.Decode(buf[offset : offset+n])
if m, ok := t.destIPActivity.Load().(map[packet.IP]func()); ok {
if m, ok := t.destIPActivity.Load().(map[packet.IP4]func()); ok {
if fn := m[p.DstIP]; fn != nil {
fn()
}