From a17529d0c47202feb6800cf6ba80cd3e5c8d3e43 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 31 Aug 2023 07:49:04 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-12868 Signed-off-by: stephb9959 --- src/RADIUS_proxy_server.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/RADIUS_proxy_server.cpp b/src/RADIUS_proxy_server.cpp index 932d62c9..576c3779 100644 --- a/src/RADIUS_proxy_server.cpp +++ b/src/RADIUS_proxy_server.cpp @@ -615,7 +615,9 @@ namespace OpenWifi { const Poco::Net::SocketAddress &RequestedAddress, const RADIUS::RadiusPacket &P, bool &UseRADSEC, std::string &Secret) { + bool IsV4 = RequestedAddress.family() == Poco::Net::SocketAddress::IPv4; + std::cout << __LINE__ << std::endl; // find the realm... auto UserName = P.UserName(); @@ -639,7 +641,9 @@ namespace OpenWifi { } } + std::cout << __LINE__ << std::endl; if (DefaultIsRADSEC_) { + std::cout << __LINE__ << std::endl; UseRADSEC = true; return (IsV4 ? Pools_[DefaultPoolIndex_].AuthV4[0].Addr : Pools_[DefaultPoolIndex_].AuthV6[0].Addr); @@ -652,6 +656,7 @@ namespace OpenWifi { RequestedAddress, Secret); } case radius_type::coa: { + std::cout << __LINE__ << std::endl; return ChooseAddress(IsV4 ? Pools_[DefaultPoolIndex_].CoaV4 : Pools_[DefaultPoolIndex_].CoaV6, RequestedAddress, Secret); @@ -690,6 +695,7 @@ namespace OpenWifi { std::cout << __LINE__ << std::endl; if (useDefault) { + std::cout << __LINE__ << std::endl; return DefaultRoute(rtype, RequestedAddress, P, UseRADSEC, Secret); } @@ -737,11 +743,14 @@ namespace OpenWifi { const Poco::Net::SocketAddress &OriginalAddress, std::string &Secret) { + std::cout << __LINE__ << std::endl; if (Pool.size() == 1) { + std::cout << __LINE__ << std::endl; Secret = Pool[0].secret; return Pool[0].Addr; } + std::cout << __LINE__ << std::endl; if (Pool[0].strategy == "weighted") { bool found = false; uint64_t cur_state = std::numeric_limits::max(); @@ -792,13 +801,16 @@ namespace OpenWifi { return Pool[index].Addr; } else if (Pool[0].strategy == "random") { if (Pool.size() > 1) { + std::cout << __LINE__ << std::endl; auto index = std::rand() % Pool.size(); Secret = Pool[index].secret; return Pool[index].Addr; } else { + std::cout << __LINE__ << std::endl; return OriginalAddress; } } + std::cout << __LINE__ << std::endl; return OriginalAddress; }