Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Remove unneeded orig_dip from ipv6_host_policy_egress #23724

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions bpf/lib/host_firewall.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ipv6_host_policy_egress(struct __ctx_buff *ctx, __u32 src_id,
struct remote_endpoint_info *info;
struct ipv6_ct_tuple tuple = {};
__u32 dst_id = 0;
union v6addr orig_dip;
void *data, *data_end;
struct ipv6hdr *ip6;
__u16 proxy_port = 0;
Expand All @@ -41,7 +40,6 @@ ipv6_host_policy_egress(struct __ctx_buff *ctx, __u32 src_id,
tuple.nexthdr = ip6->nexthdr;
ipv6_addr_copy(&tuple.saddr, (union v6addr *)&ip6->saddr);
ipv6_addr_copy(&tuple.daddr, (union v6addr *)&ip6->daddr);
ipv6_addr_copy(&orig_dip, (union v6addr *)&ip6->daddr);
hdrlen = ipv6_hdrlen(ctx, &tuple.nexthdr);
if (hdrlen < 0)
return hdrlen;
Expand All @@ -54,11 +52,11 @@ ipv6_host_policy_egress(struct __ctx_buff *ctx, __u32 src_id,
trace->reason = (enum trace_reason)ret;

/* Retrieve destination identity. */
info = lookup_ip6_remote_endpoint(&orig_dip, 0);
info = lookup_ip6_remote_endpoint((union v6addr *)&ip6->daddr, 0);
if (info && info->sec_label)
dst_id = info->sec_label;
cilium_dbg(ctx, info ? DBG_IP_ID_MAP_SUCCEED6 : DBG_IP_ID_MAP_FAILED6,
orig_dip.p4, dst_id);
ip6->daddr.s6_addr32[3], dst_id);

/* Reply traffic and related are allowed regardless of policy verdict. */
if (ret == CT_REPLY || ret == CT_RELATED)
Expand Down