UDP relay fails with "Operation not permitted (os error 1)" when sending response back to client
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
shadowsocks/shadowsocks-rust のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
shadowsocks/shadowsocks-rust#2192 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
shadowsocks/shadowsocks-rust#2191 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
EncryptedWriter encrypts through a buffer pointer that `put_u16`/`put_slice` already invalidatedオープン
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
shadowsocks/shadowsocks-rust#2190 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
shadowsocks/shadowsocks-rust#2185 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
shadowsocks/shadowsocks-rust#2171 ·
メンテナーはふだん 1 日以内に返信
shadowsocks/shadowsocks-rust の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
home-assistant/installer#308 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ProvableHQ/leo#29657 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
swc-project/swc-next#1053 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nautechsystems/nautilus_trader#5387 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NomicFoundation/edr#1872 ·
メンテナーはふだん 2 日以内に返信