From 079297097e4d0a308e6ee3a6ec5053b07a786673 Mon Sep 17 00:00:00 2001 From: George Sedov <george.sedov@desy.de> Date: Fri, 21 Oct 2022 18:44:36 +0200 Subject: [PATCH] what's wrong with the ip? --- .gitlab-ci.yml | 3 +-- receiver/src/receiver_config.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82c4323f2..7273fbdd0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,11 +66,10 @@ test-services-linux-debug: tags: - kubernetes-executor rules: - - when: on_success + - when: never dependencies: - build-services-linux-debug artifacts: - when: on_success reports: junit: build/testResult.xml diff --git a/receiver/src/receiver_config.cpp b/receiver/src/receiver_config.cpp index 6f2211dac..be071fc0d 100644 --- a/receiver/src/receiver_config.cpp +++ b/receiver/src/receiver_config.cpp @@ -80,8 +80,13 @@ Error ReceiverConfigManager::ReadConfigFromFile(std::string file_name) { struct addrinfo *result; if (getaddrinfo(hostname_ib.c_str(), NULL, NULL, &result) == 0) { char addr_ib[INET_ADDRSTRLEN + 1]; - inet_ntop(AF_INET, &((struct sockaddr_in *)result->ai_addr)->sin_addr, addr_ib, INET_ADDRSTRLEN); - config.dataserver.advertise_ib_uri = std::string {addr_ib} + ":" + std::to_string(config.dataserver.listen_port); + struct addrinfo *rp; + for (rp = result; rp != NULL; rp = rp->ai_next) { + inet_ntop(AF_INET, &((struct sockaddr_in *)rp->ai_addr)->sin_addr, addr_ib, INET_ADDRSTRLEN); + config.dataserver.advertise_ib_uri += std::string {addr_ib} + " " + std::to_string(rp->ai_family) + " " + std::to_string(rp->ai_socktype) + " " + std::to_string(rp->ai_protocol) + ";"; + } + //inet_ntop(AF_INET, &((struct sockaddr_in *)result->ai_addr)->sin_addr, addr_ib, INET_ADDRSTRLEN); + //config.dataserver.advertise_ib_uri = std::string {addr_ib} + ":" + std::to_string(config.dataserver.listen_port); freeaddrinfo(result); } -- GitLab