Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7920

Make it easier to create ip prefix queries

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None
    • New

    Description

      InetAddress.getByAddress automatically transforms ipv6-mapped ipv4 addresses to ipv4 addresses. While this is usually desirable, it can make ip prefix query a bit trappy. For instance the following code:

      InetAddressPoint.newPrefixQuery("a", InetAddress.getByName("::ffff:0:0"), 96);
      

      throws an IAE complaining that the prefix length is invalid: illegal prefixLength '96'. Must be 0-32 for IPv4 ranges, 0-128 for IPv6 ranges.

      Attachments

        1. LUCENE-7920.patch
          3 kB
          Adrien Grand

        Activity

          People

            Unassigned Unassigned
            jpountz Adrien Grand
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: