diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-04-20 05:30:22 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-04-20 06:51:28 +0200 |
commit | f5c256affdecc50ecf485b7ad54986ebb17e783a (patch) | |
tree | 780151889f7f23daa25be5656f0ffeaf0b093fee /tun_linux.go | |
parent | 4973ea0c9e6c8fd7093e8c1848533697d6b02a69 (diff) |
Check for correct first nibble
The code before assumed that the flow label was always zero.
Diffstat (limited to 'tun_linux.go')
-rw-r--r-- | tun_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |