+ int i;
+ unsigned n = lls_opt_given(listen_address_opt_result);
+
+ if (n == 0) {
+ ss->num_listen_fds = 1;
+ ss->listen_addresses = para_malloc(sizeof(char *));
+ ss->listen_addresses[0] = NULL;
+ ss->listen_fds = para_malloc(sizeof(int));
+ ss->listen_fds[0] = -1;
+ } else {
+ ss->num_listen_fds = n;
+ ss->listen_addresses = para_malloc(n * sizeof(char *));
+ ss->listen_fds = para_malloc(n * sizeof(int));
+ FOR_EACH_LISTEN_FD(i, ss) {
+ ss->listen_addresses[i] = para_strdup(lls_string_val(i,
+ listen_address_opt_result));
+ ss->listen_fds[i] = -1;
+ }
+ }
+ ss->default_port = default_port;
+
+ init_list_head(&ss->client_list);
+ /* Initialize an access control list */
+ init_list_head(&ss->acl);
+ for (i = 0; i < lls_opt_given(acl_opt_result); i++) {
+ const char *arg = lls_string_val(i, acl_opt_result);
+ char addr[16];
+ int mask;
+ if (!parse_cidr(arg, addr, sizeof(addr), &mask))
+ PARA_WARNING_LOG("ACL syntax error: %s, ignoring\n",
+ arg);
+ else
+ acl_add_entry(&ss->acl, addr, mask);
+ }