time.
-/* $OpenBSD: clparse.c,v 1.64 2013/12/28 21:48:04 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.65 2013/12/30 03:36:17 krw Exp $ */
/* Parser for dhclient config and lease files. */
void
parse_reject_statement(FILE *cfile)
{
- struct reject_elem *list;
+ struct reject_elem *elem;
struct in_addr addr;
int token;
return;
}
- list = malloc(sizeof(struct reject_elem));
- if (!list)
- error("no memory for reject list!");
+ elem = malloc(sizeof(struct reject_elem));
+ if (!elem)
+ error("no memory for reject address!");
- list->addr = addr;
- list->next = config->reject_list;
- config->reject_list = list;
+ elem->addr = addr;
+ TAILQ_INSERT_TAIL(&config->reject_list, elem, next);
token = next_token(NULL, cfile);
} while (token == ',');
-/* $OpenBSD: dhclient.c,v 1.280 2013/12/21 18:23:10 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.281 2013/12/30 03:36:17 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
config = calloc(1, sizeof(*config));
if (config == NULL)
error("config calloc");
+ TAILQ_INIT(&config->reject_list);
get_ifname(argv[0]);
if (path_dhclient_db == NULL && asprintf(&path_dhclient_db, "%s.%s",
-/* $OpenBSD: dhcpd.h,v 1.127 2013/12/21 18:23:10 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.128 2013/12/30 03:36:17 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
};
struct reject_elem {
- struct reject_elem *next;
+ TAILQ_ENTRY(reject_elem) next;
struct in_addr addr;
};
time_t backoff_cutoff;
enum { IGNORE, ACCEPT, PREFER }
bootp_policy;
- struct reject_elem *reject_list;
+ TAILQ_HEAD(, reject_elem) reject_list;
char *resolv_tail;
};
-/* $OpenBSD: options.c,v 1.64 2013/12/22 04:47:57 krw Exp $ */
+/* $OpenBSD: options.c,v 1.65 2013/12/30 03:36:17 krw Exp $ */
/* DHCP options parsing and reassembly. */
return;
}
- for (ap = config->reject_list; ap; ap = ap->next)
+ TAILQ_FOREACH(ap, &config->reject_list, next)
if (from.s_addr == ap->addr.s_addr) {
#ifdef DEBUG
debug("Discarding packet from address on reject list "