summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ppp/ipcp_opt_dns.c12
-rw-r--r--accel-pppd/radius/radius.c3
2 files changed, 9 insertions, 6 deletions
diff --git a/accel-pppd/ppp/ipcp_opt_dns.c b/accel-pppd/ppp/ipcp_opt_dns.c
index f4028448..56160fe0 100644
--- a/accel-pppd/ppp/ipcp_opt_dns.c
+++ b/accel-pppd/ppp/ipcp_opt_dns.c
@@ -151,11 +151,15 @@ static void ev_dns(struct ev_dns_t *ev)
ppp = container_of(ev->ses, typeof(*ppp), ses);
- dns_opt = container_of(ipcp_find_option(ppp, &dns1_opt_hnd), typeof(*dns_opt), opt);
- dns_opt->addr = ev->dns1;
+ if (ev->dns1) {
+ dns_opt = container_of(ipcp_find_option(ppp, &dns1_opt_hnd), typeof(*dns_opt), opt);
+ dns_opt->addr = ev->dns1;
+ }
- dns_opt = container_of(ipcp_find_option(ppp, &dns2_opt_hnd), typeof(*dns_opt), opt);
- dns_opt->addr = ev->dns2;
+ if (ev->dns2) {
+ dns_opt = container_of(ipcp_find_option(ppp, &dns2_opt_hnd), typeof(*dns_opt), opt);
+ dns_opt->addr = ev->dns2;
+ }
}
static void load_config(void)
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index 6c3c8ee8..5e8196d5 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -148,14 +148,13 @@ out_err:
int rad_proc_attrs(struct rad_req_t *req)
{
+ struct ev_dns_t dns = {};
struct rad_attr_t *attr;
struct ipv6db_addr_t *a;
- struct ev_dns_t dns;
struct ev_wins_t wins;
int res = 0;
struct radius_pd_t *rpd = req->rpd;
- dns.ses = NULL;
wins.ses = NULL;
req->rpd->acct_interim_interval = conf_acct_interim_interval;