Skip to content

[CloudSigma] Report IPv6 addresses of NICs instead of a second copy of the IPv4 address - #2244

Open
aad1tyaaaaa wants to merge 2 commits into
apache:trunkfrom
aad1tyaaaaa:fix-cloudsigma-ipv6
Open

aad1tyaaaaa wants to merge 2 commits into
apache:trunkfrom
aad1tyaaaaa:fix-cloudsigma-ipv6

Conversation

@aad1tyaaaaa

Copy link
Copy Markdown

[CloudSigma] Report IPv6 addresses of NICs instead of a second copy of the IPv4 address

Description

CloudSigma_2_0_NodeDriver._parse_ips_from_nic reads the IPv6 address from the IPv4 object, in both the static configuration and the runtime block:

ipv6 = ip_v4["uuid"] if ip_v6 else None

So:

  • for a NIC with both addresses, the IPv6 address is never reported: the IPv4 address is added a second time and then deduplicated by the set();
  • for a NIC with only an IPv6 address, ip_v4 is None and list_nodes() fails with TypeError: 'NoneType' object is not subscriptable.

This change reads ip_v6["uuid"] instead. With the IPv6 address actually reaching the classification loop, is_private_subnet would then raise OSError (it uses inet_aton, so IPv4 only). Rather than changing the shared helper, which the OpenStack driver relies on raising for IPv6 so that it can fall back to its own network label / OS-EXT-IPS:type logic, the CloudSigma driver now classifies IPv6 addresses itself: unique local addresses (fc00::/7, RFC 4193, the IPv6 counterpart of the RFC 1918 ranges) are private, others are public.

Status

  • done, ready for review

Checklist

  • Code linting (black, isort)
  • Documentation (CHANGES.rst entry)
  • Tests: new test_parse_ips_from_nic_ipv6 (runs for both CloudSigma test classes) covers a dual-stack NIC and an IPv6-only NIC. It fails without this change (only ['185.12.5.10'] is returned) and passes with it. The rest of libcloud/test/compute shows no new failures.
  • ICLA not required for this small change

I used an AI assistant (Claude Code) to help find this bug and write the fix and test. I reviewed and ran everything myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant