summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-06-25 11:00:03 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-06-25 11:00:03 +0300
commit9bd003f95f8609b0330dca028e5a6b6e78bcabb8 (patch)
tree9fa0dafee93d724bcdc1684b3b5ada70ca2be6f5 /accel-pppd/radius
parent1833d760f0b797844758f41bf3a238d57b2b0aa4 (diff)
downloadaccel-ppp-9bd003f95f8609b0330dca028e5a6b6e78bcabb8.tar.gz
accel-ppp-9bd003f95f8609b0330dca028e5a6b6e78bcabb8.zip
radius: do not send NAS-Port and NAS-Port-Id if they are undefined
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/req.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index a2cf6a7..cc91679 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -82,10 +82,10 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons
if (rad_packet_add_ipaddr(req->pack, NULL, "NAS-IP-Address", conf_nas_ip_address))
goto out_err;
- if (rad_packet_add_int(req->pack, NULL, "NAS-Port", rpd->ses->unit_idx))
+ if (rpd->ses->unit_idx != -1 && rad_packet_add_int(req->pack, NULL, "NAS-Port", rpd->ses->unit_idx))
goto out_err;
- if (rad_packet_add_str(req->pack, NULL, "NAS-Port-Id", rpd->ses->ifname))
+ 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) {