From 1f0976a26c1d0a6b5eb2c0aa993f12d89f96eed2 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Wed, 28 Jun 2017 23:45:45 +0200 Subject: Work on UAPI Cross-platform API (get operation) Handshake initiation creation process Outbound packet flow Fixes from code-review --- src/tun_linux.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/tun_linux.go') diff --git a/src/tun_linux.go b/src/tun_linux.go index d545dfa..cbbcb70 100644 --- a/src/tun_linux.go +++ b/src/tun_linux.go @@ -9,9 +9,7 @@ import ( "unsafe" ) -/* Platform dependent functions for interacting with - * TUN devices on linux systems - * +/* Implementation of the TUN device interface for linux */ const CloneDevicePath = "/dev/net/tun" @@ -45,7 +43,7 @@ func (tun *NativeTun) Read(d []byte) (int, error) { return tun.fd.Read(d) } -func CreateTUN(name string) (TUN, error) { +func CreateTUN(name string) (TUNDevice, error) { // Open clone device fd, err := os.OpenFile(CloneDevicePath, os.O_RDWR, 0) if err != nil { @@ -53,7 +51,7 @@ func CreateTUN(name string) (TUN, error) { } // Prepare ifreq struct - var ifr [18]byte + var ifr [128]byte var flags uint16 = IFF_TUN | IFF_NO_PI nameBytes := []byte(name) if len(nameBytes) >= IFNAMSIZ { -- cgit v1.2.3