[mythtv] Link-local IPV6 addresses

Peter Bennett pgbennett at comcast.net
Fri Feb 24 20:41:54 UTC 2017


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.

Peter



More information about the mythtv-dev mailing list