• Home
  • Raw
  • Download

Lines Matching refs:new

409   struct listener *new = safe_malloc(sizeof(struct listener));  in create_bound_listener()  local
410 new->family = iface->addr.sa.sa_family; in create_bound_listener()
411 new->iface = iface; in create_bound_listener()
412 new->next = *listeners; in create_bound_listener()
413 new->tftpfd = -1; in create_bound_listener()
414 new->tcpfd = -1; in create_bound_listener()
415 new->fd = -1; in create_bound_listener()
416 *listeners = new; in create_bound_listener()
420 if ((new->tcpfd = socket(iface->addr.sa.sa_family, SOCK_STREAM, 0)) == -1 || in create_bound_listener()
421 (new->fd = socket(iface->addr.sa.sa_family, SOCK_DGRAM, 0)) == -1 || in create_bound_listener()
422 setsockopt(new->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listener()
423 setsockopt(new->tcpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listener()
424 !fix_fd(new->tcpfd) || in create_bound_listener()
425 !fix_fd(new->fd)) in create_bound_listener()
431 if (setsockopt(new->fd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1 || in create_bound_listener()
432 setsockopt(new->tcpfd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1) in create_bound_listener()
439 if ((rc = bind(new->fd, &iface->addr.sa, sa_len(&iface->addr))) != -1) in create_bound_listener()
456 if (rc == -1 || bind(new->tcpfd, &iface->addr.sa, sa_len(&iface->addr)) == -1) in create_bound_listener()
462 if (listen(new->tcpfd, 5) == -1) in create_bound_listener()
471 if ((new->tftpfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 || in create_bound_listener()
472 setsockopt(new->tftpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listener()
473 !fix_fd(new->tftpfd) || in create_bound_listener()
474 bind(new->tftpfd, &iface->addr.sa, sa_len(&iface->addr)) == -1) in create_bound_listener()
547 struct listener *new = safe_malloc(sizeof(struct listener)); in create_bound_listeners()
548 new->family = iface->addr.sa.sa_family; in create_bound_listeners()
549 new->iface = iface; in create_bound_listeners()
550 new->next = listeners; in create_bound_listeners()
551 new->tftpfd = -1; in create_bound_listeners()
552 new->tcpfd = -1; in create_bound_listeners()
553 new->fd = -1; in create_bound_listeners()
554 listeners = new; in create_bound_listeners()
558 if ((new->tcpfd = socket(iface->addr.sa.sa_family, SOCK_STREAM, 0)) == -1 || in create_bound_listeners()
559 (new->fd = socket(iface->addr.sa.sa_family, SOCK_DGRAM, 0)) == -1 || in create_bound_listeners()
560 setsockopt(new->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listeners()
561 setsockopt(new->tcpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listeners()
562 !fix_fd(new->tcpfd) || in create_bound_listeners()
563 !fix_fd(new->fd)) in create_bound_listeners()
569 if (setsockopt(new->fd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1 || in create_bound_listeners()
570 setsockopt(new->tcpfd, IPV6_LEVEL, IPV6_V6ONLY, &opt, sizeof(opt)) == -1) in create_bound_listeners()
577 if ((rc = bind(new->fd, &iface->addr.sa, sa_len(&iface->addr))) != -1) in create_bound_listeners()
594 if (rc == -1 || bind(new->tcpfd, &iface->addr.sa, sa_len(&iface->addr)) == -1) in create_bound_listeners()
601 if (listen(new->tcpfd, 5) == -1) in create_bound_listeners()
610 if ((new->tftpfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 || in create_bound_listeners()
611 setsockopt(new->tftpfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1 || in create_bound_listeners()
612 !fix_fd(new->tftpfd) || in create_bound_listeners()
613 bind(new->tftpfd, &iface->addr.sa, sa_len(&iface->addr)) == -1) in create_bound_listeners()
817 struct server *new, *tmp, *ret = NULL; in check_servers() local
820 for (new = daemon->servers; new; new = tmp) in check_servers()
822 tmp = new->next; in check_servers()
824 if (!(new->flags & (SERV_LITERAL_ADDRESS | SERV_NO_ADDR))) in check_servers()
826 port = prettyprint_addr(&new->addr, daemon->namebuff); in check_servers()
829 if (new->addr.sa.sa_family == AF_INET && in check_servers()
830 new->addr.in.sin_addr.s_addr == 0) in check_servers()
832 free(new); in check_servers()
837 if (sockaddr_isequal(&new->addr, &iface->addr)) in check_servers()
842 free(new); in check_servers()
847 if (!new->sfd && in check_servers()
848 !(new->sfd = allocate_sfd(&new->source_addr, new->interface)) && in check_servers()
854 free(new); in check_servers()
860 new->next = ret; in check_servers()
861 ret = new; in check_servers()
863 if (new->flags & (SERV_HAS_DOMAIN | SERV_FOR_NODOTS)) in check_servers()
866 if (!(new->flags & SERV_HAS_DOMAIN)) in check_servers()
868 else if (strlen(new->domain) == 0) in check_servers()
871 s1 = _("domain"), s2 = new->domain; in check_servers()
873 if (new->flags & SERV_NO_ADDR) in check_servers()
875 else if (!(new->flags & SERV_LITERAL_ADDRESS)) in check_servers()
878 else if (new->interface[0] != 0) in check_servers()
879 my_syslog(LOG_INFO, _("using nameserver %s#%d(via %s)"), daemon->namebuff, port, new->interface); in check_servers()