diff options
author | 2017-05-27 16:16:49 +0000 | |
---|---|---|
committer | 2017-05-27 16:16:49 +0000 | |
commit | 7b22caf1a4fc042155e07280b2f76ae01348e409 (patch) | |
tree | d9282ec18fc578218d9e5f2e311a7e14e3bf040e | |
parent | Make ddb print again filename and linenumber if a bsd.gdb was loaded. (diff) | |
download | wireguard-openbsd-7b22caf1a4fc042155e07280b2f76ae01348e409.tar.xz wireguard-openbsd-7b22caf1a4fc042155e07280b2f76ae01348e409.zip |
Generate a fake ack (or is it an alternative ack?) internally.
This allows slaacd to configure addresses in the absence of
netcfgd and might be a less scary step forward to move
stateless address autoconfiguration out of the kernel.
This intentionally a compile time option and will go away
once we figure out how to do proposals.
-rw-r--r-- | usr.sbin/slaacd/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/slaacd/engine.c | 10 | ||||
-rw-r--r-- | usr.sbin/slaacd/frontend.c | 6 | ||||
-rw-r--r-- | usr.sbin/slaacd/slaacd.c | 3 | ||||
-rw-r--r-- | usr.sbin/slaacd/slaacd.h | 3 |
5 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/slaacd/Makefile b/usr.sbin/slaacd/Makefile index a860b61306e..665b14cabe7 100644 --- a/usr.sbin/slaacd/Makefile +++ b/usr.sbin/slaacd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 2017/03/18 17:33:13 florian Exp $ +# $OpenBSD: Makefile,v 1.2 2017/05/27 16:16:49 florian Exp $ PROG= slaacd SRCS= control.c engine.c frontend.c log.c slaacd.c @@ -7,6 +7,8 @@ MAN= slaacd.8 #DEBUG= -g -DDEBUG=3 -O0 +CFLAGS+= -DSKIP_PROPOSAL + CFLAGS+= -Wall -I${.CURDIR} CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes CFLAGS+= -Wmissing-declarations diff --git a/usr.sbin/slaacd/engine.c b/usr.sbin/slaacd/engine.c index 113231974b0..0657af14115 100644 --- a/usr.sbin/slaacd/engine.c +++ b/usr.sbin/slaacd/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.16 2017/05/27 10:55:50 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.17 2017/05/27 16:16:49 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -1656,7 +1656,15 @@ update_iface_ra(struct slaacd_iface *iface, struct radv *ra) void send_proposal(struct imsg_proposal *proposal) { +#ifndef SKIP_PROPOSAL engine_imsg_compose_main(IMSG_PROPOSAL, 0, proposal, sizeof(*proposal)); +#else + struct imsg_proposal_ack ack; + ack.id = proposal->id; + ack.pid = proposal->pid; + ack.if_index = proposal->if_index; + engine_imsg_compose_frontend(IMSG_FAKE_ACK, 0, &ack, sizeof(ack)); +#endif } void diff --git a/usr.sbin/slaacd/frontend.c b/usr.sbin/slaacd/frontend.c index 5f3834ad734..8853cd1214e 100644 --- a/usr.sbin/slaacd/frontend.c +++ b/usr.sbin/slaacd/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.9 2017/05/27 10:52:16 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.10 2017/05/27 16:16:49 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -437,6 +437,10 @@ frontend_dispatch_engine(int fd, short event, void *bula) if_index = *((uint32_t *)imsg.data); send_solicitation(if_index); break; + case IMSG_FAKE_ACK: + frontend_imsg_compose_engine(IMSG_PROPOSAL_ACK, + 0, 0, imsg.data, sizeof(struct imsg_proposal_ack)); + break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); diff --git a/usr.sbin/slaacd/slaacd.c b/usr.sbin/slaacd/slaacd.c index 39210f2bd69..9ab1fdcd4a2 100644 --- a/usr.sbin/slaacd/slaacd.c +++ b/usr.sbin/slaacd/slaacd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacd.c,v 1.13 2017/05/27 13:10:07 florian Exp $ */ +/* $OpenBSD: slaacd.c,v 1.14 2017/05/27 16:16:49 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -72,6 +72,7 @@ const char* imsg_type_name[] = { "IMSG_CONFIGURE_ADDRESS", "IMSG_DEL_ADDRESS", "IMSG_CTL_SHOW_INTERFACE_INFO_ADDR_PROPOSAL", + "IMSG_FAKE_ACK", }; __dead void usage(void); diff --git a/usr.sbin/slaacd/slaacd.h b/usr.sbin/slaacd/slaacd.h index 4c9693f86c8..547e9740389 100644 --- a/usr.sbin/slaacd/slaacd.h +++ b/usr.sbin/slaacd/slaacd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacd.h,v 1.11 2017/05/27 10:52:16 florian Exp $ */ +/* $OpenBSD: slaacd.h,v 1.12 2017/05/27 16:16:49 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -69,6 +69,7 @@ enum imsg_type { IMSG_DEL_ADDRESS, IMSG_CTL_SHOW_INTERFACE_INFO_ADDR_PROPOSALS, IMSG_CTL_SHOW_INTERFACE_INFO_ADDR_PROPOSAL, + IMSG_FAKE_ACK, }; extern const char* imsg_type_name[]; |