Skip to content

Commit

Permalink
bpf: tests: don't define HAVE_ENCAP in IPsec tests
Browse files Browse the repository at this point in the history
This is an internal macro that's selected by common.h (based on
TUNNEL_MODE and a few other config options). There should be no need to
explicitly set it.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann committed Apr 3, 2024
1 parent 6888c64 commit 3e32efc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
1 change: 0 additions & 1 deletion bpf/tests/ipsec_from_host_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Copyright Authors of Cilium */

#define TUNNEL_MODE
#define HAVE_ENCAP
#define ENABLE_ROUTING

#define EXPECTED_STATUS_CODE CTX_ACT_REDIRECT
Expand Down
1 change: 0 additions & 1 deletion bpf/tests/ipsec_from_host_tunnel_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Copyright Authors of Cilium */

#define TUNNEL_MODE
#define HAVE_ENCAP
#define ENABLE_ENDPOINT_ROUTES 1

#define EXPECTED_STATUS_CODE CTX_ACT_REDIRECT
Expand Down
1 change: 0 additions & 1 deletion bpf/tests/ipsec_from_lxc_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Copyright Authors of Cilium */

#define TUNNEL_MODE
#define HAVE_ENCAP
#define ENABLE_ROUTING

#define EXPECTED_DEST_MAC mac_two
Expand Down
1 change: 0 additions & 1 deletion bpf/tests/ipsec_from_lxc_tunnel_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Copyright Authors of Cilium */

#define TUNNEL_MODE
#define HAVE_ENCAP
#define USE_BPF_PROG_FOR_INGRESS_POLICY 1
#define ENABLE_ENDPOINT_ROUTES 1

Expand Down
21 changes: 10 additions & 11 deletions bpf/tests/ipsec_from_network_generic.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright Authors of Cilium */

#define NODE_ID 2333
#define ENCRYPT_KEY 3
#define ENABLE_IPV4
#define ENABLE_IPV6
#define ENABLE_IPSEC
#define TUNNEL_MODE
#define ENCAP_IFINDEX 4
#define DEST_IFINDEX 5
#define DEST_LXC_ID 200

#include "common.h"
#include <bpf/ctx/skb.h>
#include "pktgen.h"
Expand All @@ -14,17 +24,6 @@
#undef SECLABEL_IPV4
#undef SECLABEL_IPV6

#define NODE_ID 2333
#define ENCRYPT_KEY 3
#define ENABLE_IPV4
#define ENABLE_IPV6
#define ENABLE_IPSEC
#define TUNNEL_MODE
#define HAVE_ENCAP
#define ENCAP_IFINDEX 4
#define DEST_IFINDEX 5
#define DEST_LXC_ID 200

#define ctx_redirect mock_ctx_redirect
int mock_ctx_redirect(const struct __sk_buff *ctx __maybe_unused, int ifindex, __u32 flags)
{
Expand Down
21 changes: 10 additions & 11 deletions bpf/tests/ipsec_from_overlay_generic.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright Authors of Cilium */

#define NODE_ID 2333
#define ENCRYPT_KEY 3
#define ENABLE_IPV4
#define ENABLE_IPV6
#define ENABLE_IPSEC
#define TUNNEL_MODE
#define ENCAP_IFINDEX 4
#define DEST_IFINDEX 5
#define DEST_LXC_ID 200

#include "common.h"
#include <bpf/ctx/skb.h>
#include "pktgen.h"
Expand All @@ -14,17 +24,6 @@
#undef SECLABEL_IPV4
#undef SECLABEL_IPV6

#define NODE_ID 2333
#define ENCRYPT_KEY 3
#define ENABLE_IPV4
#define ENABLE_IPV6
#define ENABLE_IPSEC
#define TUNNEL_MODE
#define HAVE_ENCAP
#define ENCAP_IFINDEX 4
#define DEST_IFINDEX 5
#define DEST_LXC_ID 200

#define skb_change_type mock_skb_change_type
int mock_skb_change_type(__maybe_unused struct __sk_buff *skb, __u32 type)
{
Expand Down

0 comments on commit 3e32efc

Please sign in to comment.