meaning of smb://<IP addr> (was Re: libsmbclient and IP numbers)

Richard Sharpe sharpe at
Fri Nov 16 23:21:03 GMT 2001

Richard Sharpe wrote:

> Tom Jansen wrote:
>> Hi,
>>>>>> smbc_opendir("smb://<insert IP here>/); it fails! Is this not 
>>>>>> supported?
>>>>> It works perfectly here
>> This is not true. My wrong. read on please.
> [Deletia ...]
>> Linux client: libsmbclient from HEAD
>> Linux server: samba 2.2.2
>> I've tried the following with the program snippet attached:
>> Linux client vs. Windows 2000: corona is the netbios name of the box 
>> with ip
>> o smbc_opendir(smb:// returned: -1 errno: 0 strerror: 
>> Success
>> o smbc_opendir(smb:// returned: 11024
>>   All OK!
>> o smbc_opendir(smb://corona) returned: 11024
>>   All OK!
>> o smbc_opendir(smb://corona/mp3) returned: 11024
>>   All OK!
> OK, now we get to decide what smb://<ip-addr> means. I am not sure if 
> Cris Hertel considered this in the RFC he did on the topic, and I didn't 
> when I explored this issue back in Jan or so of this year.
> My gut feeling is that if people put in an IP address, they are 
> referring to a specific server, so they expect to see the list of shares 
> exported by the server.

I have applied a patch (two patches, actually, but only one fixes the above) to check whether or not someone has said smb://<IP-addr> and treat that as a server case.

I now have to think about smb://<IP-addr>/share which seems to be 
handled by the code as it is, but not by intent! It may be best to 
simply leave it alone, however.

NOTE! The patch has been applied to 2.2.x at the moment. I might also 
soon apply it to head.

Let me know how it goes.

Richard Sharpe, rsharpe at, LPIC-1,, SAMS Teach Yourself Samba
in 24 Hours, Special Edition, Using Samba

More information about the samba-technical mailing list