Commit graph

4 commits

Author SHA1 Message Date
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