Skip to content

Commit

Permalink
bpf: nat: fix build error in snat_v6_prepare_state()
Browse files Browse the repository at this point in the history
Without ENABLE_MASQUERADE_IPV6, the `remote_ep` variable isn't used. Fix up
the build.

In file included from bpf_lxc.c:56:
./cilium/bpf/lib/nat.h:1694:31: error: variable 'remote_ep' set but not used [-Werror,-Wunused-but-set-variable]
        struct remote_endpoint_info *remote_ep;
                                     ^
1 error generated.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann authored and qmonnet committed Jun 27, 2023
1 parent d1162cc commit 83950d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bpf/lib/nat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ snat_v6_prepare_state(struct __ctx_buff *ctx, struct ipv6_nat_target *target)
{
union v6addr masq_addr __maybe_unused, router_ip __maybe_unused;
const union v6addr dr_addr __maybe_unused = IPV6_DIRECT_ROUTING;
struct remote_endpoint_info *remote_ep;
struct remote_endpoint_info *remote_ep __maybe_unused;
struct endpoint_info *local_ep;
bool is_reply = false;
void *data, *data_end;
Expand Down

0 comments on commit 83950d9

Please sign in to comment.