#758
forwarder: recreate stale connected UDP sockets
Summary
Connected UDP sockets can remain bound to a source IP that disappears after a host network change. Writes then keep failing with EADDRNOTAVAIL, leaving long-lived UDP flows broken indefinitely.
Retire the stale socket when a write returns EADDRNOTAVAIL, redial, and retry that datagram once. Track socket identity so the old reply loop cannot remove a replacement connection when it exits.
Fixes #648.
Testing
go test ./pkg/services/forwarder -count=1go test -race ./pkg/services/forwarder -run TestUDPProxy -count=1git diff --check
The full go test ./... run did not complete: it entered the QEMU end-to-end suite and was stopped while its setup was still running.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: sairex53 Once this PR has been reviewed and has the lgtm label, please assign vyasgun for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing
/approvein a comment Approvers can cancel approval by writing/approve cancelin a comment