Skip to content

Commit

Permalink
bpf: nodeport: populate ifindex in NAT trace event
Browse files Browse the repository at this point in the history
This helps to clarify the exact origin of a TO_NETWORK trace event.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann committed Feb 6, 2024
1 parent 2853c52 commit 1113d70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bpf/lib/nodeport.h
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ int tail_handle_snat_fwd_ipv6(struct __ctx_buff *ctx)
* for IPv6, and so it's not possible yet for masqueraded traffic to get
* redirected to another interface
*/
send_trace_notify6(ctx, obs_point, 0, 0, &saddr, 0, 0,
send_trace_notify6(ctx, obs_point, 0, 0, &saddr, 0, NATIVE_DEV_IFINDEX,
trace.reason, trace.monitor);

return ret;
Expand Down Expand Up @@ -1605,8 +1605,8 @@ int tail_handle_nat_fwd_ipv6(struct __ctx_buff *ctx)
CTX_ACT_DROP, METRIC_EGRESS);

if (ret == CTX_ACT_OK)
send_trace_notify(ctx, obs_point, 0, 0, 0, 0, trace.reason,
trace.monitor);
send_trace_notify(ctx, obs_point, 0, 0, 0, NATIVE_DEV_IFINDEX,
trace.reason, trace.monitor);

return ret;
}
Expand Down Expand Up @@ -3100,7 +3100,7 @@ int tail_handle_snat_fwd_ipv4(struct __ctx_buff *ctx)
* the interface to which the egress IP is assigned to.
*/
if (ret == CTX_ACT_OK)
send_trace_notify4(ctx, obs_point, 0, 0, saddr, 0, 0,
send_trace_notify4(ctx, obs_point, 0, 0, saddr, 0, NATIVE_DEV_IFINDEX,
trace.reason, trace.monitor);

return ret;
Expand Down Expand Up @@ -3170,8 +3170,8 @@ int tail_handle_nat_fwd_ipv4(struct __ctx_buff *ctx)
CTX_ACT_DROP, METRIC_EGRESS);

if (ret == CTX_ACT_OK)
send_trace_notify(ctx, obs_point, 0, 0, 0, 0, trace.reason,
trace.monitor);
send_trace_notify(ctx, obs_point, 0, 0, 0, NATIVE_DEV_IFINDEX,
trace.reason, trace.monitor);

return ret;
}
Expand Down

0 comments on commit 1113d70

Please sign in to comment.