I have an application where I need to programmatically change the realm I proxy Accounting-Request messages to if the incoming realm is some known value. I have a preacct function that looks for the particular realm in the User-Name, and if it's there, it adds a Realm attrbute to request->packet->vps and a Proxy-To-Realm attribute to request->config_items. In radiusd.conf I put this before "suffix", so rlm_realm doesnt do anything. This sets up the proxy to the new realm, but the User-Name in the proxy packet still has the original realm, and I need to switch it to the new one.
I tried writing a pre-proxy function that looks for User-Name in request->proxy->vps, deletes it, and adds a new one with the my new realm substituted for the old one. That function appears to work, but radiusd crashes in rad_send (radius.c) in the following code block, on the line "if ((VENDOR...".
for (reply = packet->vps; reply; reply = reply->next) { /* * Ignore non-wire attributes */ if ((VENDOR(reply->attribute) == 0) && ((reply->attribute & 0xFFFF) > 0xff)) { continue; } ....
I suspect I mangled the request proxy packet somehow. Is there a better way to do this?
Dave
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html