Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Attribute 55 Event-Timestamp #172

@Delitants

Description

@Delitants

Hi, we have Mikrotik with Wi-Fi Hotspot 2.0 enabled, and it does not send "Attribute 55 Event-Timestamp" to the radius server.
Can this be added as a feature and check if attribute is present, then do nothing, and if not, supplement it?

As for now I made my own patch, but I'm not sure if it's optimal.

in int radsrv(struct request *rq) {
add after
debug(DBG_DBG, "radsrv: code %d, id %d", msg->code, msg->id);
code
if (rq && rq->msg && rq->msg->code == RAD_Accounting_Request) { uint32_t ts = htonl(time(NULL)); struct tlv *evt = maketlv(55, sizeof(ts), &ts); if (evt) { if (radmsg_add(rq->msg, evt, 0)) { debug(DBG_DBG, "radsrv: added Event-Timestamp to Accounting-Request"); } else { freetlv(evt); debug(DBG_ERR, "radsrv: radmsg_add failed"); } } else { debug(DBG_ERR, "radsrv: maketlv failed"); } }

in int replyh(struct server *server, uint8_t *buf, int len) {
add after
debug(DBG_DBG, "got %s message with id %d", radmsgtype2string(msg->code), msg->id);
code
if (msg && msg->code == RAD_Accounting_Response) { uint32_t ts = htonl(time(NULL)); struct tlv *evt = maketlv(55, sizeof(ts), &ts); if (evt) { if (radmsg_add(msg, evt, 0)) { debug(DBG_DBG, "replyh: added Event-Timestamp to Accounting-Response"); } else { freetlv(evt); debug(DBG_ERR, "replyh: radmsg_add failed"); } } else { debug(DBG_ERR, "replyh: maketlv failed"); } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions