Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect gateway on Gateway Server address change #6726

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ For details about compatibility between different releases, see the **Commitment
### Changed

- Server side events replaced with single socket connection using the native WebSocket API.
- Gateways now disconnect if the Gateway Server address has changed.
- This enables CUPS-enabled gateways to change their LNS before the periodic CUPS lookup occurs.

### Deprecated

Expand Down
5 changes: 4 additions & 1 deletion pkg/gatewayserver/gatewayserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ func (gs *GatewayServer) Connect(
"enforce_duty_cycle",
"frequency_plan_id",
"frequency_plan_ids",
"gateway_server_address",
"location_public",
"require_authenticated_connection",
"schedule_anytime_delay",
Expand Down Expand Up @@ -611,7 +612,8 @@ func requireDisconnect(connected, current *ttnpb.Gateway) bool {
connected.StatusPublic != current.StatusPublic ||
connected.UpdateLocationFromStatus != current.UpdateLocationFromStatus ||
connected.FrequencyPlanId != current.FrequencyPlanId ||
len(connected.FrequencyPlanIds) != len(current.FrequencyPlanIds) {
len(connected.FrequencyPlanIds) != len(current.FrequencyPlanIds) ||
connected.GatewayServerAddress != current.GatewayServerAddress {
return true
}
for i := range connected.FrequencyPlanIds {
Expand Down Expand Up @@ -646,6 +648,7 @@ func (gs *GatewayServer) startDisconnectOnChangeTask(conn connectionEntry) {
"enforce_duty_cycle",
"frequency_plan_id",
"frequency_plan_ids",
"gateway_server_address",
"location_public",
"require_authenticated_connection",
"schedule_anytime_delay",
Expand Down
Loading