Skip to content

Commit 1e3b66e

Browse files
stefano-garzarellakuba-moo
authored andcommitted
vsock: fix vsock_proto declaration
From commit 634f1a7 ("vsock: support sockmap"), `struct proto vsock_proto`, defined in af_vsock.c, is not static anymore, since it's used by vsock_bpf.c. If CONFIG_BPF_SYSCALL is not defined, `make C=2` will print a warning: $ make O=build C=2 W=1 net/vmw_vsock/ ... CC [M] net/vmw_vsock/af_vsock.o CHECK ../net/vmw_vsock/af_vsock.c ../net/vmw_vsock/af_vsock.c:123:14: warning: symbol 'vsock_proto' was not declared. Should it be static? Declare `vsock_proto` regardless of CONFIG_BPF_SYSCALL, since it's defined in af_vsock.c, which is built regardless of CONFIG_BPF_SYSCALL. Fixes: 634f1a7 ("vsock: support sockmap") Signed-off-by: Stefano Garzarella <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ae8f160 commit 1e3b66e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/af_vsock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
243243
int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
244244
size_t len, int flags);
245245

246-
#ifdef CONFIG_BPF_SYSCALL
247246
extern struct proto vsock_proto;
247+
#ifdef CONFIG_BPF_SYSCALL
248248
int vsock_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
249249
void __init vsock_bpf_build_proto(void);
250250
#else

0 commit comments

Comments
 (0)