From f69ed59e64acac52c1f8b3f8c7a76c5db0bc5877 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 29 Jun 2020 14:10:54 +0200 Subject: swrap: add basic support for fd-passing via SCM_RIGHTS We only allow passing up to 6 fds in a single sendmsg call, in order to keep the logic simple. That's more than enough for Samba's use of fd-passing, there we only pass a single fd and the fd will be closed in the sender on success. It means it's ok to keep the socket_info.io.pck_{snd,rcv} fields per process and the PCAP generation will still work as expected. If these constraints turn out to be a problem for other applications, we need to change to a more complex design and move the socket_info array into a shared memory file and use shared robust mutexes. But for now we just want to support multi-channel testing in Samba. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11899 Signed-off-by: Stefan Metzmacher Reviewed-by: Anoop C S Reviewed-by: Andreas Schneider --- doc/socket_wrapper.1 | 15 +++++++++++++-- doc/socket_wrapper.1.txt | 5 ++++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/socket_wrapper.1 b/doc/socket_wrapper.1 index ec7f4b8..3bd171e 100644 --- a/doc/socket_wrapper.1 +++ b/doc/socket_wrapper.1 @@ -2,12 +2,12 @@ .\" Title: socket_wrapper .\" Author: Samba Team .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 2018-11-28 +.\" Date: 2021-02-01 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "SOCKET_WRAPPER" "1" "2018\-11\-28" "\ \&" "\ \&" +.TH "SOCKET_WRAPPER" "1" "2021\-02\-01" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -68,6 +68,17 @@ Support for IPv4 and IPv6 socket and addressing emulation\&. .\} Ability to capture network traffic in pcap format\&. .RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Passing IP sockets (up to 6) via SCM_RIGHTS is supported, but pcap support only works reliable if the socket is used by a single process at a time\&. +.RE .SH "ENVIRONMENT VARIABLES" .PP \fBSOCKET_WRAPPER_DIR\fR diff --git a/doc/socket_wrapper.1.txt b/doc/socket_wrapper.1.txt index d070fbf..425b08f 100644 --- a/doc/socket_wrapper.1.txt +++ b/doc/socket_wrapper.1.txt @@ -1,6 +1,6 @@ socket_wrapper(1) ================= -:revdate: 2018-11-28 +:revdate: 2021-02-01 :author: Samba Team NAME @@ -24,6 +24,9 @@ testing of complex network configurations. - Redirects all network communication to happen over Unix sockets. - Support for IPv4 and IPv6 socket and addressing emulation. - Ability to capture network traffic in pcap format. +- Passing IP sockets (up to 6) via SCM_RIGHTS is supported, + but pcap support only works reliable if the socket is used + by a single process at a time. ENVIRONMENT VARIABLES --------------------- -- cgit