mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[PR #5200] [MERGED] server/group: fix port leak and incorrect Listen port in TCPGroup #5167
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5167
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5200
Author: @fatedier
Created: 3/5/2026
Status: ✅ Merged
Merged: 3/5/2026
Merged by: @fatedier
Base:
dev← Head:new📝 Commits (1)
1487e1dserver/group: fix port leak and incorrect Listen port in TCPGroup📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
server/group/tcp.go(+2 -1)📄 Description
Summary
Fix two bugs in
TCPGroup.Listen()(server/group/tcp.go):net.Listenfails afterportManager.Acquiresucceeds, the acquired port was never released, causing it to stay inusedPortspermanently until frps restart.net.Listenused the requestedportparameter instead ofrealPort(the actually allocated port). Whenport==0(random allocation), this caused the system to listen on a different random port than what the port manager recorded.Fix
Test plan
make build— compiles successfullymake test— all unit tests passmake e2e— 224 passed, 0 failed, 2 skipped🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.