diff --git a/SOURCES/xapi-23.31.0-fix-ipv6-import.XCP-ng.patch b/SOURCES/xapi-23.31.0-fix-ipv6-import.XCP-ng.patch new file mode 100644 index 0000000..e76f0fa --- /dev/null +++ b/SOURCES/xapi-23.31.0-fix-ipv6-import.XCP-ng.patch @@ -0,0 +1,26 @@ +Add brackets in `Host` header of http request when relevant. +See: https://github.com/mirage/ocaml-cohttp/issues/997 + +diff --git i/ocaml/xapi/xapi_vm.ml w/ocaml/xapi/xapi_vm.ml +index 4db86acbd..e310f5549 100644 +--- i/ocaml/xapi/xapi_vm.ml ++++ w/ocaml/xapi/xapi_vm.ml +@@ -1518,7 +1518,17 @@ let rec import_inner n ~__context ~url ~sr ~full_restore ~force = + Cohttp.Request.Make (Cohttp_posix_io.Unbuffered_IO) in + let module Response = + Cohttp.Response.Make (Cohttp_posix_io.Unbuffered_IO) in +- let request = Cohttp.Request.make ~meth:`GET uri in ++ let headers = Cohttp.Header.init () in ++ let headers = ++ Cohttp.Header.add_unless_exists headers "host" ++ (match Uri.scheme uri with ++ | Some "httpunix" -> "" ++ | _ -> ( ++ (Http.Url.maybe_wrap_IPv6_literal (Uri.host_with_default ~default:"localhost" uri)) ++ ^ ++ match Uri.port uri with Some p -> ":" ^ string_of_int p | None -> "")) ++ in ++ let request = Cohttp.Request.make ~meth:`GET ?headers:(Some headers) uri in + let ic = + { + Cohttp_posix_io.Unbuffered_IO.header_buffer= None diff --git a/SPECS/xapi.spec b/SPECS/xapi.spec index a35e132..7fc12de 100644 --- a/SPECS/xapi.spec +++ b/SPECS/xapi.spec @@ -18,7 +18,7 @@ Summary: xapi - xen toolstack for XCP Name: xapi Version: 23.31.0 -Release: 1.1%{?xsrel}%{?dist} +Release: 1.3%{?xsrel}%{?dist} Group: System/Hypervisor License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: http://www.xen.org @@ -61,6 +61,7 @@ Patch1003: xapi-23.24.0-update-db-tunnel-protocol-from-other_config.XCP-ng.patch # Needed for IPv6 support. Upstream wants a better fix. Drop when upstream fixed it. Patch1004: xapi-23.3.0-filter-link-local-address-ipv6.XCP-ng.patch Patch1005: xapi-23.31.0-extend-uefi-cert-api.patch +Patch1006: xapi-23.31.0-fix-ipv6-import.XCP-ng.patch %{?_cov_buildrequires} BuildRequires: ocaml-ocamldoc @@ -1340,6 +1341,9 @@ Coverage files from unit tests %{?_cov_results_package} %changelog +* Thu Feb 08 2024 Benjamin Reis - 23.31.0-1.3 +- Add xapi-23.31.0-fix-ipv6-import.XCP-ng.patch + * Mon Jan 22 2024 Samuel Verschelde - 23.31.0-1.1 - Rebase on 23.31.0-1 - Rediff patches (Benjamin Reis)