Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[defect]: No statistic per home servers which have src_ipaddr #5483

Open
d1sl1ke opened this issue Dec 20, 2024 · 2 comments
Open

[defect]: No statistic per home servers which have src_ipaddr #5483

d1sl1ke opened this issue Dec 20, 2024 · 2 comments
Labels
defect category: a defect or misbehaviour

Comments

@d1sl1ke
Copy link

d1sl1ke commented Dec 20, 2024

What type of defect/bug is this?

Unexpected behaviour (obvious or verified by project member)

How can the issue be reproduced?

  1. Add src_ipaddr into any home_server instance in the proxy.conf file. For exmple:
home_server dalo1 {
        type = auth+acct
        ipaddr = 10.16.20.230
        port = 1812
        secret = testDEMO100
        src_ipaddr = 10.0.0.5
        response_window = 6
        zombie_period = 40
        revive_interval = 120
        status_check = status-server
        check_interval = 6
        check_timeout = 4
        num_answers_to_alive = 2
        max_outstanding = 65536
        coa {
                irt = 2
                mrt = 16
                mrc = 5
                mrd = 30
        }
        limit {
              max_connections = 16
              max_requests = 0
              lifetime = 0
              idle_timeout = 0
        }
}
  1. Try to get 131 statistic for this home_server.

How to fix:
Comment or remove this parameter and enjoy correct statistic.

Log output from the FreeRADIUS daemon

Ready to process requests
(2) Received Status-Server Id 234 from 127.0.0.1:56590 to 127.0.0.1:18121 length 74
(2)   Message-Authenticator = 0xa5c4b7c1ab2d8624705f6b033e431cd0
(2)   FreeRADIUS-Stats-Server-IP-Address = 10.16.20.230
(2)   FreeRADIUS-Stats-Server-Port = 1812
(2)   FreeRADIUS-Statistics-Type = 131
(2) # Executing group from file /etc/raddb/sites-enabled/status
(2)   Autz-Type Status-Server {
(2)     [ok] = ok
(2)   } # Autz-Type Status-Server = ok
(2) Sent Access-Accept Id 234 from 127.0.0.1:18121 to 127.0.0.1:56590 length 0
(2)   FreeRADIUS-Stats-Error = "Failed to find home server IP"
(2) Finished request

Relevant log output from client utilities

cat <<EOF | radclient -x localhost:18121 status adminsecret
Message-Authenticator=0x00
FreeRADIUS-Stats-Server-IP-Address = 10.16.20.230
FreeRADIUS-Stats-Server-Port = 1812
FreeRADIUS-Statistics-Type = 0x83
EOF
Sent Status-Server Id 234 from 0.0.0.0:56590 to 127.0.0.1:18121 length 74
        Message-Authenticator = 0x00
        FreeRADIUS-Stats-Server-IP-Address = 10.16.20.230
        FreeRADIUS-Stats-Server-Port = 1812
        FreeRADIUS-Statistics-Type = 131
Received Access-Accept Id 234 from 127.0.0.1:18121 to 127.0.0.1:56590 length 57
        FreeRADIUS-Stats-Error = "Failed to find home server IP"

Backtrace from LLDB or GDB

No response

@d1sl1ke d1sl1ke added the defect category: a defect or misbehaviour label Dec 20, 2024
@alandekok
Copy link
Member

Please try the following patch. You will have to add a new attribute FreeRADIUS-Stats-Server-Src-IP-Address to the request.

If the attribute is missing, it defaults to the old behavior.

Please also check that this change doesn't break existing behavior.

patch.gz

@d1sl1ke
Copy link
Author

d1sl1ke commented Dec 23, 2024

Thank you so much! Works correctly now:

  1. correct IP + correct srcIP = get statistic
  2. incorrect IP + correct srcIP = failed to find
  3. correct IP + incorrect srcIP = failed to find
  4. incorrect IP + incorrect srcIP = failed to find

This patch doesn't break existing behavior (with single dest IP).

In wich version this patch will be able to isntall?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect category: a defect or misbehaviour
Projects
None yet
Development

No branches or pull requests

2 participants