diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-03-11 11:19:54 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-03-11 11:19:54 +0400 |
commit | 1e3e55bf5d13468c7272c626fd556c8f28c38d66 (patch) | |
tree | 9f9519e1d6400690b972933e14a6ea1c70529374 /accel-pppd/radius/radius.c | |
parent | 48a75b25699a78d4425a742ac3cdb0a4ada45a3d (diff) | |
download | accel-ppp-1e3e55bf5d13468c7272c626fd556c8f28c38d66.tar.gz accel-ppp-1e3e55bf5d13468c7272c626fd556c8f28c38d66.zip |
radius: add support for MS-Primary-DNS-Server/MS-Secondary-DNS-Server attributes
Diffstat (limited to 'accel-pppd/radius/radius.c')
-rw-r--r-- | accel-pppd/radius/radius.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index c24522dc..57e6dbad 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -57,13 +57,28 @@ int rad_proc_attrs(struct rad_req_t *req) { struct rad_attr_t *attr; struct ipv6db_addr_t *a; + struct ev_dns_t dns; int res = 0; + dns.ppp = NULL; req->rpd->acct_interim_interval = conf_acct_interim_interval; list_for_each_entry(attr, &req->reply->attrs, entry) { - if (attr->vendor) + if (attr->vendor && attr->vendor->id == Vendor_Microsoft) { + switch (attr->attr->id) { + case MS_Primary_DNS_Server: + dns.ppp = req->rpd->ppp; + dns.dns1 = attr->val.ipaddr; + break; + case MS_Secondary_DNS_Server: + dns.ppp = req->rpd->ppp; + dns.dns2 = attr->val.ipaddr; + break; + } continue; + } else if (attr->vendor) + continue; + switch(attr->attr->id) { case Framed_IP_Address: if (!conf_gw_ip_address) @@ -123,6 +138,9 @@ int rad_proc_attrs(struct rad_req_t *req) } } + if (dns.ppp) + triton_event_fire(EV_DNS, &dns); + return res; } |