Skip to content

Commit aa06313

Browse files
authored
RSS: Reuse SNAT IPs until port range is exhausted (#6037)
Prior to this PR, RSS would step both the IP and the port range when assigning SNAT IPs to boundary NTP zones. E.g., on a4x2: ```json "snat_cfg": { "ip": "198.51.100.25", "first_port": 0, "last_port": 16383 } "snat_cfg": { "ip": "198.51.100.26", "first_port": 16384, "last_port": 32767 } ``` After the change, we reuse the IP and only step the ports: ```json "snat_cfg": { "ip": "198.51.100.25", "first_port": 0, "last_port": 16383 } "snat_cfg": { "ip": "198.51.100.25", "first_port": 16384, "last_port": 32767 } ``` I confirmed both boundary NTP zones still have external connectivity, as expected. I believe the code here already intended to do this, but accidentally never assigned `self.next_snat_ip`, so always allocated a new IP.
1 parent 1135047 commit aa06313

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sled-agent/src/rack_setup/plan/service.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,8 @@ impl ServicePortBuilder {
11331133
self.next_snat_port += NUM_SOURCE_NAT_PORTS;
11341134
if self.next_snat_port.0 == 0 {
11351135
self.next_snat_ip = None;
1136+
} else {
1137+
self.next_snat_ip = Some(snat_ip);
11361138
}
11371139

11381140
let snat_cfg =

0 commit comments

Comments
 (0)