cloud-setup/ec2: fix regression with IMDSv2 support

Resolves: #2181466
Related: #2151986
This commit is contained in:
Lubomir Rintel 2023-04-06 12:37:40 +02:00
parent 117a206a8d
commit bb5e941239
2 changed files with 44 additions and 1 deletions

View File

@ -1445,3 +1445,43 @@ index c3c527cfd4..3a27a30e68 100644
--
2.39.2
From 6abbdaaa64bad00acb65ba7049dcea6bb7ae1084 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
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

View File

@ -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 <lkundrak@v3.sk> - 1:1.40.16-3
- cloud-setup/ec2: fix regression with IMDSv2 support (rh #2181466)
* Mon Mar 13 2023 Lubomir Rintel <lkundrak@v3.sk> - 1:1.40.16-2
- cloud-setup/ec2: add IMDSv2 support (rh #2151986)