Use uint16

This commit is contained in:
Viktor Liu
2025-07-24 13:56:45 +02:00
parent da623e6f04
commit eb74c507bc
34 changed files with 84 additions and 74 deletions

View File

@@ -36,7 +36,7 @@ type SharedSocket struct {
conn4 *socket.Conn
conn6 *socket.Conn
port int
mtu int
mtu uint16
routerMux sync.RWMutex
router routing.Router
packetDemux chan rcvdPacket
@@ -64,7 +64,7 @@ var writeSerializerOptions = gopacket.SerializeOptions{
const maxIPUDPOverhead = 68
// Listen creates an IPv4 and IPv6 raw sockets, starts a reader and routing table routines
func Listen(port int, filter BPFFilter, mtu int) (_ net.PacketConn, err error) {
func Listen(port int, filter BPFFilter, mtu uint16) (_ net.PacketConn, err error) {
ctx, cancel := context.WithCancel(context.Background())
rawSock := &SharedSocket{
ctx: ctx,