cm_prepare_connection() & SMBSERVER Netbios query

Christopher R. Hertel crh at ubiqx.mn.org
Sun Dec 12 11:20:36 MST 2010


Volker Lendecke wrote:
> On Sun, Dec 12, 2010 at 05:16:56PM +0100, Volker Lendecke wrote:
>> Sure, sounds perfectly reasonable. The simplest way would be
>> to just skip 139 if winbind knows that a domain is AD. This
>> might break some obscure, broken firewall settings. So for
>> those I think winbind should improve the fallback: If you
>> get exactly that error message, retry with just 445.
>> Alternatively, it might keep the 445 connection attempt
>> queued in case we get the "name not present". In any case,
>> that should not be more than very few hours of coding. With
>> tevent_req the latter alternative should be pretty easy to
>> do. Just make two async routines: One to just connect to
>> 445 and one to connect to 139 and do the nb session setup.
>> Set up the 445 connect, wait a few milliseconds and then
>> fire the 139/nbsesssetup combo. Whichever of both gets
>> through successfully wins.
> 
> Attached find a patchset that implements this. It connects
> to 445, then to 139. It keeps the 445 connection attempt
> open until the 139 nb session setup is replied to. A
> negative nb session response is treated equivalently to a
> tcp connection timeout or so.
> 
> At least that's the idea, this patch is completely untested
> so far.

So... a question:

If both are successful, why favor the connection to port 139?  Why is that
the better option?

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the samba-technical mailing list