From 56143fe9cebe95636de1275acf30fcca36a1383d Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Wed, 22 Nov 2017 20:58:38 +0000 Subject: [PATCH] Alignment --- conn.go | 4 +++- filter.go | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/conn.go b/conn.go index ea4ba2d..5af7356 100644 --- a/conn.go +++ b/conn.go @@ -7,6 +7,9 @@ import ( ) type FilteredConn struct { + // Alignment + deadline atomic.Value + source *PacketFilter priority int @@ -14,7 +17,6 @@ type FilteredConn struct { filter Filter - deadline atomic.Value closed chan struct{} } diff --git a/filter.go b/filter.go index d0c539b..f5e7347 100644 --- a/filter.go +++ b/filter.go @@ -26,13 +26,14 @@ func NewPacketFilter(conn net.PacketConn) *PacketFilter { // PacketFilter embeds a net.PacketConn to perform the filtering. type PacketFilter struct { + // Alignment + dropped uint64 + overflow uint64 + net.PacketConn conns []*FilteredConn mut sync.Mutex - - dropped uint64 - overflow uint64 } // NewConn returns a new net.PacketConn object which filters packets based