Subject: Re: OpenVPN
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 05/11/2006 09:51:43
>> There is no nonportability here unless they care about portability
>> across the silent API change (which is unlikely) or unless Linux
>> does it gratuitously differently (which is reasonably likely,
>> actually).
> The struct msghdr and function arguments are identical.  However,
> OpenVPN does use a flag not defined in NetBSD:

>  	Requests not to send SIGPIPE on errors on stream oriented
>  	sockets when the other end breaks the connection.  The EPIPE
>  	error is still returned.

> That doesn't look like a showstopper...

Depends on how OpenVPN uses it.  But, looking at the code for SIGPIPE
generation, it looks as though this would be dead easy to add to
NetBSD.  sendit(), in uipc_syscalls.c, is the only place that I think
needs to be touched:

-                if (error == EPIPE)
-                        psignal(p, SIGPIPE);
+                if ((error == EPIPE) && !(flags & MSG_NOSIGNAL))
+                        psignal(p, SIGPIPE);

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B