[mythtv] Link-local IPV6 addresses

Bill Meek keemllib at gmail.com
Fri Feb 24 21:32:46 UTC 2017


On 02/24/2017 02:41 PM, Peter Bennett wrote:
> I have been trying to add link-local abilities to some parts of MythTV. Currently frontend-backend works with link-local IP addresses via some
> code that finds the scope by trying all interfaces until one works. (Currently broken in master but I have a fix ready).
>
> I am trying to add link-local support to the upnp backend detection code. However it seems that link-local addresses of the format
> [fe80::1c98:f936:7f9e:3afb%eth0] are not accepted.
>
> The QHostAddress class fully supports link-local and has methods for getting and setting the scope and for adding it to the ip address with a %
> sign. Sockets support addresses in this form.
>
> The QUrl class is silent on link-local but does say that % signs are invalid in a host name. If I use the setHost method to set such an IP
> address it fails and the IP address is set to an empty string.
>
> In MythTV, UPNP requests are sent via the QNetworkAccessManager::post method. QNetworkAccessManager is also silent on link-local addresses, but
> if you pass in a URL that has the IPV6 address with the % and scope, the request fails.
>
> We probably don't want to start reimplementing stuff that QT already does in order to support link-local.
>
> Any suggestions? I am new to IPV6 so I may have missed something.

FWIW and not sure it will help, but:

Nit: it's not scope rather Zone Index. https://tools.ietf.org/html/rfc4007#section-6
http://stackoverflow.com/questions/3131532/ipv6-zone-index-and-scope-id#3185312 . Scope=
Global/ULA/LL... Zone Index = eth0/enp0s1 etc. for Linux or just a digit for Windows.
    "Zone is to specify a particular effective interface within the local scope."

Another site (can't find it now that I want to) pointed out that the Zone Index isn't
included in the protocol, e.g. it's not passed in any IPv6 headers (Wireshark will never
see it, I've looked and it isn't there.)

I recall looking at some Qt pages when writing the Enable IPv6 Wiki and they referred to
scope rather than zone. That was back in 0.25 time.

Wondering if you can set the Zone Index (Qt scope?) and then use the "un-percented" address.

-- 
Bill


More information about the mythtv-dev mailing list