提交 37c752f4 编写于 作者: D Dmitry Kozlov

ipoe: use interface's ifindex as Nas-Port

上级 7941c081
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册