Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,27 @@ private static void CopyAttributes(RadiusPacket? source, RadiusPacket? target)

private void AddProxyStateAttribute(RadiusPacket source, RadiusPacket target)
{
if (!source.Attributes.TryGetValue(ProxyStateAttribute, out var proxyStateAttribute)) return;
if (target.Attributes.ContainsKey(ProxyStateAttribute)) return;
var value = proxyStateAttribute.Values.FirstOrDefault();
if (value != null)
if (!source.Attributes.TryGetValue(ProxyStateAttribute, out var proxyStateAttribute))
{

_logger.LogDebug("Source Attribute '{attrname:l}' is empty", ProxyStateAttribute);
return;
}
if (target.Attributes.ContainsKey(ProxyStateAttribute))
{
_logger.LogDebug("Target already contains attribute '{attrname:l}'", ProxyStateAttribute);
return;
}
var value = proxyStateAttribute.Values;
if (value is { Count: > 0 })
{
_logger.LogDebug("Added/replaced attribute '{attrname:l}' to reply", ProxyStateAttribute);
target.AddAttributeValue(ProxyStateAttribute, value);
}
else
{
_logger.LogDebug("Attribute '{attrname:l}' is empty", ProxyStateAttribute);
}
}

private static void AddMessageAuthenticatorIfMissing(RadiusPacket packet)
Expand Down