/*maximum amount of any item that we can handle: 16 is sensitive for addresses, prefixes and DNS settings*/
#define MAXITEMS 16
-struct in6_addr addresses[MAXITEMS], prefixes[MAXITEMS], dnsservers[MAXITEMS];
-char **dnsnames;
-unsigned char prefixlens[MAXITEMS];
+static struct in6_addr addresses[MAXITEMS], prefixes[MAXITEMS], dnsservers[MAXITEMS];
+static char **dnsnames;
+static unsigned char prefixlens[MAXITEMS];
static struct in6_addr NULLADDR;
static void inititems()
if(!dnsnames[i]){
dnsnames[i]=malloc(strlen(itm)+1);
strcpy(dnsnames[i],itm);
- td_log(LOGDEBUG,"added domain %s",itm);
return;
}
/*otherwise: check whether item is known*/
if(strcmp(dnsnames[i],itm)==0)
return;
}
- td_log(LOGDEBUG,"failed add dom");
}
/*parse the response message and manipulate the send message*/
static int handlemessage(struct dhcp_msg*rmsg,struct dhcp_msg*smsg)
{
int i,j,p;
- td_log(LOGDEBUG,"handling...");
/*find DNS info*/
if(getdns){
p=messagefindoption(rmsg,OPT_DNS_SERVER);
}
p=messagefindoption(rmsg,OPT_DNS_NAME);
if(p>=0){
- td_log(LOGDEBUG,"%i doms found",rmsg->msg_opt[p].opt_dns_name.num_dns);
for(i=0;i<rmsg->msg_opt[p].opt_dns_name.num_dns;i++)
adddomain(rmsg->msg_opt[p].opt_dns_name.namelist[i]);
}