Results 1 to 6 of 6

Thread: QUrl handle ipv6 zone id wrong

  1. #1
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QUrl handle ipv6 zone id wrong

    Hi,

    I need to use an url with ipv6 zone id, which is usually written as address%zone_ID. Have a look at https://4sysops.com/archives/ipv6-tu...ast-addresses/.

    For example: fe80::bd0f:a8bc:6480:238b%11

    When passing this String to QUrl::setHost() the error is returned "Invalid IPv6 address" by QUrl::errorString() and QUrl::isValid() is false:

    baseUrl->setHost("fe80::bd0f:a8bc:6480:238b%11");

    Is this a bug in QT?

    How to assign a ipv6 zone id to a QUrl?

    regards

    spachne

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QUrl handle ipv6 zone id wrong

    I cannot see any provision for zone index in either QUrl or QHostAddress (and I see your Qt bug report 54746). Everything seems to treat an IPv6 address as 16 bytes. The syntax for the human-readable zone index is inconsistent (e.g. %1 on Windows, %eth0 on Linux) from platform to platform and would have to be treated as an opaque string, stored, and decoded when presented to a relevant part of QtNetwork. QUrl is part of QtCore and probably cannot decode or validate the network interface details without assuming there is a network.

  3. #3
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QUrl handle ipv6 zone id wrong

    Thanks for your reply.

    I would not have problems when QT could not validate the zone id and would simply pass them as opaque string. Instead any url containg a zone id is rejected.

    All I need is a HTTP post done by QT which is an equivatent to a curl call like "curl "http://fe80:0000:0000:0000:020f:8dff:fed0:0010%vctrlext:5 0000/...".

    I am using QNetworkAccessManager:ost() which takes QNetworkRequest() as argument which relies on QUrl and I am stuck.

    regards

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QUrl handle ipv6 zone id wrong

    The host doesn't have a unique local or global address?

  5. #5
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QUrl handle ipv6 zone id wrong

    No, that's why I am forced to use the zone id. Here is an article about: https://4sysops.com/archives/ipv6-tu...ast-addresses/

    spachner

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QUrl handle ipv6 zone id wrong

    I understand why a zone index might be required, but it should only essential if the client has more than one IPv6 interface and thus needs to make a choice.

    In your environment is there a way to use a name instead of the address?

    You might be interested in RFC 6874, ehich talks about the ugliness of zone indexes in URLs.
    https://tools.ietf.org/html/rfc6874

Similar Threads

  1. Increase the resize zone of QDockWidget
    By Alundra in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2016, 13:59
  2. IPv6 on Linux using QServerSocket()
    By Adelaide in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2012, 08:13
  3. Validation of IPv6 Address in QT4
    By doggrant in forum Qt Programming
    Replies: 0
    Last Post: 26th September 2011, 11:39
  4. Change time zone
    By nighil in forum Newbie
    Replies: 2
    Last Post: 3rd February 2011, 13:14
  5. Associate a minimize zone to QMainWindow
    By lixo1 in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2009, 13:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.