-/* $OpenBSD: dhcp6leased.c,v 1.8 2024/06/03 15:52:17 florian Exp $ */
+/* $OpenBSD: dhcp6leased.c,v 1.9 2024/06/03 15:53:26 deraadt Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
main(int argc, char *argv[])
{
struct event ev_sigint, ev_sigterm, ev_sighup;
- int ch;
- int debug = 0, engine_flag = 0, frontend_flag = 0;
- int verbose = 0, no_action = 0;
- char *saved_argv0;
- int pipe_main2frontend[2];
- int pipe_main2engine[2];
- int frontend_routesock, rtfilter, lockfd;
- int rtable_any = RTABLE_ANY;
- char *csock = _PATH_CTRL_SOCKET;
- int control_fd;
- uint8_t *uuid;
+ int ch;
+ int debug = 0, engine_flag = 0, frontend_flag = 0;
+ int verbose = 0, no_action = 0;
+ char *saved_argv0;
+ int pipe_main2frontend[2];
+ int pipe_main2engine[2];
+ int frontend_routesock, rtfilter, lockfd;
+ int rtable_any = RTABLE_ANY;
+ char *csock = _PATH_CTRL_SOCKET;
+ int control_fd;
+ uint8_t *uuid;
log_init(1, LOG_DAEMON); /* Log to stderr until daemonized. */
log_setverbose(1);
/* Remove & discard existing interfaces. */
while ((iface_conf = SIMPLEQ_FIRST(&conf->iface_list)) != NULL) {
SIMPLEQ_REMOVE_HEAD(&conf->iface_list, entry);
- while((ia_conf =
+ while ((ia_conf =
SIMPLEQ_FIRST(&iface_conf->iface_ia_list)) != NULL) {
SIMPLEQ_REMOVE_HEAD(&iface_conf->iface_ia_list,
entry);
- while((pd_conf =
+ while ((pd_conf =
SIMPLEQ_FIRST(&ia_conf->iface_pd_list)) != NULL) {
SIMPLEQ_REMOVE_HEAD(&ia_conf->iface_pd_list,
entry);
-/* $OpenBSD: engine.c,v 1.6 2024/06/03 15:52:17 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.7 2024/06/03 15:53:26 deraadt Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
dhcp_message_type2str(hdr.msg_type), hdr.xid[0], hdr.xid[1],
hdr.xid[2]);
- while(rem >= sizeof(struct dhcp_option_hdr)) {
+ while (rem >= sizeof(struct dhcp_option_hdr)) {
memcpy(&opt_hdr, p, sizeof(struct dhcp_option_hdr));
opt_hdr.code = ntohs(opt_hdr.code);
opt_hdr.len = ntohs(opt_hdr.len);
state_transition(iface, IF_REQUESTING);
break;
case DHCPREPLY:
- switch(iface->state) {
+ switch (iface->state) {
case IF_REQUESTING:
case IF_RENEWING:
case IF_REBINDING:
uint16_t status_code;
char ntopbuf[INET6_ADDRSTRLEN], *visbuf;
- while(len >= sizeof(struct dhcp_option_hdr)) {
+ while (len >= sizeof(struct dhcp_option_hdr)) {
memcpy(&opt_hdr, p, sizeof(struct dhcp_option_hdr));
opt_hdr.code = ntohs(opt_hdr.code);
opt_hdr.len = ntohs(opt_hdr.len);
break;
case IF_BOUND:
iface->timo.tv_sec = iface->t1;
- switch(old_state) {
+ switch (old_state) {
case IF_REQUESTING:
case IF_RENEWING:
case IF_REBINDING:
-/* $OpenBSD: frontend.c,v 1.7 2024/06/03 11:08:31 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.8 2024/06/03 15:53:26 deraadt Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
case RTM_IFANNOUNCE:
ifan = (struct if_announcemsghdr *)rtm;
if_index = ifan->ifan_index;
- if (ifan->ifan_what == IFAN_DEPARTURE) {
+ if (ifan->ifan_what == IFAN_DEPARTURE) {
frontend_imsg_compose_engine(IMSG_REMOVE_IF, 0, 0,
&if_index, sizeof(if_index));
remove_iface(if_index);
uint16_t request_option_code, elapsed_time;
uint8_t *p;
- switch(message_type) {
+ switch (message_type) {
case DHCPSOLICIT:
case DHCPREQUEST:
case DHCPRENEW:
memcpy(p, &duid, sizeof(struct dhcp_duid));
p += sizeof(struct dhcp_duid);
- switch(message_type) {
+ switch (message_type) {
case DHCPSOLICIT:
case DHCPREBIND:
break;
memset(&iaprefix, 0, sizeof(struct dhcp_iaprefix));
- switch(message_type) {
+ switch (message_type) {
case DHCPSOLICIT:
iaprefix.prefix_len = ia_conf->prefix_len;
break;
-/* $OpenBSD: parse.y,v 1.5 2024/06/03 11:08:31 florian Exp $ */
+/* $OpenBSD: parse.y,v 1.6 2024/06/03 15:53:26 deraadt Exp $ */
/*
* Copyright (c) 2018, 2024 Florian Obser <florian@openbsd.org>
TAILQ_ENTRY(file) entry;
FILE *stream;
char *name;
- size_t ungetpos;
+ size_t ungetpos;
size_t ungetsize;
u_char *ungetbuf;
int eof_reached;