Skip to content

Commit

Permalink
bpf: overlay: add drop notify for __encap_and_redirect_with_nodeid()
Browse files Browse the repository at this point in the history
[ upstream commit c058e9b ]

Align with all the other error paths in tail_handle_arp() and raise a drop
notification on error. This function is executed as a tail-call, so there's
no surrounding code that would do this for us otherwise.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann authored and jrajahalme committed Oct 9, 2023
1 parent 67c3cc1 commit 327471c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bpf/bpf_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,18 @@ int tail_handle_arp(struct __ctx_buff *ctx)
ret = arp_prepare_response(ctx, &mac, tip, &smac, sip);
if (unlikely(ret != 0))
return send_drop_notify_error(ctx, 0, ret, CTX_ACT_DROP, METRIC_EGRESS);
if (info->tunnel_endpoint)
return __encap_and_redirect_with_nodeid(ctx,
info->tunnel_endpoint,
SECLABEL,
WORLD_ID,
&trace);

return send_drop_notify_error(ctx, 0, DROP_UNKNOWN_L3, CTX_ACT_DROP, METRIC_EGRESS);
if (info->tunnel_endpoint) {
ret = __encap_and_redirect_with_nodeid(ctx, info->tunnel_endpoint,
SECLABEL, WORLD_ID, &trace);
if (IS_ERR(ret))
goto drop_err;

return ret;
}

ret = DROP_UNKNOWN_L3;
drop_err:
return send_drop_notify_error(ctx, 0, ret, CTX_ACT_DROP, METRIC_EGRESS);

pass_to_stack:
send_trace_notify(ctx, TRACE_TO_STACK, 0, 0, 0, ctx->ingress_ifindex,
Expand Down

0 comments on commit 327471c

Please sign in to comment.