diff --git a/go/main.go b/go/main.go index bbd64ec..7e040ea 100644 --- a/go/main.go +++ b/go/main.go @@ -8,33 +8,25 @@ import ( "syscall" ) -var PacketOverhead = 0 - type Packet struct { Data []byte } func main() { tun, err := taptun.NewTun("nc%d") - if err != nil { - panic(err) - } + if err != nil { panic(err) } inboundPackets := make(chan Packet, 128) go func() { - bufferSize := 1500 - PacketOverhead + bufferSize := 1500 buffer := make([]byte, bufferSize) for { read, err := tun.Read(buffer) - if err != nil { - panic(err) - } + if err != nil { panic(err) } - if read == 0 { - panic("0 bytes read!") - } + if read == 0 { panic("0 bytes read!") } p := Packet{} p.Data = make([]byte, read) @@ -53,9 +45,4 @@ func main() { } }() } - - signals := make(chan os.Signal) - signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT) - - <-signals }