From 15458966a342caa0912b7806a755d0d8277ca00f Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 2 Jun 2020 10:46:21 +0200 Subject: [HICN-610] Override hicn prefix used by http-proxy with one received from configuration. Signed-off-by: Mauro Sardara Change-Id: Ib7ec9032cf58ee1aff120ae676ce597b9428bbea Signed-off-by: Mauro Sardara --- apps/http-proxy/src/forwarder_config.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'apps/http-proxy/src/forwarder_config.h') diff --git a/apps/http-proxy/src/forwarder_config.h b/apps/http-proxy/src/forwarder_config.h index 96f275c9f..3d69c998e 100644 --- a/apps/http-proxy/src/forwarder_config.h +++ b/apps/http-proxy/src/forwarder_config.h @@ -157,17 +157,19 @@ class ForwarderConfig { auto& it = results; while (it != end) { #else - for (auto it = results.begin(); it != results.end(); - it++) { + for (auto it = results.begin(); it != results.end(); it++) { #endif if (it->endpoint().address().is_v4()) { // Use this v4 address to configure the forwarder. ret->remote_addr = it->endpoint().address().to_string(); ret->family = AF_INET; + std::string _prefix = ret->route_addr; forwarder_interface_.createFaceAndRoute( - RouteInfoPtr(ret), - [callback = std::forward(callback)]( - uint32_t route_id, bool result) { callback(result); }); + RouteInfoPtr(ret), [callback = std::forward(callback), + configured_prefix = std::move(_prefix)]( + uint32_t route_id, bool result) { + callback(result, configured_prefix); + }); return true; } -- cgit 1.2.3-korg