Hi Olivier / Willy,

On Thu, Jun 07, Olivier Houchard wrote:
> Hi Willy,
> 
> On Thu, Jun 07, 2018 at 11:45:39AM +0200, Willy Tarreau wrote:
> > Hi Olivier,
> > 
> > On Wed, Jun 06, 2018 at 06:40:05PM +0200, Olivier Houchard wrote:
> > > You're right indeed, that code was not written with abns sockets in mind.
> > > The attached patch should fix it. It was created from master, but should
> > > apply to 1.8 as well.
> > > 
> > > Thanks !
> > > 
> > > Olivier
> > 
> > > >From 3ba0fbb7c9e854aafb8a6b98482ad7d23bbb414d Mon Sep 17 00:00:00 2001
> > > From: Olivier Houchard <ohouch...@haproxy.com>
> > > Date: Wed, 6 Jun 2018 18:34:34 +0200
> > > Subject: [PATCH] MINOR: unix: Make sure we can transfer abns sockets as 
> > > well  on seamless reload.
> > 
> > Would you be so kind as to tag it "BUG" so that our beloved stable
> > team catches it for the next 1.8 ? ;-)
> > 
> 
> Sir yes sir.
> 
> > > diff --git a/src/proto_uxst.c b/src/proto_uxst.c
> > > index 9fc50dff4..a1da337fe 100644
> > > --- a/src/proto_uxst.c
> > > +++ b/src/proto_uxst.c
> > > @@ -146,7 +146,12 @@ static int uxst_find_compatible_fd(struct listener 
> > > *l)
> > >                                   after_sockname++;
> > >                           if (!strcmp(after_sockname, ".tmp"))
> > >                                   break;
> > > -                 }
> > > +                 /* abns sockets sun_path starts with a \0 */
> > > +                 } else if (un1->sun_path[0] == 0
> > > +                     && un2->sun_path[0] == 0
> > > +                     && !strncmp(&un1->sun_path[1], &un2->sun_path[1],
> > > +                     sizeof(un1->sun_path) - 1))
> > > +                         break;
> > 
> > It may still randomly fail here because null bytes are explicitly permitted
> > in the sun_path. Instead I'd suggest this :
> > 
> >     } else if (un1->sun_path[0] == 0 &&
> >                memcmp(un1->sun_path, un2->sun_path, sizeof(un1->sun_path) 
> > == 0)
> > 
> > Jarno, if you still notice occasional failures, please try with this.
> > 
> 
> You're right, as unlikely as it can be in our current scenario, better safe
> than sorry.
> The attached patch is updated to reflect that.

Thanks !
My minimal test config with the patch works (on top of
1.8.9): (doing reloads/curl in loop).

I'll test with my normal/production config when I'll have more time
(probably few days).

-Jarno

-- 
Jarno Huuskonen

Reply via email to