Don't use channels for ICMPv6 packets

This commit is contained in:
Neil Alexander 2018-02-12 20:00:55 +00:00
parent fac4bf796e
commit 6571a8c300
2 changed files with 20 additions and 29 deletions

View file

@ -79,7 +79,12 @@ func (tun *tunDevice) read() error {
// Found an ICMPv6 packet
b := make([]byte, n)
copy(b, buf)
tun.icmpv6.recv <- b
// tun.icmpv6.recv <- b
if tun.iface.IsTAP() {
go tun.icmpv6.parse_packet_tap(b)
} else {
go tun.icmpv6.parse_packet_tun(b)
}
}
packet := append(util_getBytes(), buf[o:n]...)
tun.send <- packet