[PATCH] Unix datagram socket messaging

Jeremy Allison jra at samba.org
Tue Apr 22 12:44:47 MDT 2014


On Tue, Apr 22, 2014 at 08:40:34PM +0200, Stefan (metze) Metzmacher wrote:
> Am 22.04.2014 19:44, schrieb Jeremy Allison:
> > On Tue, Apr 22, 2014 at 05:52:12PM +0200, Stefan (metze) Metzmacher wrote:
> > 
> > OK - latest patchset with the following changes:
> > 
> >> My idea was to pass 'struct tevent_context *ev' to make it clear that
> >> this has to be this specific type.
> > 
> > Fixed.
> > 
> >> There's a 2nd socket(AF_UNIX, SOCK_DGRAM, 0); in
> >> unix_dgram_send_queue_init()
> >> which needs to set just FD_CLOEXEC.
> > 
> > Fixed. I split the prepare_socket function
> > into two, one to set O_NONBLOCK, one to
> > set CLOEXEC to improve code reuse.
> > 
> >> One of the tests explicitly passes path==NULL to unix_msg_init()
> >> and then unix_dgram_init().
> >>
> >> Maybe the better fix would be only call
> >> ctx->created_pid = getpid(); when we call bind()
> >> and set it to -1 otherwise.
> >>
> >> Then 'if (getpid() == ctx->created_pid) {' would do the correct thing.
> > 
> > I restored Volker's path == NULL handling
> > and implemented your requested change.
> > 
> > Although I'm not keen on the explicit allowing
> > of path==NULL, after looking at the test I
> > do see the use of it, so fixed it as you
> > recommended.
> > 
> > Let me know if this is OK to go in.
> 
> I'm getting this:
> 
> #> bin/msgtest
> no talloc stackframe at ../source3/param/loadparm.c:4595, leaking memory
> PANIC: No talloc stackframe
> Abgebrochen (Speicherabzug geschrieben)

OK, I'll take a look with the updated patchset - have
to be later this afternoon (my time) as I have some
Google stuff to do first.

Thanks for the reviews !

Jeremy.


More information about the samba-technical mailing list