aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-02-27 22:04:12 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2019-02-28 18:53:45 -0500
commitf74a53d9a567f6bc6f6d8460e84c76bd2a45d016 (patch)
treead08145718d46ecfe1600c2e6c6cf651e3513ce9 /tools/bpf/bpftool/prog.c
parentea9b6362018358a46008a8af339178469a4efe13 (diff)
tools: libbpf: add a correctly named define for map iteration
For historical reasons the helper to loop over maps in an object is called bpf_map__for_each while it really should be called bpf_object__for_each_map. Rename and add a correctly named define for backward compatibility. Switch all in-tree users to the correct name (Quentin). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 0c35dd543d49..8ef80d65a474 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -1053,7 +1053,7 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
1053 j = 0; 1053 j = 0;
1054 while (j < old_map_fds && map_replace[j].name) { 1054 while (j < old_map_fds && map_replace[j].name) {
1055 i = 0; 1055 i = 0;
1056 bpf_map__for_each(map, obj) { 1056 bpf_object__for_each_map(map, obj) {
1057 if (!strcmp(bpf_map__name(map), map_replace[j].name)) { 1057 if (!strcmp(bpf_map__name(map), map_replace[j].name)) {
1058 map_replace[j].idx = i; 1058 map_replace[j].idx = i;
1059 break; 1059 break;
@@ -1074,7 +1074,7 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
1074 /* Set ifindex and name reuse */ 1074 /* Set ifindex and name reuse */
1075 j = 0; 1075 j = 0;
1076 idx = 0; 1076 idx = 0;
1077 bpf_map__for_each(map, obj) { 1077 bpf_object__for_each_map(map, obj) {
1078 if (!bpf_map__is_offload_neutral(map)) 1078 if (!bpf_map__is_offload_neutral(map))
1079 bpf_map__set_ifindex(map, ifindex); 1079 bpf_map__set_ifindex(map, ifindex);
1080 1080