Skip to content

Commit cf980d8

Browse files
committed
lib/util: Fix build on old versions of libbpf without XDP feature flag support
The build errors out with old libbpf versions because the ifdef'ed version of iface_get_xdp_feature_flags() doesn't use any of its arguments. Change the ifdef'ed version to mark the arguments as __unused to avoid this. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent 180fa46 commit cf980d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/util/util.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,9 @@ int iface_print_status(const struct iface *iface)
864864
return err;
865865
}
866866

867+
#ifdef HAVE_LIBBPF_BPF_XDP_QUERY
867868
int iface_get_xdp_feature_flags(int ifindex, __u64 *feature_flags)
868869
{
869-
#ifdef HAVE_LIBBPF_BPF_XDP_QUERY
870870
LIBBPF_OPTS(bpf_xdp_query_opts, opts);
871871
int err;
872872

@@ -876,8 +876,10 @@ int iface_get_xdp_feature_flags(int ifindex, __u64 *feature_flags)
876876

877877
*feature_flags = opts.feature_flags;
878878
return 0;
879+
}
879880
#else
881+
int iface_get_xdp_feature_flags(__unused int ifindex, __unused __u64 *feature_flags)
882+
{
880883
return -EOPNOTSUPP;
881-
#endif
882-
883884
}
885+
#endif

0 commit comments

Comments
 (0)