diff src/dhcp6.c @ 5553:ef762d54fb7a draft

DHCP6: Abort in test mode when an error is returned by server.
author Roy Marples <roy@marples.name>
date Wed, 25 Nov 2020 15:14:11 +0000
parents a0d828e25482
children 3853222e97c7
line wrap: on
line diff
--- a/src/dhcp6.c	Wed Nov 25 14:55:25 2020 +0000
+++ b/src/dhcp6.c	Wed Nov 25 15:14:11 2020 +0000
@@ -2064,6 +2064,10 @@
 	free(sbuf);
 	state->lerror = code;
 	errno = 0;
+
+	if (code != 0 && ifp->ctx->options & DHCPCD_TEST)
+		eloop_exit(ifp->ctx->eloop, EXIT_FAILURE);
+
 	return (int)code;
 }