Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-22246

QHostAddress doesn't realise that anything in 127.0.0.0/24 is localhost

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.8.x, 5.0.0
    • Network
    • None
    • Certainly linux, probably others
    • 3736dcb65e92ea3d6f1af827a52b09ebd1250f7e, cea8e41dc838bcdc2ec63eefac6441ddc608e390

    Description

      Any address in the 127.0.0.0/24 is localhost, but QHostAddress doesn't realise this. That means that code like this:

      https://qt.gitorious.org/qt/qtbase/blobs/master/src/network/access/qnetworkaccessbackend.cpp#line374

      will incorrectly think the address is remote. This matters because linux distros often set the machines name to 127.0.0.2, for example, my hosts file has:

      127.0.0.2 marge.westpoint.ltd.uk marge

      as well as the localhost line pointing at 127.0.0.1.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shkearns Shane Kearns
            richmoore Richard Moore (qtnetwork)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes