From c8a65d613769d75a4f9ba2cbb259efc98eada4bb Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Mon, 3 Apr 2023 12:26:22 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-12423 Signed-off-by: stephb9959 --- src/RADIUSSessionTracker.cpp | 1 + src/RADIUS_helpers.h | 5 ++++- test_scripts/curl/cli | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RADIUSSessionTracker.cpp b/src/RADIUSSessionTracker.cpp index 126a18a6..a96c80b9 100644 --- a/src/RADIUSSessionTracker.cpp +++ b/src/RADIUSSessionTracker.cpp @@ -265,6 +265,7 @@ namespace OpenWifi { P.PacketType(RADCMD_DISCON_REQ); P.Identifier(std::rand() & 0x00ff); + P.Size_=0; P.AppendAttribute(RADIUS::AUTH_USERNAME, session->userName); P.AppendAttribute(RADIUS::NAS_IP, (std::uint32_t)(0x7f000001)); P.AppendAttribute(RADIUS::CALLING_STATION_ID, session->callingStationId); diff --git a/src/RADIUS_helpers.h b/src/RADIUS_helpers.h index e53ee962..9f5ab4cb 100644 --- a/src/RADIUS_helpers.h +++ b/src/RADIUS_helpers.h @@ -487,7 +487,10 @@ namespace OpenWifi::RADIUS { return *this; } - explicit RadiusPacket() = default; + explicit RadiusPacket() { + memset(&P_,0,sizeof(P_)); + Size_ = AttributeOffset; + }; unsigned char *Buffer() { return (unsigned char *)&P_; } [[nodiscard]] uint16_t BufferLen() const { return sizeof(P_); } diff --git a/test_scripts/curl/cli b/test_scripts/curl/cli index 7c9bed70..ea473b73 100755 --- a/test_scripts/curl/cli +++ b/test_scripts/curl/cli @@ -860,7 +860,7 @@ radiusaps() { radiuscoadm() { payload="$(printf '{ "accountingSessionId": "%s", "accountingMultiSessionId": "%s" , "callingStationId": "%s" }' "$2" "$3" "$4" )" - curl ${FLAGS} -X PUT "https://${OWGW}/api/v1/radiusSessions/$1" \ + curl ${FLAGS} -X PUT "https://${OWGW}/api/v1/radiusSessions/$1?operation=coadm" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer ${token}" \