From 6f5f75e70ce10dd41c47af8a3b4b179813020d4c Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Wed, 20 Apr 2022 13:36:08 +0300 Subject: add switch to disable sending NAS-Port-Id This patch introduces nas-port-id-in-req switch to disable sending NAS-Port-Id attribute in radauth and radacct messages. New switch might be useful if radius server cannot properly handle this attrubite. Signed-off-by: Sergey V. Lobanov --- accel-pppd/radius/req.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'accel-pppd/radius/req.c') diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c index 688a6b2a..11abf8cb 100644 --- a/accel-pppd/radius/req.c +++ b/accel-pppd/radius/req.c @@ -89,8 +89,10 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons if (rpd->ses->unit_idx != -1 && rad_packet_add_int(req->pack, NULL, "NAS-Port", rpd->ses->unit_idx)) goto out_err; - if (*rpd->ses->ifname && rad_packet_add_str(req->pack, NULL, "NAS-Port-Id", rpd->ses->ifname)) - goto out_err; + if (conf_nas_port_id_in_req) { + if (*rpd->ses->ifname && rad_packet_add_str(req->pack, NULL, "NAS-Port-Id", rpd->ses->ifname)) + goto out_err; + } if (req->rpd->ses->ctrl->type == CTRL_TYPE_IPOE) { if (rad_packet_add_val(req->pack, NULL, "NAS-Port-Type", "Ethernet")) -- cgit v1.2.3