Skip to content

Commit

Permalink
bpf: nodeport: don't set .addr in revSNAT target
Browse files Browse the repository at this point in the history
This was copy & pasted when splitting the SNAT / revSNAT paths in
#20425. But it doesn't make sense
for revSNAT - here we only care about the port range in the NAT target,
and just match the packet against the available revSNAT entries.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann authored and aanm committed May 12, 2023
1 parent 83268f4 commit ea67cb3
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions bpf/lib/nodeport.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ declare_tailcall_if(__not(is_defined(IS_BPF_LXC)), CILIUM_CALL_IPV6_NODEPORT_NAT
int tail_nodeport_nat_ingress_ipv6(struct __ctx_buff *ctx)
{
struct ipv6_nat_target target = {
.addr = IPV6_DIRECT_ROUTING,
.min_port = NODEPORT_PORT_MIN_NAT,
.max_port = NODEPORT_PORT_MAX_NAT,
.src_from_world = true,
Expand Down Expand Up @@ -1976,12 +1975,6 @@ int tail_nodeport_nat_ingress_ipv4(struct __ctx_buff *ctx)
.min_port = NODEPORT_PORT_MIN_NAT,
.max_port = NODEPORT_PORT_MAX_NAT,
.src_from_world = true,
/* Unfortunately, the bpf_fib_lookup() is not able to set src IP addr.
* So we need to assume that the direct routing device is going to be
* used to fwd the NodePort request, thus SNAT-ing to its IP addr.
* This will change once we have resolved GH#17158.
*/
.addr = IPV4_DIRECT_ROUTING,
};
__s8 ext_err = 0;
int ret;
Expand Down

0 comments on commit ea67cb3

Please sign in to comment.