[PATCH iproute2 v2] ip: drop 2-char command assumption

2021-04-20 Thread Tony Ambardar
lid command. Fixes: 351efcde4e62 ("Update header files to 2.6.14") Signed-off-by: Tony Ambardar --- v2: (feedback from David Ahern) * work around problem but remain compatible with 2-char assumption --- ip/ip.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-

[PATCH iproute2] ip: drop 2-char command assumption

2021-04-17 Thread Tony Ambardar
ample, and was added in a 2005 commit without documentation. It was noticed during testing of 'ip' variants built/packaged with different feature sets (e.g. w/o BPF support). Drop the related code. Fixes: 351efcde4e62 ("Update header files to 2.6.14") Signed-off-by: Tony Ambardar ---

[PATCH iproute2] lib/bpf: add missing limits.h includes

2021-03-11 Thread Tony Ambardar
MAX' undeclared (first use in this function); did you mean 'AF_MAX'? 46 | char buf[PATH_MAX], *s; | ^~~~ | AF_MAX Reported-by: Rui Salvaterra Signed-off-by: Tony Ambardar --- lib/bpf_glue.c | 2 ++ lib/bpf_libbpf.c | 1 + 2 files changed,

[PATCH bpf v1 1/3] bpf: fix sysfs export of empty BTF section

2020-09-19 Thread Tony Ambardar
sysfs") Signed-off-by: Tony Ambardar --- kernel/bpf/sysfs_btf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/bpf/sysfs_btf.c b/kernel/bpf/sysfs_btf.c index 3b495773de5a..11b3380887fa 100644 --- a/kernel/bpf/sysfs_btf.c +++ b/kernel/bpf/sysfs_btf.c @@ -30

[PATCH bpf v1 0/3] fix BTF usage on embedded systems

2020-09-19 Thread Tony Ambardar
lcome! Thanks, Tony [1] https://lore.kernel.org/bpf/capgfte8ipaacanm9xmhfabxcl-xrcxgmosx-nsjvz9wnh3z...@mail.gmail.com/ Tony Ambardar (3): bpf: fix sysfs export of empty BTF section bpf: prevent .BTF section elimination libbpf: fix native endian assumption when parsing BTF include/asm-ge

[PATCH bpf v1 2/3] bpf: prevent .BTF section elimination

2020-09-19 Thread Tony Ambardar
kernels. Fixes: 90ceddcb4950 ("bpf: Support llvm-objcopy for vmlinux BTF") Signed-off-by: Tony Ambardar --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.l

[PATCH bpf v1 3/3] libbpf: fix native endian assumption when parsing BTF

2020-09-19 Thread Tony Ambardar
is not supported Fixes: 94a1fedd63ed ("libbpf: Add btf__parse_raw() and generic btf__parse() APIs") Signed-off-by: Tony Ambardar --- tools/lib/bpf/btf.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 7dfca7016aaa..6bdbc389b

Re: [PATCH bpf v1] tools/bpftool: support passing BPFTOOL_VERSION to make

2020-09-17 Thread Tony Ambardar
On Thu, 17 Sep 2020 at 16:27, Song Liu wrote: > > On Thu, Sep 17, 2020 at 7:58 AM Quentin Monnet wrote: > > > > On 17/09/2020 12:58, Tony Ambardar wrote: > > > This change facilitates out-of-tree builds, packaging, and versioning for > > > test and debug purpo

[PATCH bpf v1] tools/bpftool: support passing BPFTOOL_VERSION to make

2020-09-17 Thread Tony Ambardar
eral other includes from outside the tools tree. Signed-off-by: Tony Ambardar --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 8462690a039b..4828913703b6 100644 --- a/tools/bpf/bpftoo

[PATCH bpf v1] tools/libbpf: avoid counting local symbols in ABI check

2020-09-05 Thread Tony Ambardar
on. Fixes: 306b267cb3c4 ("libbpf: Verify versioned symbols") Signed-off-by: Tony Ambardar --- tools/lib/bpf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index b78484e7a608..9ae8f4ef0aac 100644 --- a/tools/lib/bpf/Makefile

Re: [PATCH bpf v1] libbpf: fix build failure from uninitialized variable warning

2020-09-02 Thread Tony Ambardar
On Mon, 31 Aug 2020 at 07:59, Daniel Borkmann wrote: > > On 8/31/20 2:03 AM, Tony Ambardar wrote: > > While compiling libbpf, some GCC versions (at least 8.4.0) have difficulty > > determining control flow and a emit warning for potentially uninitialized > > usage of &

