Check for correct first nibble

The code before assumed that the flow label was always zero.
This commit is contained in:
Jason A. Donenfeld 2018-04-20 05:30:22 +02:00
parent 4973ea0c9e
commit f5c256affd

View file

@ -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 {