瀏覽代碼

bpf: add get_next_key callback to LPM map

map_get_next_key callback is mandatory. Supply dummy handler.

Fixes: b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexei Starovoitov 8 年之前
父節點
當前提交
f38837b08d
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      kernel/bpf/lpm_trie.c

+ 6 - 0
kernel/bpf/lpm_trie.c

@@ -500,9 +500,15 @@ unlock:
 	raw_spin_unlock(&trie->lock);
 	raw_spin_unlock(&trie->lock);
 }
 }
 
 
+static int trie_get_next_key(struct bpf_map *map, void *key, void *next_key)
+{
+	return -ENOTSUPP;
+}
+
 static const struct bpf_map_ops trie_ops = {
 static const struct bpf_map_ops trie_ops = {
 	.map_alloc = trie_alloc,
 	.map_alloc = trie_alloc,
 	.map_free = trie_free,
 	.map_free = trie_free,
+	.map_get_next_key = trie_get_next_key,
 	.map_lookup_elem = trie_lookup_elem,
 	.map_lookup_elem = trie_lookup_elem,
 	.map_update_elem = trie_update_elem,
 	.map_update_elem = trie_update_elem,
 	.map_delete_elem = trie_delete_elem,
 	.map_delete_elem = trie_delete_elem,