headscale/hscontrol/policy/v2
Kristoffer Dalby 5d502bfb88 types/node, mapper: strip own IPv4 from emission when node has disable-ipv4 cap
When a node carries the disable-ipv4 nodeAttr documented at
https://tailscale.com/docs/reference/troubleshooting/network-configuration/cgnat-conflicts,
SaaS stops sending the node's CGNAT IPv4 prefix in MapResponse. The
allocator keeps assigning IPv4 server-side; only the wire-shape
delivery is filtered. Subnet routes the node advertises -- including
IPv4 prefixes -- survive in AllowedIPs and PrimaryRoutes.

TailNode now drops Is4 prefixes from Addresses and from the node's
own /32 slot in AllowedIPs when selfPolicyCaps carries
disable-ipv4. Mapper.buildTailPeers passes each peer's policy
CapMap so the filter applies in viewer netmaps too; the CapMap
merge that follows is overwritten by PeerCapMap so only the address
filter survives on the peer path.

Two captures land in testdata/nodeattrs_results to anchor the
behaviour:

  - nodeattrs-attr-c15-disable-ipv4         (on tag:client)
  - nodeattrs-attr-c16-disable-ipv4-router  (on tag:router, which
    advertises 10.33.0.0/16, confirming subnet routes survive)
2026-05-13 14:22:30 +02:00
..
testdata types/node, mapper: strip own IPv4 from emission when node has disable-ipv4 cap 2026-05-13 14:22:30 +02:00
compiled.go policy/v2: parse, validate, and compile nodeAttrs 2026-05-13 14:22:30 +02:00
filter.go policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
filter_test.go policy/v2: surface autogroup:internet via grants on exit nodes 2026-04-30 19:22:45 +01:00
issue_3212_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
issue_3233_test.go policy/v2: surface autogroup:internet via grants on exit nodes 2026-04-30 19:22:45 +01:00
main_test.go all: fix test flakiness and improve test infrastructure 2026-03-14 02:52:28 -07:00
nodeattrs_test.go policy/v2: parse, validate, and compile nodeAttrs 2026-05-13 14:22:30 +02:00
policy.go policy/v2: parse, validate, and compile nodeAttrs 2026-05-13 14:22:30 +02:00
policy_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
policytester_compat_test.go policy/v2: match default proto set for tests with no proto 2026-05-12 11:54:54 +01:00
tailnet_state_caps.go types/config, types/node: model default-auto-update from auto_update.enabled 2026-05-13 14:22:30 +02:00
tailscale_acl_data_compat_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
tailscale_grants_compat_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
tailscale_nodeattrs_compat_test.go types/config, types/node: model default-auto-update from auto_update.enabled 2026-05-13 14:22:30 +02:00
tailscale_routes_data_compat_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
tailscale_ssh_data_compat_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
test.go policy/v2: match default proto set for tests with no proto 2026-05-12 11:54:54 +01:00
test_test.go policy/v2: match default proto set for tests with no proto 2026-05-12 11:54:54 +01:00
types.go policy/v2: parse, validate, and compile nodeAttrs 2026-05-13 14:22:30 +02:00
types_test.go policy/v2: canonicalize Protocol form during unmarshal 2026-05-12 11:54:54 +01:00
utils.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00
utils_test.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00