Skip to content

Commit

Permalink
bpf_metadata: Use original source address even if the destination is …
Browse files Browse the repository at this point in the history
…external

Use the original source address if permitted even if the destination is
external to the cluster.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
  • Loading branch information
jrajahalme committed May 8, 2024
1 parent b048d1c commit 7358b64
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cilium/bpf_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,9 @@ bool Config::getMetadata(Network::ConnectionSocket& socket) {
// This means that a local host IP is used if no IP is configured to be used instead of it
// ('ip' above is null).
src_address = nullptr;
} else if (!(use_original_source_address_ &&
!(destination_identity & Cilium::ID::LocalIdentityFlag) &&
destination_identity != Cilium::ID::WORLD && !npmap_->exists(other_ip))) {
// Otherwise only use the original source address if permitted, destination identity is not a
// locally allocated identity, is not classified as WORLD, and the destination is not in the
// same node.
} else if (!use_original_source_address_ || npmap_->exists(other_ip)) {
// Otherwise only use the original source address if permitted and the destination is not
// in the same node.

// Original source address is not used
src_address = nullptr;
Expand Down

0 comments on commit 7358b64

Please sign in to comment.