nmbd FD_SET change for master/3.6

Stefan (metze) Metzmacher metze at samba.org
Fri Jul 1 00:46:42 MDT 2011


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.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110701/5349344d/attachment.pgp>


More information about the samba-technical mailing list