Subject: RE: OpenVPN
To: 'der Mouse' <mouse@Rodents.Montreal.QC.CA>
From: Sanjay Shridhar <sshridha@riverstonenet.com>
List: tech-net
Date: 05/11/2006 10:42:40
 

> -----Original Message-----
> From: tech-net-owner@NetBSD.org 
> [mailto:tech-net-owner@NetBSD.org] On Behalf Of der Mouse
> Sent: Thursday, May 11, 2006 6:52 AM
> To: tech-net@NetBSD.org
> Subject: Re: OpenVPN
> 
> >> 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:
> 
> > MSG_NOSIGNAL
> >  	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);

If you do this, you would have version compatibility issues. Maybe a nice
additional feature, but increases the burden on the app space to be
compatible between versions that do and don't support this.

- Sanjay

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