Name Resolution priority change #1228

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

odon commented Jul 30, 2012

My NAS has multiple interfaces which provide samba shares on different independent networks.

nmblookup returns all IP but XBMC only get the last one. If this IP is the not on reachable from XBMC client network, source scanning does not work. Therefore, this patch prioritize IP lookup by DNS to nmblookup.

Member

arnova commented Jul 30, 2012

I don't think this is the correct approach since this would always prioritize a DNS lookup over a NMB lookup right? Rendering the last one rather useless in many cases.

Contributor

odon commented Jul 30, 2012

NMB lookup will still be useful for users without local DNS. But it might be annoying to do a request over internet before.
Maybe try to ping all NMB returend IP's in case of multiple answers ?

Member

arnova commented Jul 31, 2012

Doing DNS prior to NMB is certainly wrong. I think the one and only proper approach would be changing the NMB implementation so that it can handle multiple IPs.

Member

elupus commented Aug 15, 2012

Think it would suffer the same issue after the change. The dns lookup could return multiple addresses. I suppose gethostbyname is usually smarter and prioritizes reachable ips. But don't think that is guaranteed. We should probably be smarter our selves here.

What real issue is it that this causes btw?

Contributor

odon commented Aug 15, 2012

Issue is that on Linux with nmblookup installed, XBMC can't reach hosts which returns multiple IP and where the last returned IP is not reachable by XBMC client.
I had this problem with a NexentaStor File Server with 2 NICs on different networks.

Workaround is to declare NAS IP in advancedsettings.xml, but real issue for the unreachable File server is still pretty hard to identify. An other pretty useful info would be to log XBMC DNS cache updates.

Member

elupus commented Aug 15, 2012

Right, but the code you changed isn't even used for smb access. That is
handled inside libsmbclient.

It can have been used to figure out if something is on the local subnet.
But not for the access itself.
On Aug 15, 2012 9:33 PM, "odon" notifications@github.com wrote:

Issue is that on Linux with nmblookup installed, XBMC can't reach hosts
which returns multiple IP and where the last returned IP is not reachable
by XBMC client.
I had this problem with a NexentaStor File Server with 2 NICs on different
networks.

Workaround is to declare NAS IP in advancedsettings.xml, but real issue
for the unreachable File server is still pretty hard to identify. An other
pretty useful info would be to log XBMC DNS cache updates.


Reply to this email directly or view it on GitHubhttps://github.com/xbmc/xbmc/pull/1228#issuecomment-7763946.

Contributor

odon commented Aug 15, 2012

Right, I don't even use SMB within XBMC. All my shares are NFS-based. But if nmblookup is available, it seems it is used for name resolution of hostnames, whatever the protocol is.

Member

elupus commented Aug 16, 2012

Same would have applied to nfs I would have thought, but I can be wrong on
that.
Anyway best course of action is to evaluate reachability for all returned
ips.
On Aug 16, 2012 12:33 AM, "odon" notifications@github.com wrote:

Right, I don't even use SMB within XBMC. All my shares are NFS-based. But
if nmblookup is available, it seems it is used for name resolution of
hostnames, whatever the protocol is.


Reply to this email directly or view it on GitHubhttps://github.com/xbmc/xbmc/pull/1228#issuecomment-7769564.

Member

arnova commented Aug 18, 2012

IMO we should just only use NMB for SMB lookups and nothing else. I think this is also what most clients/servers do...

Owner

MartijnKaijser commented Aug 5, 2013

@odon
are you willing to update this?

Contributor

odon commented Aug 6, 2013

Sorry, no time to look on this... This is probably a very specific issue, that was more of a server-side issue (samber server advertising unreachable IP)

odon closed this Aug 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment