UDP relay fails with "Operation not permitted (os error 1)" when sending response back to client
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- linux, rust
- 领域
- networking
调研方向
未指定源文件或测试。首先使用提供的 ssserver 配置在 Linux/OpenWrt 上复现 UDP relay 失败,然后跟踪从 upstream response 到 client send 的 relay path,并检查 IPv4-mapped client address;完成标准是 UDP responses 在没有 EPERM 的情况下到达 client,并且该行为由 regression test 覆盖。
由索引模型根据 Issue 内容生成。
描述
UDP relay fails with "Operation not permitted (os error 1)" when sending response back to client
Describe the Bug
TCP works normally, but UDP relay does not.
The server successfully receives UDP packets from clients and also receives responses from upstream servers (for example DNS responses from 1.0.0.1:53), but fails when sending the UDP response back to the client.
The log repeatedly shows:
WARN udp failed to send back 43 bytes to client [::ffff:122.96.37.88]:40906, from target 1.0.0.1:53, error: Operation not permitted (os error 1)
From the log, it appears that:
- Client → Server UDP traffic succeeds.
- Server → Upstream UDP traffic succeeds.
- Upstream → Server UDP response succeeds.
- Server → Client UDP response fails with EPERM.
TCP traffic works normally.
Steps to reproduce
- Start
ssserverwith UDP enabled. - Connect using a Shadowsocks client with UDP enabled.
- Send DNS queries or any UDP traffic through the proxy.
- Observe server logs.
Expected behavior
UDP relay should work normally.
The server should forward UDP responses back to the client instead of reporting:
Operation not permitted (os error 1)
Actual behavior
The server receives upstream responses successfully but fails to send them back to the client.
Logs
INFO shadowsocks server 1.24.0
INFO shadowsocks tcp server listening on [::]:9999
INFO shadowsocks udp server listening on [::]:9999
WARN udp failed to send back 43 bytes to client [::ffff:122.96.37.88]:40906, from target 1.0.0.1:53, error: Operation not permitted (os error 1)
WARN udp failed to send back 43 bytes to client [::ffff:122.96.37.88]:13104, from target 1.0.0.1:53, error: Operation not permitted (os error 1)
WARN udp failed to send back 43 bytes to client [::ffff:122.96.37.88]:13105, from target 1.0.0.1:53, error: Operation not permitted (os error 1)
Environment
- shadowsocks-rust 1.24.0
- Linux 6.6.110
- OpenWrt / ImmortalWrt 24.10.4
- Server mode: TCP + UDP
- Cipher: chacha20-ietf-poly1305
Configuration:
{
"server": "::",
"server_port": 9999,
"mode": "tcp_and_udp",
"method": "chacha20-ietf-poly1305"
}
Also tested with:
{
"server": "0.0.0.0"
}
but the issue remains.
Additional Information
Verified:
- TCP works correctly.
- UDP requests reach the server.
- Upstream DNS responses are received successfully.
- The process has full capabilities (CAP_NET_ADMIN present).
- Changing listen address from
::to0.0.0.0does not help. - Restarting the service does not help.
The issue seems to happen only when ssserver attempts to send the UDP response back to the client.
Is this a known issue with UDP relay on Linux/OpenWrt, or could additional debugging information help identify the cause?
- 主要语言
- Rust
- 星标
- 10.9k
- 派生
- 1.5k
- 平均合并
- 4 天 41 分钟
- 30 天内合并 PR
- 9
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
shadowsocks/shadowsocks-rust 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
shadowsocks/shadowsocks-rust#2185 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
shadowsocks/shadowsocks-rust#2171 ·
-
难度 4/5 3-5 天 新手友好度 48/100
shadowsocks/shadowsocks-rust#2164 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
shadowsocks/shadowsocks-rust#2160 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
shadowsocks/shadowsocks-rust#2143 · 1 条评论 ·
查看 shadowsocks/shadowsocks-rust 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
stellar/stellar-cli#2773 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
voidzero-dev/oxc-angular-compiler#511 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 86/100
yantrikos/yantrik-os#539 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
documentation station:mac ui-dashboard
难度 2/5 1-3 小时 新手友好度 86/100
rolter-ai/rolter#2490 · 1 条评论 ·
维护者通常 1 天内回复