|
|
6bcb30 |
From a9cf0f0c57cf978ebe2abfd4c5a1b7df94f0a8ac Mon Sep 17 00:00:00 2001
|
|
|
6bcb30 |
Message-Id: <a9cf0f0c57cf978ebe2abfd4c5a1b7df94f0a8ac.1637678195.git.aclaudi@redhat.com>
|
|
|
6bcb30 |
In-Reply-To: <b30268eda844bdebbb8e5e4f5735e3b1bb666368.1637678195.git.aclaudi@redhat.com>
|
|
|
6bcb30 |
References: <b30268eda844bdebbb8e5e4f5735e3b1bb666368.1637678195.git.aclaudi@redhat.com>
|
|
|
6bcb30 |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
6bcb30 |
Date: Tue, 23 Nov 2021 15:28:18 +0100
|
|
|
6bcb30 |
Subject: [PATCH] configure: fix parsing issue on libbpf_dir option
|
|
|
6bcb30 |
|
|
|
6bcb30 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2016061
|
|
|
6bcb30 |
Upstream Status: iproute2.git commit 48c379bc
|
|
|
6bcb30 |
|
|
|
6bcb30 |
commit 48c379bc2afd43b3246f68ed46475f5318b1218f
|
|
|
6bcb30 |
Author: Andrea Claudi <aclaudi@redhat.com>
|
|
|
6bcb30 |
Date: Thu Oct 14 10:50:50 2021 +0200
|
|
|
6bcb30 |
|
|
|
6bcb30 |
configure: fix parsing issue on libbpf_dir option
|
|
|
6bcb30 |
|
|
|
6bcb30 |
configure is stuck in an endless loop if '--libbpf_dir' option is used
|
|
|
6bcb30 |
without a value:
|
|
|
6bcb30 |
|
|
|
6bcb30 |
$ ./configure --libbpf_dir
|
|
|
6bcb30 |
./configure: line 515: shift: 2: shift count out of range
|
|
|
6bcb30 |
./configure: line 515: shift: 2: shift count out of range
|
|
|
6bcb30 |
[...]
|
|
|
6bcb30 |
|
|
|
6bcb30 |
Fix it splitting 'shift 2' into two consecutive shifts, and making the
|
|
|
6bcb30 |
second one conditional to the number of remaining arguments.
|
|
|
6bcb30 |
|
|
|
6bcb30 |
A check is also provided after the while loop to verify the libbpf dir
|
|
|
6bcb30 |
exists; also, as LIBBPF_DIR does not have a default value, configure bails
|
|
|
6bcb30 |
out if the user does not specify a value after --libbpf_dir, thus avoiding
|
|
|
6bcb30 |
to produce an erroneous configuration.
|
|
|
6bcb30 |
|
|
|
6bcb30 |
Fixes: 7ae2585b865a ("configure: convert LIBBPF environment variables to command-line options")
|
|
|
6bcb30 |
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
|
|
6bcb30 |
Acked-by: Phil Sutter <phil@nwl.cc>
|
|
|
6bcb30 |
Signed-off-by: David Ahern <dsahern@kernel.org>
|
|
|
6bcb30 |
---
|
|
|
6bcb30 |
configure | 10 +++++++---
|
|
|
6bcb30 |
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
6bcb30 |
|
|
|
6bcb30 |
diff --git a/configure b/configure
|
|
|
6bcb30 |
index ea9051ab..0f304206 100755
|
|
|
6bcb30 |
--- a/configure
|
|
|
6bcb30 |
+++ b/configure
|
|
|
6bcb30 |
@@ -486,7 +486,7 @@ usage()
|
|
|
6bcb30 |
cat <
|
|
|
6bcb30 |
Usage: $0 [OPTIONS]
|
|
|
6bcb30 |
--include_dir <dir> Path to iproute2 include dir
|
|
|
6bcb30 |
- --libbpf_dir Path to libbpf DESTDIR
|
|
|
6bcb30 |
+ --libbpf_dir <dir> Path to libbpf DESTDIR
|
|
|
6bcb30 |
--libbpf_force Enable/disable libbpf by force. Available options:
|
|
|
6bcb30 |
on: require link against libbpf, quit config if no libbpf support
|
|
|
6bcb30 |
off: disable libbpf probing
|
|
|
6bcb30 |
@@ -506,8 +506,9 @@ else
|
|
|
6bcb30 |
INCLUDE="$1"
|
|
|
6bcb30 |
[ "$#" -gt 0 ] && shift ;;
|
|
|
6bcb30 |
--libbpf_dir)
|
|
|
6bcb30 |
- LIBBPF_DIR="$2"
|
|
|
6bcb30 |
- shift 2 ;;
|
|
|
6bcb30 |
+ shift
|
|
|
6bcb30 |
+ LIBBPF_DIR="$1"
|
|
|
6bcb30 |
+ [ "$#" -gt 0 ] && shift ;;
|
|
|
6bcb30 |
--libbpf_force)
|
|
|
6bcb30 |
if [ "$2" != 'on' ] && [ "$2" != 'off' ]; then
|
|
|
6bcb30 |
usage 1
|
|
|
6bcb30 |
@@ -525,6 +526,9 @@ else
|
|
|
6bcb30 |
fi
|
|
|
6bcb30 |
|
|
|
6bcb30 |
[ -d "$INCLUDE" ] || usage 1
|
|
|
6bcb30 |
+if [ "${LIBBPF_DIR-unused}" != "unused" ]; then
|
|
|
6bcb30 |
+ [ -d "$LIBBPF_DIR" ] || usage 1
|
|
|
6bcb30 |
+fi
|
|
|
6bcb30 |
|
|
|
6bcb30 |
echo "# Generated config based on" $INCLUDE >$CONFIG
|
|
|
6bcb30 |
quiet_config >> $CONFIG
|
|
|
6bcb30 |
--
|
|
|
6bcb30 |
2.31.1
|
|
|
6bcb30 |
|