]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tools: bpftool: fix completion for "bpftool map update"
authorQuentin Monnet <quentin.monnet@netronome.com>
Sat, 20 Oct 2018 22:01:50 +0000 (23:01 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:15 +0000 (14:21 -0300)
commitc328ab29cfb39150af0277542f88d0adea8434c3
treef0ca6ee00cd4cf17b9acbef0127a2ba2cf21512d
parent9c18e91295d781fac9e621eda4173cd4ecee0fce
tools: bpftool: fix completion for "bpftool map update"

BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit fe8ecccc10b3adc071de05ca7af728ca1a4ac9aa ]

When trying to complete "bpftool map update" commands, the call to
printf would print an error message that would show on the command line
if no map is found to complete the command line.

Fix it by making sure we have map ids to complete the line with, before
we try to print something.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/bpf/bpftool/bash-completion/bpftool