Skip to content

fix: networkipavailabilities: handle scientific notation in IP counts#3639

Merged
mandre merged 1 commit intogophercloud:mainfrom
ednxzu:fix/unmarshal-error-on-ip-availability
Mar 4, 2026
Merged

fix: networkipavailabilities: handle scientific notation in IP counts#3639
mandre merged 1 commit intogophercloud:mainfrom
ednxzu:fix/unmarshal-error-on-ip-availability

Conversation

@ednxzu
Copy link
Copy Markdown
Contributor

@ednxzu ednxzu commented Mar 3, 2026

Go's JSON decoder converts large integers to float64 when decoding into
interface{}, which causes values ≥ 1e21 to be re-encoded in scientific notation.
big.Int cannot parse that notation, crashing
any List() call that includes a network with a large IPv6 prefix such as /56 or shorter.

Fixes #2233

@github-actions github-actions bot added edit:networking This PR updates networking code semver:patch No API change backport-v2 This PR will be backported to v2 labels Mar 3, 2026
Go's JSON decoder converts large integers to float64 when decoding into
interface{}, which causes values ≥ 1e21 to be re-encoded in scientific notation.
big.Int cannot parse that notation, crashing
any List() call that includes a network with a large IPv6 prefix such as /56 or shorter.

Signed-off-by: Bertrand Lanson <bertrand.lanson@protonmail.com>
@ednxzu ednxzu force-pushed the fix/unmarshal-error-on-ip-availability branch from 3f93d4e to 7f478e1 Compare March 3, 2026 20:32
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 63.856% (+0.004%) from 63.852%
when pulling 7f478e1 on ednxzu:fix/unmarshal-error-on-ip-availability
into 165a4ed on gophercloud:main.

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 👍

@mandre mandre enabled auto-merge March 4, 2026 08:32
@mandre mandre added this pull request to the merge queue Mar 4, 2026
Merged via the queue into gophercloud:main with commit e40cd93 Mar 4, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:networking This PR updates networking code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Networking v2 Extensions Networkipavailabilities cannot unmarshal into a *big.Int

3 participants