Commit graph

8 commits

Author SHA1 Message Date
Thomas Haller
21321ac736
clang-format: reformat code with clang 12
The format depends on the version of the tool. Now that Fedora 34 is
released, update to clang 12 (clang-tools-extra-12.0.0-0.3.rc1.fc34.x86_64).
2021-05-04 13:56:26 +02:00
Thomas Haller
c2629f72b0
cloud-setup/azure: fix detecting the gateway address
The code never set "iface_get_config->cidr_addr", despite
setting "cidr_prefix" and "has_cidr". As a result, cloud-setup
would think that the subnet is "0.0.0.0/$PLEN", and calculate
the gateway as "0.0.0.1".

As a result it would add a default route to table 30400 via 0.0.0.1,
which is obviously wrong.

How to detect the right gateway? Let's try obtain the subnet also via
the meta data. That seems mostly correct, except that we only access
subnet at index 0. What if there are multiple ones? I don't know.

https://bugzilla.redhat.com/show_bug.cgi?id=1912236
2021-04-20 17:46:05 +02:00
Thomas Haller
889498c12c
cloud-setup/azure: refactor callback for _get_config_ips_prefix_list_cb() 2021-04-20 17:46:05 +02:00
Thomas Haller
c9fc3f5b03
cloud-setup/azure: cleanup constructing URI in _get_config_ips_prefix_list_cb() 2021-04-20 17:46:05 +02:00
Thomas Haller
89f3267859
cloud-setup/trivial: rename variables in Azure's _get_config_fetch_done_cb()
The previous name seem not very expressive/fitting. Naming is hard, but
I think these are better names.
2021-04-20 17:46:05 +02:00
Thomas Haller
a2fded3cee
cloud-setup: use _nm_utils_ascii_str_to_int64_bin() in Azure's _get_config_fetch_done_cb() 2021-04-20 17:46:04 +02:00
Thomas Haller
d3f07d5ca2
cloud-setup: remove redundant check in Azure's _get_net_ifaces_list_cb()
This condition always true, because there is a check above.
2021-04-20 17:46:04 +02:00
Thomas Haller
71f0511b1f
cloud-setup: move from "clients/cloud-setup/" to "src/nm-cloud-setup/" 2021-03-15 17:10:53 +01:00