]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
bpf: sockmap, on update propagate errors back to userspace
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 16 May 2018 23:38:14 +0000 (16:38 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 16 May 2018 23:48:22 +0000 (01:48 +0200)
When an error happens in the update sockmap element logic also pass
the err up to the user.

Fixes: e5cd3abcb31a ("bpf: sockmap, refactor sockmap routines to work with hashmap")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/sockmap.c

index 79f5e8988889609408ace9d75fca3cde77fcfc3c..c6de1393df63d74a80abd865e4a36c19c799a821 100644 (file)
@@ -1875,7 +1875,7 @@ static int sock_map_ctx_update_elem(struct bpf_sock_ops_kern *skops,
                write_unlock_bh(&osock->sk_callback_lock);
        }
 out:
-       return 0;
+       return err;
 }
 
 int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type)