+ if(!config->bind_portremotelns)
+ config->bind_portremotelns = L2TPLACPORT;
+ if(!config->bind_address_remotelns)
+ config->bind_address_remotelns = INADDR_ANY;
+
+ if (*config->bind_multi_address)
+ {
+ char *sip = config->bind_multi_address;
+ char *n = sip;
+ char *e = config->bind_multi_address + strlen(config->bind_multi_address);
+ config->nbmultiaddress = 0;
+
+ while (*sip && (sip < e))
+ {
+ in_addr_t ip = 0;
+ uint8_t u = 0;
+
+ while (n < e && (*n == ',' || *n == ' ')) n++;
+
+ while (n < e && (isdigit(*n) || *n == '.'))
+ {
+ if (*n == '.')
+ {
+ ip = (ip << 8) + u;
+ u = 0;
+ }
+ else
+ u = u * 10 + *n - '0';
+ n++;
+ }
+ ip = (ip << 8) + u;
+ n++;
+
+ if (ip)
+ {
+ config->bind_n_address[config->nbmultiaddress] = htonl(ip);
+ config->iftun_n_address[config->nbmultiaddress] = htonl(ip);
+ config->nbmultiaddress++;
+ LOG(1, 0, 0, "Bind address %s\n", fmtaddr(htonl(ip), 0));
+
+ if (config->nbmultiaddress >= MAX_BINDADDR) break;
+ }
+
+ sip = n;
+ }
+
+ if (config->nbmultiaddress >= 1)
+ {
+ config->bind_address = config->bind_n_address[0];
+ config->iftun_address = config->bind_address;
+ }
+ }
+
+ if(!config->iftun_address)
+ {
+ config->iftun_address = config->bind_address;
+ config->iftun_n_address[0] = config->iftun_address;
+ }
+
+ if (*config->multi_hostname)
+ {
+ char *shost = config->multi_hostname;
+ char *n = shost;
+ char *e = config->multi_hostname + strlen(config->multi_hostname);
+ config->nbmultihostname = 0;
+
+ while (*shost && (shost < e))
+ {
+ while ((n < e) && (*n == ' ' || *n == ',' || *n == '\t')) n++;
+
+ i = 0;
+ while (n < e && (*n != ',') && (*n != '\t'))
+ {
+ config->multi_n_hostname[config->nbmultihostname][i] = *n;
+ n++;i++;
+ }
+
+ if (i > 0)
+ {
+ config->multi_n_hostname[config->nbmultihostname][i] = 0;
+ LOG(1, 0, 0, "Bind Hostname %s\n", config->multi_n_hostname[config->nbmultihostname]);
+ config->nbmultihostname++;
+ if (config->nbmultihostname >= MAX_NBHOSTNAME) break;
+ }
+
+ shost = n;
+ }
+
+ if (config->nbmultihostname >= 1)
+ {
+ strcpy(hostname, config->multi_n_hostname[0]);
+ strcpy(config->hostname, hostname);
+ }
+ }
+
+ if (!*config->pppoe_ac_name)
+ strncpy(config->pppoe_ac_name, DEFAULT_PPPOE_AC_NAME, sizeof(config->pppoe_ac_name) - 1);
+