diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2013-04-22 23:17:53 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-04-22 23:17:53 +0400 |
commit | 37c752f496b8db30bb56d39b4b5525487790088e (patch) | |
tree | 98c3e8864718c8597ea1ba37d353a5fa1d6342b5 /accel-pppd | |
parent | 7941c08174dd5acbaf6cf5316d4fc3ad31a2327d (diff) | |
download | accel-ppp-37c752f496b8db30bb56d39b4b5525487790088e.tar.gz accel-ppp-37c752f496b8db30bb56d39b4b5525487790088e.zip |
ipoe: use interface's ifindex as Nas-Port
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 3 | ||||
-rw-r--r-- | accel-pppd/radius/req.c | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 8044ad0f..f0e61c95 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -341,6 +341,8 @@ static void ipoe_session_start(struct ipoe_session *ses) return; } } + + ses->ses.unit_idx = ses->serv->ifindex; triton_event_fire(EV_CTRL_STARTING, &ses->ses); triton_event_fire(EV_CTRL_STARTED, &ses->ses); @@ -407,6 +409,7 @@ static void ipoe_session_start(struct ipoe_session *ses) strncpy(ses->ses.ifname, ifr.ifr_name, AP_IFNAME_LEN); ses->ses.ifindex = ses->ifindex; + ses->ses.unit_idx = ses->ifindex; } ap_session_set_ifindex(&ses->ses); 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; |