Repository navigation
fix: ホストの経路検索に送信元IPv4アドレスを渡す - #73
Merged
Merged
Conversation
1outres
force-pushed
the
fix/host-fib-source-policy
branch
from
October 18, 2026 03:01
187bf7a to
dee7924
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
forward_via_host_fib()がbpf_fib_lookup()にパケットの送信元IPv4アドレスを渡すように修正します。原因
経路検索パラメータはゼロ初期化されていますが、
ipv4_srcが設定されていませんでした。このため、送信元プレフィックスを条件とするLinuxのポリシールーティングが、実際のパケットの送信元ではなく0.0.0.0に対して評価されます。送信元ごとに異なる上流経路を使用する環境では、NATGateway・EIP・LoadBalancerの外向き通信が意図した経路を選択できません。
変更内容
fib_params.ipv4_src = iph->saddrを追加します。CRD、経路ルール、デフォルトゲートウェイの設定は変更しません。特定のルータやネットワークに依存する値も追加していません。
検証
v1.0.0-rc.12に同じ修正を適用し、検証対象クラスタ内だけでイメージを差し替えました。developベースの双方でgo test ./...(daemonモジュール)を実行しました。権限を必要とするBPFテストは通常コンテナではスキップされるため、別途実機カーネルでverifiercheckを実行し、全プログラムの読み込み成功を確認しました。この検証は送信元に基づく経路選択の修正を確認するものであり、上流ネットワークを含む全宛先への到達性を保証するものではありません。