wgengine/filter: also silently drop link-local unicast traffic

Updates #629
This commit is contained in:
Brad Fitzpatrick
2020-09-25 11:47:38 -07:00
parent 5f807c389e
commit 73cc2d8f89
3 changed files with 17 additions and 3 deletions
+4
View File
@@ -43,6 +43,10 @@ func (ip IP) IsMulticast() bool {
return byte(ip>>24)&0xf0 == 0xe0
}
func (ip IP) IsLinkLocalUnicast() bool {
return byte(ip>>24) == 169 && byte(ip>>16) == 254
}
// IPProto is either a real IP protocol (ITCP, UDP, ...) or an special value like Unknown.
// If it is a real IP protocol, its value corresponds to its IP protocol number.
type IPProto uint8