mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-23 01:05:32 +00:00
wgengine/filter: support subnet mask rules, not just /32 IPs.
This depends on improved support from the control server, to send the new subnet width (Bits) fields. If these are missing, we fall back to assuming their value is /32. Conversely, if the server sends Bits fields to an older client, it will interpret them as /32 addresses. Since the only rules we allow are "accept" rules, this will be narrower or equal to the intended rule, so older clients will simply reject hosts on the wider subnet (fail closed). With this change, the internal filter.Matches format has diverged from the wire format used by controlclient, so move the wire format into tailcfg and convert it to filter.Matches in controlclient. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
@@ -71,7 +71,7 @@ const lruMax = 512 // max entries in UDP LRU cache
|
||||
|
||||
// MatchAllowAll matches all packets.
|
||||
var MatchAllowAll = Matches{
|
||||
Match{[]IPPortRange{IPPortRangeAny}, []IP{IPAny}},
|
||||
Match{[]NetPortRange{NetPortRangeAny}, []Net{NetAny}},
|
||||
}
|
||||
|
||||
// NewAllowAll returns a packet filter that accepts everything.
|
||||
|
Reference in New Issue
Block a user