From f5c256affdecc50ecf485b7ad54986ebb17e783a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 20 Apr 2018 05:30:22 +0200 Subject: [PATCH] Check for correct first nibble The code before assumed that the flow label was always zero. --- tun_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tun_linux.go b/tun_linux.go index a37b727..1abc86f 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -273,7 +273,7 @@ func (tun *NativeTun) Write(buff []byte, offset int) (int, error) { buff[0] = 0x00 buff[1] = 0x00 - if buff[4] == ipv6.Version<<4 { + if buff[4]>>4 == ipv6.Version { buff[2] = 0x86 buff[3] = 0xdd } else {