[PR #945] [MERGED] Refactor check logic when adding routes #13175

Closed
opened 2026-08-05 02:07:40 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/945
Author: @pascal-fischer
Created: 6/9/2023
Status: Merged
Merged: 6/19/2023
Merged by: @pascal-fischer

Base: mainHead: feat/refactor_route_adding_in_client


📝 Commits (10+)

  • 3ef3387 change checks before route adding to not only check for default gateway (test missing)
  • 3724323 test still failing
  • bc8ee8f add tests
  • 75fac25 hacky all-operating-systems solution
  • 493ddb4 Revert "hacky all-operating-systems solution"
  • 6e26d03 split systemops for operating systems and add linux
  • 64adaeb split systemops for operating systems and add linux
  • 1ced246 split systemops for operating systems and add linux
  • dad5501 split systemops for operating systems and add linux
  • c8b4c08 split systemops for operating systems and add linux

📊 Changes

7 files changed (+299 additions, -9 deletions)

View changed files

client/internal/routemanager/systemops_bsd.go (+82 -0)
📝 client/internal/routemanager/systemops_linux.go (+57 -0)
📝 client/internal/routemanager/systemops_nonandroid.go (+14 -6)
📝 client/internal/routemanager/systemops_nonandroid_test.go (+104 -3)
client/internal/routemanager/systemops_windows.go (+37 -0)
📝 go.mod (+2 -0)
📝 go.sum (+3 -0)

📄 Description

Describe your changes

Before only routes could be added that are not set yet (are routed through the default gateway. Changed the logic for adding routes allow adding every route except for if the same destination network already exists or if the destination network includes the default gateway.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/945 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 6/9/2023 **Status:** ✅ Merged **Merged:** 6/19/2023 **Merged by:** [@pascal-fischer](https://github.com/pascal-fischer) **Base:** `main` ← **Head:** `feat/refactor_route_adding_in_client` --- ### 📝 Commits (10+) - [`3ef3387`](https://github.com/netbirdio/netbird/commit/3ef33874b1a11c8b668911333618686154b8e197) change checks before route adding to not only check for default gateway (test missing) - [`3724323`](https://github.com/netbirdio/netbird/commit/3724323f7604f842b73fe8a974d3725b2d517675) test still failing - [`bc8ee8f`](https://github.com/netbirdio/netbird/commit/bc8ee8fc3c6edee5837faa4d191a8884f2b0a991) add tests - [`75fac25`](https://github.com/netbirdio/netbird/commit/75fac258e743f95f9f2187d1cf7670be18012ec7) hacky all-operating-systems solution - [`493ddb4`](https://github.com/netbirdio/netbird/commit/493ddb4fe3466d2e73fce2e5fc3e2e4f761f9e64) Revert "hacky all-operating-systems solution" - [`6e26d03`](https://github.com/netbirdio/netbird/commit/6e26d03fb8c35927cbea71742e49e5c3507c9332) split systemops for operating systems and add linux - [`64adaeb`](https://github.com/netbirdio/netbird/commit/64adaeb276f999d508358295192cb39c573897eb) split systemops for operating systems and add linux - [`1ced246`](https://github.com/netbirdio/netbird/commit/1ced2462c1da6344dd653cd2af37c10c7b589fcf) split systemops for operating systems and add linux - [`dad5501`](https://github.com/netbirdio/netbird/commit/dad5501a44a65bee3e620aca524501f86c154d9e) split systemops for operating systems and add linux - [`c8b4c08`](https://github.com/netbirdio/netbird/commit/c8b4c08139d1e5973bedbdaf357683f1e0c0561d) split systemops for operating systems and add linux ### 📊 Changes **7 files changed** (+299 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `client/internal/routemanager/systemops_bsd.go` (+82 -0) 📝 `client/internal/routemanager/systemops_linux.go` (+57 -0) 📝 `client/internal/routemanager/systemops_nonandroid.go` (+14 -6) 📝 `client/internal/routemanager/systemops_nonandroid_test.go` (+104 -3) ➕ `client/internal/routemanager/systemops_windows.go` (+37 -0) 📝 `go.mod` (+2 -0) 📝 `go.sum` (+3 -0) </details> ### 📄 Description ## Describe your changes Before only routes could be added that are not set yet (are routed through the default gateway. Changed the logic for adding routes allow adding every route except for if the same destination network already exists or if the destination network includes the default gateway. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:07:40 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#13175