This series is based on my series fixing bug 176 (regression in auto forwarding). The fact that outbound forwarding sockets are bound to the loopback address, whereas inbound forwarding sockets are (by default) bound to the unspecified address leads to some unexpected differences between the paths setting up each of them. An idea for tackling bug 100 suggested a different approach which will also reduce some of those differences and allow more code to be shared between the two paths. I've since discovered that this approach doesn't help for bug 100, but I think it's still worthwhile for other reasons. v5: - Combine with SO_BINDTODEVICE and bug 113 patch series - Add fallback handling for kernels without SO_BINDTODEVICE - Add missing struct field documentation for no_bindtodevice v4: - Add cleanup patch removing unused structure field - Rebase, fixing conflicts with Laurent's changes - A bunch of spelling and other cosmetic fixes - Clarify relation to bug 100 and bug 113 v3: - A number of additional fixes covering the handling of IPV6_V6ONLY sockopt - Assorted trivial changes v2: - Some rearrangements and rewordings for clarity David Gibson (15): util: Correct error message on SO_BINDTODEVICE failure util: Extend sock_probe_mem() to sock_probe_features() conf: More useful errors for kernels without SO_BINDTODEVICE flow: Remove bogus @path field from flowside_sock_args inany: Let length of sockaddr_inany be implicit from the family util, flow, pif: Simplify sock_l4_sa() interface tcp: Merge tcp_ns_sock_init[46]() into tcp_sock_init_one() udp: Unify some more inbound/outbound parts of udp_sock_init() udp: Move udp_sock_init() special case to its caller util: Fix setting of IPV6_V6ONLY socket option tcp, udp: Remove fallback if creating dual stack socket fails tcp, udp: Bind outbound listening sockets by interface instead of address util: Rename sock_l4_dualstack() to sock_l4_dualstack_any() tcp: Always populate oaddr field for socket initiated flows fwd: Preserve non-standard loopback address when splice forwarding conf.c | 16 ++++- flow.c | 22 +++---- fwd.c | 4 +- icmp.c | 3 +- inany.h | 17 ++++++ passt.c | 2 +- passt.h | 2 + pif.c | 27 ++------- pif.h | 2 +- tcp.c | 162 +++++++++++++++++++++------------------------------ tcp.h | 5 +- tcp_splice.c | 5 +- udp.c | 122 +++++++++++++++++++++----------------- udp.h | 5 +- util.c | 102 +++++++++++++++++++++++++++----- util.h | 10 ++-- 16 files changed, 289 insertions(+), 217 deletions(-) -- 2.52.0