Commit Graph
15 Commits
Author SHA1 Message Date
Mike Yuan f66eeedf6f missing_socket: add SO_PASSRIGHTS 2025-06-17 13:16:42 +02:00
Daan De Meyer 0c15577abe basic + fundamental: Clean up includes
Split out of #37344.
2025-05-25 10:06:07 +02:00
Yu Watanabe 4216018807 missing_socket: drop unnecessary definitions and update comments
- SO_PEERGROUPS is since kernel v4.13
  (28b5ba2aa0f55d80adb2624564ed2b170c19519e),
- SO_BINDTOIFINDEX is since kernel v5.1
  (f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c).
2025-03-31 23:22:12 +09:00
Yu Watanabe 75b101718c missing_socket: drop unnecessary definitions
All removed definitions are in glibc-2.31
2025-03-04 02:24:49 +09:00
Lennart Poettering cb42df5310 sd-daemon: add fd array size safety check to sd_notify_with_fds()
The previous commit removed the UINT_MAX check for the fd array. Let's
now re-add one, but at a better place, and with a more useful limit. As
it turns out the kernel does not allow passing more than 253 fds at the
same time, hence use that as limit. And do so immediately before
calculating the control buffer size, so that we catch multiplication
overflows.
2024-11-04 12:10:09 +01:00
Yu Watanabe 85fd8df03d missing_socket: drop unnecessary definitions
Now, we have copy of vm_sockets.h, hence these definitions are not
necessary anymore.
2024-09-09 14:52:18 +09:00
Mike Yuan 31d76a1702 missing_socket: add SCM_PASSPIDFD and SCM_PIDFD
Preparation for later commits.
2024-07-21 22:50:58 +02:00
Lennart Poettering 41dd51f8f5 missing: add a bunch of vsock related defines 2024-01-05 22:29:55 +01:00
Lennart Poettering da5e0c442b socket-util: add helper for getting peer pidfd 2024-01-02 17:57:34 +01:00
Lennart Poettering 00ed2fff1a socket-util: add sockopt helper for controlling IP_RECVFRAGSIZE 2020-12-07 13:46:35 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Yu Watanabe 180c22328b missing: add IPV6_FREEBIND 2020-09-04 23:53:18 +09:00
Lennart Poettering f6dbcebdc2 sd-device: check netlink netns matches host netns before using monitor
Tracking down #15931 confused the hell out of me, since running homed in
gdb from the command line worked fine, but doing so as a service failed.
Let's make this more debuggable and check if we live in the host netns
when allocating a new udev monitor.

This is just debug stuff, so that if things don't work, a quick debug
run will reveal what is going on.

That said, while we are at it, also fix unexpected closing of passed in
fd when failing.
2020-05-29 15:28:10 +09:00
Lennart Poettering 5d594d012d socket-util: add wrappers for binding socket to ifindex/ifname
socket_bind_to_ifindex() uses the the SO_BINDTOIFINDEX sockopt of kernel
5.0, with a fallback to SO_BINDTODEVICE on older kernels.

socket_bind_to_ifname() is a trivial wrapper around SO_BINDTODEVICE, the
only benefit of using it instead of SO_BINDTODEVICE directly is that it
determines the size of the interface name properly so that it also works
for unbinding. Moreover, it's an attempt to unify our invocations of the
sockopt with a size of strlen(ifname) rather than strlen(ifname)+1...
2019-03-18 12:02:32 +01:00
Yu Watanabe 66ffbdf933 missing: move socket related definitions to missing_socket.h 2018-12-06 13:25:24 +01:00