[mythtv-users] Mythbackend not binding IPv6 ULA

Bill Meek keemllib at gmail.com
Tue Nov 25 16:08:44 UTC 2014


On 11/25/2014 06:23 AM, Jean-Yves Avenard wrote:
> On 20 November 2014 at 01:28, Rob Jensen <bertaboy at gmail.com> wrote:
>
>> I didn't even think to explicitly define the IPv6 address in the Master
>> Backend IP address field.  Once I changed that from the hostname to the
>> specific ULA, everything began working again.  I'll submit a bug ticket,
>> hopefully the fix is relatively easy.
>
> there's no bug here.
>
> You need to define the IP address the backend is going to listen on.
> It's per design
>
> Only link-local and local addresses are listened on automatically.

I think the reason for confusion (at least mine), is that
ULAs are similar to IPv4 Private Network addresses which
are automatically listened to.

Although global, ULAs are never to be routed to the Internet.
https://tools.ietf.org/html/rfc4193 .

I'll submit a ticket if it has a chance if being accepted. Otherwise
there's no sense spending developer time reviewing and closing it.

diff --git a/mythtv/libs/libmythbase/serverpool.cpp b/mythtv/libs/libmythbase/serverpool.cpp
index da0d5fb..8a4a0ee 100644
--- a/mythtv/libs/libmythbase/serverpool.cpp
+++ b/mythtv/libs/libmythbase/serverpool.cpp
@@ -25,6 +25,8 @@ static QPair<QHostAddress, int> kLinkLocal  =
  #if !defined(QT_NO_IPV6)
  static QPair<QHostAddress, int> kLinkLocal6 =
                              QHostAddress::parseSubnet("fe80::/10");
+static QPair<QHostAddress, int> kUniqueLocalAddress =
+                            QHostAddress::parseSubnet("fd00::/8");
  #endif

  class PrivUdpSocket : public QUdpSocket
@@ -227,6 +229,15 @@ void ServerPool::SelectDefaultListen(bool force)
                          v6IsSet = true;
                  }

+                else if (ip.isInSubnet(kUniqueLocalAddress))
+                {
+                    // always listen on Unique Local Addresses
+                    LOG(VB_GENERAL, LOG_DEBUG,
+                            QString("Adding ULA '%1' to address list.")
+                                .arg(ip.toString()));
+                    naList_6.append(*qnai);
+                }
+
                  else if (ip.isInSubnet(kLinkLocal6) && allowLinkLocal)
                  {
                      // optionally listen on linklocal

-- 
Bill


More information about the mythtv-users mailing list