Skip to content

Commit

Permalink
bpf: host: check ep->tunnel_endpoint in do_netdev_encrypt_encap()
Browse files Browse the repository at this point in the history
__encap_and_redirect_with_nodeid() expects the caller to handle this check.
Otherwise we end up encapsulating with an OuterDstIP of 0.0.0.0.

I looked at all the other users, looks like this was the only one missing.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann authored and aanm committed May 12, 2023
1 parent 9788f53 commit e92863c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bpf/bpf_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ static __always_inline int do_netdev_encrypt_encap(struct __ctx_buff *ctx, __u32
break;
# endif /* ENABLE_IPV4 */
}
if (!ep)
if (!ep || !ep->tunnel_endpoint)
return DROP_NO_TUNNEL_ENDPOINT;

ctx->mark = 0;
Expand Down

0 comments on commit e92863c

Please sign in to comment.