From c6d03ef17f34f7380d95e91a6091a06bce332979 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Tue, 22 Aug 2017 14:57:32 +0200 Subject: Update MTU based on netlink messages (linux) --- src/tun_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tun_linux.go') diff --git a/src/tun_linux.go b/src/tun_linux.go index e752733..b9541c9 100644 --- a/src/tun_linux.go +++ b/src/tun_linux.go @@ -85,6 +85,7 @@ func (tun *NativeTun) RoutineNetlinkListener() { case unix.RTM_NEWLINK: info := *(*unix.IfInfomsg)(unsafe.Pointer(&remain[unix.SizeofNlMsghdr])) + remain = remain[hdr.Len:] if info.Index != tun.index { // not our interface @@ -99,7 +100,7 @@ func (tun *NativeTun) RoutineNetlinkListener() { tun.events <- TUNEventDown } - remain = remain[hdr.Len:] + tun.events <- TUNEventMTUUpdate default: remain = remain[hdr.Len:] -- cgit v1.2.3