From 4080b4e1ffdb1482ab26557eb46a8121d93ac584 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Fri, 22 Jun 2012 18:11:19 +0400 Subject: initial ipoe implementation --- accel-pppd/radius/req.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'accel-pppd/radius/req.c') diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c index 33273b43..f452c425 100644 --- a/accel-pppd/radius/req.c +++ b/accel-pppd/radius/req.c @@ -71,12 +71,21 @@ struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *u if (rad_packet_add_int(req->pack, NULL, "NAS-Port", ppp->ses.unit_idx)) goto out_err; } - if (rad_packet_add_val(req->pack, NULL, "NAS-Port-Type", "Virtual")) - goto out_err; - if (rad_packet_add_val(req->pack, NULL, "Service-Type", "Framed-User")) - goto out_err; - if (rad_packet_add_val(req->pack, NULL, "Framed-Protocol", "PPP")) - goto out_err; + + if (req->rpd->ses->ctrl->type == CTRL_TYPE_IPOE) { + if (rad_packet_add_val(req->pack, NULL, "NAS-Port-Type", "Ethernet")) + goto out_err; + } else { + if (rad_packet_add_val(req->pack, NULL, "NAS-Port-Type", "Virtual")) + goto out_err; + + if (rad_packet_add_val(req->pack, NULL, "Service-Type", "Framed-User")) + goto out_err; + + if (rad_packet_add_val(req->pack, NULL, "Framed-Protocol", "PPP")) + goto out_err; + } + 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; -- cgit v1.2.3