[PATCH bpf v1] libbpf: fix build failure from uninitialized variable warning

2020-08-30 Thread Tony Ambardar
ap *map, *targ_map; ^~~ The warning/error is false based on code inspection, so silence it with a NULL initialization. Fixes: 646f02ffdd49 ("libbpf: Add BTF-defined map-in-map support") Ref: 063e68813391 ("libbpf: Fix false uninitialized variable warning") Sig

Re: [PATCH bpf-next v4] bpftool: use only nftw for file tree parsing

2020-07-21 Thread Tony Ambardar
On Tue, 21 Jul 2020 at 14:50, Daniel Borkmann wrote: > > On 7/21/20 4:48 AM, Tony Ambardar wrote: > > The bpftool sources include code to walk file trees, but use multiple > > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > > is widely availabl

[PATCH bpf-next v4] bpftool: use only nftw for file tree parsing

2020-07-20 Thread Tony Ambardar
lso fix an unsafe call to dirname() by duplicating the string to pass, since some implementations may directly alter it. The same approach is used in libbpf.c. Signed-off-by: Tony Ambardar --- V4: * fix return value from build_pinned_obj_table() V3: * clarify dirname() path copy in commit mes

Re: [PATCH bpf-next v3] bpftool: use only nftw for file tree parsing

2020-07-20 Thread Tony Ambardar
On Mon, 20 Jul 2020 at 01:13, Quentin Monnet wrote: > > On 17/07/2020 23:55, Tony Ambardar wrote: > > The bpftool sources include code to walk file trees, but use multiple > > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > > is widely availabl

[PATCH bpf-next v3] bpftool: use only nftw for file tree parsing

2020-07-17 Thread Tony Ambardar
lso fix an unsafe call to dirname() by duplicating the string to pass, since some implementations may directly alter it. The same approach is used in libbpf.c. Signed-off-by: Tony Ambardar --- V3: * clarify dirname() path copy in commit message * fix whitespace and rearrange comment for clar

Re: [PATCH bpf-next v2] bpftool: use only nftw for file tree parsing

2020-07-17 Thread Tony Ambardar
On Thu, 16 Jul 2020 at 02:14, Quentin Monnet wrote: > > 2020-07-15 22:29 UTC-0700 ~ Tony Ambardar > > The bpftool sources include code to walk file trees, but use multiple > > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > > is widely availabl

[PATCH bpf-next v2] bpftool: use only nftw for file tree parsing

2020-07-15 Thread Tony Ambardar
t musl for OpenWrt. Signed-off-by: Tony Ambardar --- V2: * use _GNU_SOURCE to pull in getpagesize(), getline(), nftw() definitions * use "const char *" in open_obj_pinned() and open_obj_pinned_any() * make dirname() safely act on a string copy --- tools/bpf/bp

Re: [PATCH bpf-next] bpftool: use only nftw for file tree parsing

2020-07-15 Thread Tony Ambardar
On Wed, 15 Jul 2020 at 10:35, Quentin Monnet wrote: > > 2020-07-14 22:12 UTC-0700 ~ Tony Ambardar > > The bpftool sources include code to walk file trees, but use multiple > > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > > is widely availabl

[PATCH bpf-next] bpftool: use only nftw for file tree parsing

2020-07-14 Thread Tony Ambardar
portability of bpftool, in particular for embedded systems. Standardize usage by rewriting one fts-based function to use nftw. This change allows building bpftool against musl for OpenWrt. Signed-off-by: Tony Ambardar --- tools/bpf/bpftool/common.c | 102 - 1 file

Re: [PATCH iproute2] configure: support ipset version 7 with kernel version 5

2020-07-08 Thread Tony Ambardar
On Wed, 8 Jul 2020 at 08:49, Stephen Hemminger wrote: > > On Tue, 7 Jul 2020 00:58:33 -0700 > Tony Ambardar wrote: > > > The configure script checks for ipset v6 availability but doesn't test > > for v7, which is backward compatible and used on kernel v5.x systems.

[PATCH iproute2] configure: support ipset version 7 with kernel version 5

2020-07-07 Thread Tony Ambardar
The configure script checks for ipset v6 availability but doesn't test for v7, which is backward compatible and used on kernel v5.x systems. Update the script to test for both ipset versions. Without this change, the tc ematch function em_ipset will be disabled. Signed-off-by: Tony Amb