Page MenuHomePhabricator

list=globalblocks misrecognizes IPv4 CIDR as IPv6 CIDR
Closed, ResolvedPublicBUG REPORT

Description

https://en.wikipedia.org/w/api.php?action=query&formatversion=2&list=globalblocks&bgip=20.95.0.0/18

This makes a query about 20.95.0.0/18 but returns the following:

{
    "error": {
        "code": "cidrtoobroad",
        "info": "IPv6 CIDR ranges broader than /19 are not accepted.",
        "docref": "See https://en.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw-api-ext.codfw.main-7c648c5d98-qtcxx"
}

That is, the API misrecognizes the IPv4 CIDR as an IPv6 CIDR and thinks that the CIDR limit is /19 rather than /16.

Event Timeline

Change #1060185 had a related patch set uploaded (by Dragoniez; author: Dragoniez):

[mediawiki/extensions/GlobalBlocking@master] Fix misrecognition of IPv4 as IPv6

https://gerrit.wikimedia.org/r/1060185

Dragoniez renamed this task from list=globalblocks misrecognizes IPv4 CIDR as IPv6CIDR to list=globalblocks misrecognizes IPv4 CIDR as IPv6 CIDR.Aug 7 2024, 8:06 AM

Change #1060185 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Fix misrecognition of IPv4 as IPv6

https://gerrit.wikimedia.org/r/1060185