File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 77
88 "github.com/juanfont/headscale/hscontrol/util"
99 "go4.org/netipx"
10+ "tailscale.com/net/tsaddr"
1011 "tailscale.com/tailcfg"
1112)
1213
@@ -91,3 +92,12 @@ func (m *Match) SrcsOverlapsPrefixes(prefixes ...netip.Prefix) bool {
9192func (m * Match ) DestsOverlapsPrefixes (prefixes ... netip.Prefix ) bool {
9293 return slices .ContainsFunc (prefixes , m .dests .OverlapsPrefix )
9394}
95+
96+ // DestsIsTheInternet reports if the destination is equal to "the internet"
97+ // which is a IPSet that represents "autogroup:internet" and is special
98+ // cased for exit nodes.
99+ func (m Match ) DestsIsTheInternet () bool {
100+ return m .dests .Equal (util .TheInternet ()) ||
101+ m .dests .ContainsPrefix (tsaddr .AllIPv4 ()) ||
102+ m .dests .ContainsPrefix (tsaddr .AllIPv6 ())
103+ }
You can’t perform that action at this time.
0 commit comments