Skip to content

Commit

Permalink
bpf: Add missing traces for reply traffic to the proxy
Browse files Browse the repository at this point in the history
[ upstream commit 503417a ]

This commit adds two missing packet traces for reply traffic to the
proxy. Because of those missing traces, we would see a from-container
not followed by any to-xxx trace.

Backporting conflicts:
* replaced SECLABEL_IPV{4,6} with SECLABEL

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Signed-off-by: Gilberto Bertin <jibi@cilium.io>

add missing traces
  • Loading branch information
pchaigno authored and jibi committed Sep 5, 2023
1 parent 490bdb4 commit 636580a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bpf/bpf_lxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ static __always_inline int handle_ipv6_from_lxc(struct __ctx_buff *ctx, __u32 *d
if (ct_status == CT_REPLY || ct_status == CT_RELATED) {
/* Check if this is return traffic to an ingress proxy. */
if (ct_state->proxy_redirect) {
send_trace_notify(ctx, TRACE_TO_PROXY, SECLABEL,
0, 0, 0, trace.reason,
trace.monitor);
/* Stack will do a socket match and deliver locally. */
return ctx_redirect_to_proxy6(ctx, tuple, 0, false);
}
Expand Down Expand Up @@ -877,6 +880,9 @@ static __always_inline int handle_ipv4_from_lxc(struct __ctx_buff *ctx, __u32 *d
if (ct_status == CT_REPLY || ct_status == CT_RELATED) {
/* Check if this is return traffic to an ingress proxy. */
if (ct_state->proxy_redirect) {
send_trace_notify(ctx, TRACE_TO_PROXY, SECLABEL,
0, 0, 0, trace.reason,
trace.monitor);
/* Stack will do a socket match and deliver locally. */
return ctx_redirect_to_proxy4(ctx, tuple, 0, false);
}
Expand Down

0 comments on commit 636580a

Please sign in to comment.