Skip to content

net/proto-vsock.c: fix build on older distros#57

Merged
kernelslacker merged 1 commit into
kernelslacker:masterfrom
jirislaby:master
Apr 17, 2026
Merged

net/proto-vsock.c: fix build on older distros#57
kernelslacker merged 1 commit into
kernelslacker:masterfrom
jirislaby:master

Conversation

@jirislaby

Copy link
Copy Markdown
Contributor

Older distros do not include sys/socket.h -- added only by commit 22bbc1dcd0d6 ("vsock/uapi: fix linux/vm_sockets.h userspace compilation errors") upstream.

So the build fails with:

In file included from net/proto-vsock.c:3:
/usr/include/linux/vm_sockets.h:182:39: error: invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’
  182 |         unsigned char svm_zero[sizeof(struct sockaddr) -
      |                                       ^~~~~~
/usr/include/linux/vm_sockets.h:183:39: error: ‘sa_family_t’ undeclared here (not in a function)
  183 |                                sizeof(sa_family_t) -
      |                                       ^~~~~~~~~~~

Include the file before vm_sockets.h.

Older distros do not include sys/socket.h -- added only by commit
22bbc1dcd0d6 ("vsock/uapi: fix linux/vm_sockets.h userspace compilation
errors") upstream.

So the build fails with:
In file included from net/proto-vsock.c:3:
/usr/include/linux/vm_sockets.h:182:39: error: invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’
  182 |         unsigned char svm_zero[sizeof(struct sockaddr) -
      |                                       ^~~~~~
/usr/include/linux/vm_sockets.h:183:39: error: ‘sa_family_t’ undeclared here (not in a function)
  183 |                                sizeof(sa_family_t) -
      |                                       ^~~~~~~~~~~

Include the file before vm_sockets.h.
@kernelslacker
kernelslacker merged commit b725d48 into kernelslacker:master Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants