Skip to content

Commit 401dffb

Browse files
committed
cmd/tailmixd: expand the default effective IPv4 pool to /16
Use 100.127.0.0/16 for new state while preserving existing persisted pools and explicit overrides. Update the architecture documentation and test new defaults alongside legacy /24 and custom pool preservation. Change-Id: Id04b52037425e28c26d6a719d194ec08654491eb Co-authored-by: Shelley <shelley@exe.dev>
1 parent ba9f00c commit 401dffb

3 files changed

Lines changed: 21 additions & 11 deletions

File tree

‎cmd/tailmixd/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
)
3333

3434
const (
35-
defaultSyntheticPool = "100.127.0.0/24"
35+
defaultSyntheticPool = "100.127.0.0/16"
3636
defaultSyntheticPoolV6 = "fd6d:6e65:7400::/56"
3737
)
3838

‎cmd/tailmixd/main_test.go‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,25 @@ func TestResolveProfilesMergesFlagsWithPersistentState(t *testing.T) {
110110
}
111111

112112
func TestConfigureSyntheticPoolsUsesPersistedValuesAndDefaults(t *testing.T) {
113-
st := state.State{SyntheticPool: "10.42.1.7/16"}
114-
if err := configureSyntheticPools(&st, "", ""); err != nil {
115-
t.Fatal(err)
116-
}
117-
if st.SyntheticPool != "10.42.0.0/16" {
118-
t.Fatalf("IPv4 pool = %q, want normalized persisted pool", st.SyntheticPool)
119-
}
120-
if st.SyntheticPoolV6 != defaultSyntheticPoolV6 {
121-
t.Fatalf("IPv6 pool = %q, want default %q", st.SyntheticPoolV6, defaultSyntheticPoolV6)
113+
for _, test := range []struct {
114+
name, persisted, want string
115+
}{
116+
{"new state", "", "100.127.0.0/16"},
117+
{"existing default", "100.127.0.0/24", "100.127.0.0/24"},
118+
{"custom pool", "10.42.1.7/16", "10.42.0.0/16"},
119+
} {
120+
t.Run(test.name, func(t *testing.T) {
121+
st := state.State{SyntheticPool: test.persisted}
122+
if err := configureSyntheticPools(&st, "", ""); err != nil {
123+
t.Fatal(err)
124+
}
125+
if st.SyntheticPool != test.want {
126+
t.Fatalf("IPv4 pool = %q, want %q", st.SyntheticPool, test.want)
127+
}
128+
if st.SyntheticPoolV6 != defaultSyntheticPoolV6 {
129+
t.Fatalf("IPv6 pool = %q, want default %q", st.SyntheticPoolV6, defaultSyntheticPoolV6)
130+
}
131+
})
122132
}
123133
}
124134

‎docs/architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ the grace period. Incoming traffic and idle open connections do not extend it.
144144
The default pools are:
145145

146146
```text
147-
IPv4 100.127.0.0/24
147+
IPv4 100.127.0.0/16
148148
IPv6 fd6d:6e65:7400::/56
149149
```
150150

0 commit comments

Comments
 (0)