Android Cannot access smb shares via IPv6
#1
Hello all,

I am using Kodi Leia under Android 9 on a X2 Pro Box.

Everything is running fine, except for accessing a smb share via IPv6 over the internet.
I can access the same server fine with Kodi running under LibreElec.

When trying to add the share to the video files list, I get "Error invalid argument"
What does "Invalid argument" mean? Why is it working under LibreElec, but not under Android?

I can access lokal smb servers via the zeroconf browser fine.

The remote server is macOS Sierra.

Android has an IPv6 address, but it is not shown under Kodi/Settings/System Information.
But this was also the case under LibreElec.

Doing a tcpdump on my IPv6 gateway shows that Kodi is not even trying to access the server.

Can someone help?

-Heinrich
Reply
#2
(2019-12-12, 13:18)Heinrich23 Wrote:  
I did some more debugging. I found out that Kodi only does a type A dns request, not AAAA. Since the server in question does not have an IP4 address, Kodi cannot connect:


18:37:20.856478 192.168.178.40.38918 > 192.168.178.27.53: 62976+ A? client.rebehn.net.(35) (DF)
18:37:20.856852 192.168.178.27.30534 > 185.34.136.178.53: 48712% [1au] A? client.rebehn.net.(46)
18:37:20.895672 185.34.136.178.53 > 192.168.178.27.30534: 48712*- 0/1/0(81)
18:37:20.895830 192.168.178.27.53 > 192.168.178.40.38918: 62976 0/1/0(81)
18:38:01.758280 192.168.178.40.54432 > 192.168.178.27.53: 64753+ AAAA? play.googleapis.com.(37) (DF)
18:38:01.758619 192.168.178.27.15754 > 216.239.34.10.53: 64079% [1au] A? play.googleapis.com.(48)

Here is what my LibreElec/Kodi installation on my Rpi3 does (I had to select a different, nonexistent hostname, because client.rebehn.net seemed to have been cached somewhere):

18:55:44.938355 192.168.178.39.33888 > 192.168.178.27.53: 4262+ A? xxx.rebehn.net.(32) (DF)
18:55:44.938363 192.168.178.39.33888 > 192.168.178.27.53: 6310+ AAAA? xxx.rebehn.net.(32) (DF)
18:55:44.938770 192.168.178.27.40701 > 185.34.136.178.53: 43827% [1au] A? xxx.rebehn.net.(43)
18:55:44.938867 192.168.178.27.63426 > 107.191.99.111.53: 63073% [1au] A? xxx.rebehn.net.(43)
18:55:44.976997 185.34.136.178.53 > 192.168.178.27.40701: 43827 NXDomain*- 0/1/0(78)
18:55:44.977188 192.168.178.27.20089 > 134.102.186.28.53: 62941% [1au] A? xxx.rebehn.net.(43)
18:55:45.017256 134.102.186.28.53 > 192.168.178.27.20089: 62941 NXDomain*- 0/1/1(89)
18:55:45.017366 192.168.178.27.53831 > 134.102.186.28.53: 5673% [1au] A? xxx.rebehn.net.(43)
18:55:45.053405 134.102.186.28.53 > 192.168.178.27.53831: 5673 NXDomain*- 0/1/1(89)
18:55:45.053507 192.168.178.27.53 > 192.168.178.39.33888: 4262 NXDomain 0/1/0(78)
18:55:45.058564 107.191.99.111.53 > 192.168.178.27.63426: 63073 NXDomain*- 0/1/0(78)
18:55:45.058694 192.168.178.27.26922 > 185.34.136.178.53: 18306% [1au] AAAA? xxx.rebehn.net.(43)
18:55:45.096816 185.34.136.178.53 > 192.168.178.27.26922: 18306 NXDomain*- 0/1/0(78)
18:55:45.096988 192.168.178.27.54414 > 134.102.186.28.53: 31033% [1au] AAAA? xxx.rebehn.net.(43)
18:55:45.134155 134.102.186.28.53 > 192.168.178.27.54414: 31033 NXDomain*- 0/1/1(89)
18:55:45.134296 192.168.178.27.64946 > 45.77.29.133.53: 27021% [1au] AAAA? xxx.rebehn.net.(43)
18:55:45.426460 45.77.29.133.53 > 192.168.178.27.64946: 27021 NXDomain*- 0/1/0(78)
18:55:45.426624 192.168.178.27.25042 > 107.191.99.111.53: 13194% [1au] AAAA? xxx.rebehn.net.(43)
18:55:45.545617 107.191.99.111.53 > 192.168.178.27.25042: 13194 NXDomain*- 0/1/0(78)
18:55:45.545764 192.168.178.27.53 > 192.168.178.39.33888: 6310 NXDomain 0/1/0(78)
18:55:45.548113 192.168.178.39.36239 > 192.168.178.27.53: 37810+ A? xxx.rebehn.net.fritz.box.(42) (DF)
18:55:45.548114 192.168.178.39.36239 > 192.168.178.27.53: 39602+ AAAA? xxx.rebehn.net.fritz.box.(42) (DF)
18:55:45.548440 192.168.178.27.21348 > 37.209.192.10.53: 50441% [1au] A? fritz.box.(38)
18:55:45.548518 192.168.178.27.63236 > 37.209.198.10.53: 8544% [1au] A? fritz.box.(38)
18:55:45.590136 37.209.192.10.53 > 192.168.178.27.21348: 50441 NXDomain*- 0/8/1(1133)
18:55:45.590278 192.168.178.27.53 > 192.168.178.39.36239: 37810 NXDomain 0/1/0(107)
18:55:45.599501 37.209.198.10.53 > 192.168.178.27.63236: 8544 NXDomain*- 0/8/1(1133)
18:55:45.599596 192.168.178.27.53 > 192.168.178.39.36239: 39602 NXDomain 0/1/0(107)

As you can see, IPv6 dns resolution is at least tried here.
Why not with Kodi under Android?
Reply
#3
It's not implemented properly. Patches welcome.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#4
(2019-12-12, 21:02)fritsch Wrote: It's not implemented properly. Patches welcome.

Oh, sorry to hear that. I am somewhat surprised because IPv6 has been around for quite some years now. Also, it does work under LibreElec. Unfortunately I am not in a position to provide patches. I am not a programmer (anymore). Last programming was some 35 years ago using Pascal, Modula2 and Ada.
I will find a workaround using a IP4 address and port redirection.
Unfortunately, the "Add network location" dialogue does not allow me to specify a port for the smb protocol. It is greyed out.
Why is that?
Reply
#5
Ok, so could someone please point me to:

a) The code that I would need to change
b) A document describing how to build for Android (preferably under MacOS, but Linux would also be ok)

TIA,
-Heinrich
Reply
#6
Yes.

See for starting: https://github.com/xbmc/xbmc/blob/master...Android.md
Subsystem: https://github.com/xbmc/xbmc/blob/master...ndroid.cpp

Thanks much.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
(2019-12-13, 19:14)fritsch Wrote: ...
Thanks much.

Well, I can not yet promise anything, but I will take a look Cool
Reply
#8
(2019-12-13, 20:21)Heinrich23 Wrote:
(2019-12-13, 19:14)fritsch Wrote: ...
Thanks much.

Well, I can not yet promise anything, but I will take a look Cool  
I had a very hard time trying to understand the structure of the software. So far I am not even able to locate the code where the media URL is retrieved from the user. Can someone please show me the location and also the code path to where the socket to the server is created and connected?

TIA,
 Heinrich
Reply

Logout Mark Read Team Forum Stats Members Help
Cannot access smb shares via IPv60