From bb5e94123913c1f0c1ab245204bd9f41eccbb312 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 6 Apr 2023 12:37:40 +0200 Subject: [PATCH] cloud-setup/ec2: fix regression with IMDSv2 support Resolves: #2181466 Related: #2151986 --- 1001-cloud-setup-IMDSv2-rh2151987.patch | 40 +++++++++++++++++++++++++ NetworkManager.spec | 5 +++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/1001-cloud-setup-IMDSv2-rh2151987.patch b/1001-cloud-setup-IMDSv2-rh2151987.patch index 4da0012..ccbc432 100644 --- a/1001-cloud-setup-IMDSv2-rh2151987.patch +++ b/1001-cloud-setup-IMDSv2-rh2151987.patch @@ -1445,3 +1445,43 @@ index c3c527cfd4..3a27a30e68 100644 -- 2.39.2 +From 6abbdaaa64bad00acb65ba7049dcea6bb7ae1084 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 21 Mar 2023 22:47:27 +0100 +Subject: [PATCH] cloud-setup: actually pass the HTTP method in + nm_http_client_poll_req() + +https://bugzilla.redhat.com/show_bug.cgi?id=2179718 + +Fixes: 8b7e12c2d631 ('cloud-setup/ec2: start with requesting a IMDSv2 token') +Fixes: cd74d7500278 ('cloud-setup: make nm_http_client_req() accept a method argument') +(cherry picked from commit f07da04cd9f16ac9e90d3d57d970ac935ad87b4d) +(cherry picked from commit d787c0c59dce57dfacc6602a4f1d5f8d8ed3b193) +--- + src/nm-cloud-setup/nm-http-client.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/nm-cloud-setup/nm-http-client.c b/src/nm-cloud-setup/nm-http-client.c +index b3db93e058..db123f1033 100644 +--- a/src/nm-cloud-setup/nm-http-client.c ++++ b/src/nm-cloud-setup/nm-http-client.c +@@ -290,7 +290,7 @@ nm_http_client_req(NMHttpClient *self, + + nmcs_wait_for_objects_register(edata->task); + +- _LOG2D(edata, "start get ..."); ++ _LOG2D(edata, "start %s ...", http_method ?: "get"); + + edata->ehandle = curl_easy_init(); + if (!edata->ehandle) { +@@ -560,6 +560,7 @@ nm_http_client_poll_req(NMHttpClient *self, + .check_user_data = check_user_data, + .response_code = -1, + .http_headers = NULL, ++ .http_method = http_method, + }; + + if (http_headers) { +-- +2.40.0 + diff --git a/NetworkManager.spec b/NetworkManager.spec index 33797e4..8d0af46 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -6,7 +6,7 @@ %global epoch_version 1 %global real_version 1.40.16 %global rpm_version %{real_version} -%global release_version 2 +%global release_version 3 %global snapshot %{nil} %global git_sha %{nil} %global bcond_default_debug 0 @@ -1232,6 +1232,9 @@ fi %changelog +* Mon Mar 13 2023 Lubomir Rintel - 1:1.40.16-3 +- cloud-setup/ec2: fix regression with IMDSv2 support (rh #2181466) + * Mon Mar 13 2023 Lubomir Rintel - 1:1.40.16-2 - cloud-setup/ec2: add IMDSv2 support (rh #2151986)