From: Konrad Rosenbaum Date: Sat, 3 Oct 2009 17:14:09 +0000 (+0000) Subject: fix a few remaining nits X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=6a0bcb4d58eca8147cb0a75386cc00865885dd45;p=web%2Fkonrad%2Ftdhcp.git fix a few remaining nits git-svn-id: https://silmor.de/svn/misc/tdhcp@131 752dcaaa-03e5-0310-b894-97e397d490cd --- diff --git a/client.c b/client.c index 02ed137..4285199 100644 --- a/client.c +++ b/client.c @@ -116,9 +116,9 @@ static void printhelp() /*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() @@ -165,21 +165,18 @@ static void adddomain(const char*itm) 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); @@ -189,7 +186,6 @@ static int handlemessage(struct dhcp_msg*rmsg,struct dhcp_msg*smsg) } 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;imsg_opt[p].opt_dns_name.num_dns;i++) adddomain(rmsg->msg_opt[p].opt_dns_name.namelist[i]); }