Skip to content

Commit

Permalink
datapath: Fix conditional compilation
Browse files Browse the repository at this point in the history
[ upstream commit 6e2ce4a ]

Use the same condition in defining the label 'skip_policy_enforcement' as
for jumping to it. Otherwise we could jump to a nonexisting label given a
suitable datapath configuration. This does not seem possible now, as
ENABLE_HOST_SERVICES_FULL should not be defined if
ENABLE_SOCKET_LB_HOST_ONLY is defined. However, as the conditions for
defining ENABLE_PER_PACKET_LB evolve, this would become a compilation
bug.

Fixes: #17154
Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
  • Loading branch information
jrajahalme authored and pchaigno committed Apr 4, 2022
1 parent 1818b13 commit be5ba5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bpf/bpf_lxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,9 +1441,9 @@ ipv4_policy(struct __ctx_buff *ctx, int ifindex, __u32 src_label, __u8 *reason,
verdict, policy_match_type, audited);
}

#if !defined(ENABLE_HOST_SERVICES_FULL) && !defined(DISABLE_LOOPBACK_LB)
#if defined(ENABLE_PER_PACKET_LB) && !defined(DISABLE_LOOPBACK_LB)
skip_policy_enforcement:
#endif /* !ENABLE_HOST_SERVICES_FULL && !DISABLE_LOOPBACK_LB */
#endif /* ENABLE_PER_PACKET_LB && !DISABLE_LOOPBACK_LB */

#ifdef ENABLE_DSR
if (ret == CT_NEW || ret == CT_REOPENED) {
Expand Down

0 comments on commit be5ba5e

Please sign in to comment.