summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ipcp_opt_dns.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-03-11 11:19:54 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-03-11 11:19:54 +0400
commit1e3e55bf5d13468c7272c626fd556c8f28c38d66 (patch)
tree9f9519e1d6400690b972933e14a6ea1c70529374 /accel-pppd/ppp/ipcp_opt_dns.c
parent48a75b25699a78d4425a742ac3cdb0a4ada45a3d (diff)
downloadaccel-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/ppp/ipcp_opt_dns.c')
-rw-r--r--accel-pppd/ppp/ipcp_opt_dns.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/accel-pppd/ppp/ipcp_opt_dns.c b/accel-pppd/ppp/ipcp_opt_dns.c
index 4427b0e..19183eb 100644
--- a/accel-pppd/ppp/ipcp_opt_dns.c
+++ b/accel-pppd/ppp/ipcp_opt_dns.c
@@ -37,6 +37,7 @@ static struct ipcp_option_handler_t dns1_opt_hnd=
.free=dns_free,
.print=dns1_print,
};
+
static struct ipcp_option_handler_t dns2_opt_hnd=
{
.init=dns2_init,
@@ -139,6 +140,17 @@ static void dns2_print(void (*print)(const char *fmt,...),struct ipcp_option_t *
print("<dns2 %s>",inet_ntoa(in));
}
+static void ev_dns(struct ev_dns_t *ev)
+{
+ struct dns_option_t *dns_opt;
+
+ dns_opt = container_of(ipcp_find_option(ev->ppp, &dns1_opt_hnd), typeof(*dns_opt), opt);
+ dns_opt->addr = ev->dns1;
+
+ dns_opt = container_of(ipcp_find_option(ev->ppp, &dns2_opt_hnd), typeof(*dns_opt), opt);
+ dns_opt->addr = ev->dns2;
+}
+
static void load_config(void)
{
char *opt;
@@ -159,6 +171,8 @@ static void dns_opt_init()
load_config();
triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);
+
+ triton_event_register_handler(EV_DNS, (triton_event_func)ev_dns);
}
DEFINE_INIT(4, dns_opt_init);