Don't process ICMPv6 messages when in TUN mode

This commit is contained in:
Neil Alexander 2018-12-26 22:45:21 +00:00
parent cc2b6f093c
commit 4e03bdb054
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 12 additions and 5 deletions

View file

@ -214,11 +214,12 @@ func (tun *tunAdapter) read() error {
continue
}
if buf[o+6] == 58 {
// Found an ICMPv6 packet
b := make([]byte, n)
copy(b, buf)
// tun.icmpv6.recv <- b
go tun.icmpv6.parse_packet(b)
if tun.iface.IsTAP() {
// Found an ICMPv6 packet
b := make([]byte, n)
copy(b, buf)
go tun.icmpv6.parse_packet(b)
}
}
packet := append(util.GetBytes(), buf[o:n]...)
tun.send <- packet