nmbd FD_SET change for master/3.6

Jeremy Allison jra at samba.org
Fri Jul 1 09:24:42 MDT 2011


On Fri, Jul 01, 2011 at 08:46:42AM +0200, Stefan (metze) Metzmacher wrote:
> Hi Jeremy,
> 
> > diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
> > index a89f49c..0324c9d 100644
> > --- a/source3/nmbd/nmbd_packets.c
> > +++ b/source3/nmbd/nmbd_packets.c
> > @@ -1698,7 +1698,12 @@ static bool create_listen_pollfds(struct pollfd **pfds,
> >  	for (subrec = FIRST_SUBNET;
> >  	     subrec != NULL;
> >  	     subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
> > -		count += 2;	/* nmb_sock and dgram_sock */
> > +		if (subrec->nmb_sock != -1) {
> > +			count += 1;
> > +		}
> > +		if (subrec->dgram_sock != -1) {
> > +			count += 1;
> > +		}
> >  		if (subrec->nmb_bcast != -1) {
> >  			count += 1;
> >  		}
> 
> Can you please explain me where this can happen? I think
> nmb_sock and dgram_sock are always valid.

After close_subnet() has been called. This sets all
of nmb_sock, nmb_bcast, dgram_sock, dgram_bcast to -1...

Ah - ok - I was missing the point of removal of the
subrec struct from the linked list that the poll
code looks at inside close_subnet().

Ok, I'm fine with you reverting this.

Jeremy.


More information about the samba-technical mailing list