[PR #1987] [CLOSED] Fix/proxy close #14520

Open
opened 2026-08-05 03:05:47 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1987
Author: @pappz
Created: 5/14/2024
Status: Closed

Base: mainHead: fix/proxy_close


📝 Commits (4)

📊 Changes

9 files changed (+54 additions, -76 deletions)

View changed files

📝 client/internal/engine.go (+1 -1)
📝 client/internal/peer/conn.go (+1 -1)
📝 client/internal/peer/conn_test.go (+5 -6)
📝 client/internal/wgproxy/factory.go (+2 -4)
📝 client/internal/wgproxy/factory_linux.go (+2 -4)
📝 client/internal/wgproxy/factory_nonlinux.go (+1 -3)
📝 client/internal/wgproxy/proxy_ebpf.go (+36 -50)
📝 client/internal/wgproxy/proxy_ebpf_test.go (+3 -4)
📝 client/internal/wgproxy/proxy_userspace.go (+3 -3)

📄 Description

Describe your changes

Revert the context cancellation logic from the wg proxy and improve the error handling in case of resource freeing action.

  • In eBPF proxy implementation we can not close individual turn connections. It frees up in an implicit way if the ice agent closes the conn.
  • We should not mix in the resource freeing logic the context cancellation with the exported "close" functions. In the eBPF proxy was CloseConn(), Free(), and cancel by parent context.

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/1987 **Author:** [@pappz](https://github.com/pappz) **Created:** 5/14/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/proxy_close` --- ### 📝 Commits (4) - [`de2e655`](https://github.com/netbirdio/netbird/commit/de2e6557adb4a7ab86e8b64ae1bc52a790caad7a) Revert context changes in proxy implementations - [`4a2429e`](https://github.com/netbirdio/netbird/commit/4a2429eb1c82b43711d54e09f34831679e63732f) Fix cleanup and error handling - [`d39814f`](https://github.com/netbirdio/netbird/commit/d39814f173cb0c6ddd07860f0ead4e8a6630a451) Fix lint - [`d9bcdcf`](https://github.com/netbirdio/netbird/commit/d9bcdcf149d45b07d3b7725faf7691c097b50aff) Fix lint ### 📊 Changes **9 files changed** (+54 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+1 -1) 📝 `client/internal/peer/conn.go` (+1 -1) 📝 `client/internal/peer/conn_test.go` (+5 -6) 📝 `client/internal/wgproxy/factory.go` (+2 -4) 📝 `client/internal/wgproxy/factory_linux.go` (+2 -4) 📝 `client/internal/wgproxy/factory_nonlinux.go` (+1 -3) 📝 `client/internal/wgproxy/proxy_ebpf.go` (+36 -50) 📝 `client/internal/wgproxy/proxy_ebpf_test.go` (+3 -4) 📝 `client/internal/wgproxy/proxy_userspace.go` (+3 -3) </details> ### 📄 Description ## Describe your changes Revert the context cancellation logic from the wg proxy and improve the error handling in case of resource freeing action. - In eBPF proxy implementation we can not close individual turn connections. It frees up in an implicit way if the ice agent closes the conn. - We should not mix in the resource freeing logic the context cancellation with the exported "close" functions. In the eBPF proxy was `CloseConn()`, `Free()`, and cancel by parent `context`. ## Issue ticket number and link ### Checklist - [x] 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 --- <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 03:05:47 -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#14520