summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/req.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-04-22 23:17:53 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-04-22 23:17:53 +0400
commit37c752f496b8db30bb56d39b4b5525487790088e (patch)
tree98c3e8864718c8597ea1ba37d353a5fa1d6342b5 /accel-pppd/radius/req.c
parent7941c08174dd5acbaf6cf5316d4fc3ad31a2327d (diff)
downloadaccel-ppp-37c752f496b8db30bb56d39b4b5525487790088e.tar.gz
accel-ppp-37c752f496b8db30bb56d39b4b5525487790088e.zip
ipoe: use interface's ifindex as Nas-Port
Diffstat (limited to 'accel-pppd/radius/req.c')
-rw-r--r--accel-pppd/radius/req.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index a93c12e1..8fc65dba 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -66,16 +66,17 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons
if (rad_packet_add_str(req->pack, NULL, "User-Name", username))
goto out_err;
+
if (conf_nas_identifier)
if (rad_packet_add_str(req->pack, NULL, "NAS-Identifier", conf_nas_identifier))
goto out_err;
+
if (conf_nas_ip_address)
if (rad_packet_add_ipaddr(req->pack, NULL, "NAS-IP-Address", conf_nas_ip_address))
goto out_err;
- if (ppp) {
- if (rad_packet_add_int(req->pack, NULL, "NAS-Port", ppp->ses.unit_idx))
- goto out_err;
- }
+
+ if (rad_packet_add_int(req->pack, NULL, "NAS-Port", rpd->ses->unit_idx))
+ goto out_err;
if (req->rpd->ses->ctrl->type == CTRL_TYPE_IPOE) {
if (rad_packet_add_val(req->pack, NULL, "NAS-Port-Type", "Ethernet"))
@@ -94,9 +95,11 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons
if (rpd->ses->ctrl->calling_station_id)
if (rad_packet_add_str(req->pack, NULL, "Calling-Station-Id", rpd->ses->ctrl->calling_station_id))
goto out_err;
+
if (rpd->ses->ctrl->called_station_id)
if (rad_packet_add_str(req->pack, NULL, "Called-Station-Id", rpd->ses->ctrl->called_station_id))
goto out_err;
+
if (rpd->attr_class)
if (rad_packet_add_octets(req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len))
goto out_err;