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/ppp | |
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/ppp')
-rw-r--r-- | accel-pppd/ppp/ipcp_opt_dns.c | 14 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_ipcp.c | 6 |
2 files changed, 17 insertions, 3 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); diff --git a/accel-pppd/ppp/ppp_ipcp.c b/accel-pppd/ppp/ppp_ipcp.c index 8af84ca..625358a 100644 --- a/accel-pppd/ppp/ppp_ipcp.c +++ b/accel-pppd/ppp/ppp_ipcp.c @@ -91,6 +91,9 @@ static struct ppp_layer_data_t *ipcp_layer_init(struct ppp_t *ppp) ppp_register_unit_handler(ppp, &ipcp->hnd); + INIT_LIST_HEAD(&ipcp->options); + ipcp_options_init(ipcp); + ipcp->fsm.proto = PPP_IPCP; ppp_fsm_init(&ipcp->fsm); @@ -104,7 +107,6 @@ static struct ppp_layer_data_t *ipcp_layer_init(struct ppp_t *ppp) ipcp->fsm.send_term_req = send_term_req; ipcp->fsm.send_term_ack = send_term_ack; - INIT_LIST_HEAD(&ipcp->options); INIT_LIST_HEAD(&ipcp->ropt_list); ipcp->ld.passive = conf_ipv4 == IPV4_ALLOW || conf_ipv4 == IPV4_DENY; @@ -128,8 +130,6 @@ int ipcp_layer_start(struct ppp_layer_data_t *ld) log_ppp_debug("ipcp_layer_start\n"); - ipcp_options_init(ipcp); - ipcp->starting = 1; if (conf_ipv4 != IPV4_DENY) { |