2c2
< /* $FreeBSD: head/usr.sbin/ypldap/ldapclient.c 292273 2015-12-15 15:46:14Z araujo $ */
---
> /* $FreeBSD: head/usr.sbin/ypldap/ldapclient.c 297907 2016-04-13 03:36:34Z araujo $ */
60c60
< struct aldap *client_aldap_open(struct ypldap_addr *);
---
> struct aldap *client_aldap_open(struct ypldap_addr_list *);
66c66
< client_aldap_open(struct ypldap_addr *addr)
---
> client_aldap_open(struct ypldap_addr_list *addr)
71c71
< for (p = addr; p != NULL; p = p->next) {
---
> TAILQ_FOREACH(p, addr, next) {
102c102
< for (h = idm->idm_addr; h != NULL; h = h->next) {
---
> TAILQ_FOREACH(h, &idm->idm_addr, next) {
128c128
< struct ypldap_addr *h, *p;
---
> struct ypldap_addr *h;
130,134c130,132
< if (idm->idm_addr == NULL)
< return (-1);
<
< for (h = idm->idm_addr; h != NULL; h = p) {
< p = h->next;
---
> while (!TAILQ_EMPTY(&idm->idm_addr)) {
> h = TAILQ_FIRST(&idm->idm_addr);
> TAILQ_REMOVE(&idm->idm_addr, h, next);
138,139d135
< idm->idm_addr = NULL;
<
203,204c199,200
< if (idm->idm_addr != NULL) {
< log_warnx("IMSG_HOST_DNS but addr != NULL!");
---
> if (!TAILQ_EMPTY(&idm->idm_addr)) {
> log_warnx("IMSG_HOST_DNS but addrs set!");
216,217c212
< if ((h = calloc(1, sizeof(struct ypldap_addr))) ==
< NULL)
---
> if ((h = calloc(1, sizeof(*h))) == NULL)
219a215
> TAILQ_INSERT_HEAD(&idm->idm_addr, h, next);
221,227d216
< if (idm->idm_addr == NULL)
< h->next = NULL;
< else
< h->next = idm->idm_addr;
<
< idm->idm_addr = h;
<
591c580
< if ((al = client_aldap_open(idm->idm_addr)) == NULL)
---
> if ((al = client_aldap_open(&idm->idm_addr)) == NULL)
< /* $FreeBSD: head/usr.sbin/ypldap/ldapclient.c 292273 2015-12-15 15:46:14Z araujo $ */
---
> /* $FreeBSD: head/usr.sbin/ypldap/ldapclient.c 297907 2016-04-13 03:36:34Z araujo $ */
60c60
< struct aldap *client_aldap_open(struct ypldap_addr *);
---
> struct aldap *client_aldap_open(struct ypldap_addr_list *);
66c66
< client_aldap_open(struct ypldap_addr *addr)
---
> client_aldap_open(struct ypldap_addr_list *addr)
71c71
< for (p = addr; p != NULL; p = p->next) {
---
> TAILQ_FOREACH(p, addr, next) {
102c102
< for (h = idm->idm_addr; h != NULL; h = h->next) {
---
> TAILQ_FOREACH(h, &idm->idm_addr, next) {
128c128
< struct ypldap_addr *h, *p;
---
> struct ypldap_addr *h;
130,134c130,132
< if (idm->idm_addr == NULL)
< return (-1);
<
< for (h = idm->idm_addr; h != NULL; h = p) {
< p = h->next;
---
> while (!TAILQ_EMPTY(&idm->idm_addr)) {
> h = TAILQ_FIRST(&idm->idm_addr);
> TAILQ_REMOVE(&idm->idm_addr, h, next);
138,139d135
< idm->idm_addr = NULL;
<
203,204c199,200
< if (idm->idm_addr != NULL) {
< log_warnx("IMSG_HOST_DNS but addr != NULL!");
---
> if (!TAILQ_EMPTY(&idm->idm_addr)) {
> log_warnx("IMSG_HOST_DNS but addrs set!");
216,217c212
< if ((h = calloc(1, sizeof(struct ypldap_addr))) ==
< NULL)
---
> if ((h = calloc(1, sizeof(*h))) == NULL)
219a215
> TAILQ_INSERT_HEAD(&idm->idm_addr, h, next);
221,227d216
< if (idm->idm_addr == NULL)
< h->next = NULL;
< else
< h->next = idm->idm_addr;
<
< idm->idm_addr = h;
<
591c580
< if ((al = client_aldap_open(idm->idm_addr)) == NULL)
---
> if ((al = client_aldap_open(&idm->idm_addr)) == NULL)