CVS commit: src/external/mpl/dhcp/dist

2021-05-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 26 22:52:32 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/client: dhclient.c
src/external/mpl/dhcp/dist/common: parse.c
src/external/mpl/dhcp/dist/common/tests: option_unittest.c
src/external/mpl/dhcp/dist/relay: dhcrelay.c
src/external/mpl/dhcp/dist/relay/tests: relay_unittests.c
src/external/mpl/dhcp/dist/server: dhcpd.c

Log Message:
merge local changes between dhcp-4.4.2 and dhcp-4.4.2-P1


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/client/dhclient.c
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/common/parse.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/mpl/dhcp/dist/common/tests/option_unittest.c
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/dist/relay/dhcrelay.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/mpl/dhcp/dist/relay/tests/relay_unittests.c
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/server/dhcpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/client/dhclient.c
diff -u src/external/mpl/dhcp/dist/client/dhclient.c:1.3 src/external/mpl/dhcp/dist/client/dhclient.c:1.4
--- src/external/mpl/dhcp/dist/client/dhclient.c:1.3	Mon Aug  3 17:10:56 2020
+++ src/external/mpl/dhcp/dist/client/dhclient.c	Wed May 26 18:52:31 2021
@@ -1,11 +1,11 @@
-/*	$NetBSD: dhclient.c,v 1.3 2020/08/03 21:10:56 christos Exp $	*/
+/*	$NetBSD: dhclient.c,v 1.4 2021/05/26 22:52:31 christos Exp $	*/
 
 /* dhclient.c
 
DHCP Client. */
 
 /*
- * Copyright (c) 2004-2020 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2021 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
@@ -33,7 +33,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: dhclient.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: dhclient.c,v 1.4 2021/05/26 22:52:31 christos Exp $");
 
 #include "dhcpd.h"
 #include 
@@ -84,7 +84,7 @@ int decline_wait_time = 10; /* Default t
 #define ASSERT_STATE(state_is, state_shouldbe) {}
 
 #ifndef UNIT_TEST
-static const char copyright[] = "Copyright 2004-2020 Internet Systems Consortium.";
+static const char copyright[] = "Copyright 2004-2021 Internet Systems Consortium.";
 static const char arr [] = "All rights reserved.";
 static const char message [] = "Internet Systems Consortium DHCP Client";
 static const char url [] = "For info, please visit https://www.isc.org/software/dhcp/;;
@@ -241,7 +241,7 @@ add_interfaces(char **ifaces, int niface
  */
 
 #include 
-__RCSID("$NetBSD: dhclient.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: dhclient.c,v 1.4 2021/05/26 22:52:31 christos Exp $");
 
 #if defined(DHCPv6) && defined(DHCP4o6)
 static void dhcp4o6_poll(void *dummy);
@@ -1230,7 +1230,7 @@ int find_subnet (struct subnet **sp,
  */
 
 #include 
-__RCSID("$NetBSD: dhclient.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: dhclient.c,v 1.4 2021/05/26 22:52:31 christos Exp $");
 
 void state_reboot (cpp)
 	void *cpp;

Index: src/external/mpl/dhcp/dist/common/parse.c
diff -u src/external/mpl/dhcp/dist/common/parse.c:1.3 src/external/mpl/dhcp/dist/common/parse.c:1.4
--- src/external/mpl/dhcp/dist/common/parse.c:1.3	Mon Aug  3 17:10:56 2020
+++ src/external/mpl/dhcp/dist/common/parse.c	Wed May 26 18:52:31 2021
@@ -1,11 +1,11 @@
-/*	$NetBSD: parse.c,v 1.3 2020/08/03 21:10:56 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.4 2021/05/26 22:52:31 christos Exp $	*/
 
 /* parse.c
 
Common parser code for dhcpd and dhclient. */
 
 /*
- * Copyright (c) 2004-2019 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2021 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: parse.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.4 2021/05/26 22:52:31 christos Exp $");
 
 #include "dhcpd.h"
 #include 
@@ -5561,13 +5561,14 @@ int parse_X (cfile, buf, max)
 skip_to_semi (cfile);
 return 0;
 			}
-			convert_num (cfile,  [len], val, 16, 8);
-			if (len++ > max) {
+			if (len >= max) {
 parse_warn (cfile,
 	"hexadecimal constant too long.");
 skip_to_semi (cfile);
 return 0;
 			}
+			convert_num (cfile,  [len], val, 16, 8);
+			len++;
 			token = peek_token (, (unsigned *)0, cfile);
 			if (token == COLON)
 token = next_token (,

Index: src/external/mpl/dhcp/dist/common/tests/option_unittest.c
diff -u src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.2 src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.3
--- src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.2	Sat Apr  7 18:37:29 

CVS commit: src/external/mpl/dhcp/dist/relay

2021-05-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 21 21:07:37 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/relay: dhcrelay.c

Log Message:
Add missing call to libdhcp_callbacks_register().  Should stop
dhcrelay() crashing when accessing *libdhcp_callbacks.local_port.
(from mrg@)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/relay/dhcrelay.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/relay/dhcrelay.c
diff -u src/external/mpl/dhcp/dist/relay/dhcrelay.c:1.3 src/external/mpl/dhcp/dist/relay/dhcrelay.c:1.4
--- src/external/mpl/dhcp/dist/relay/dhcrelay.c:1.3	Mon Aug  3 17:10:57 2020
+++ src/external/mpl/dhcp/dist/relay/dhcrelay.c	Fri May 21 17:07:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dhcrelay.c,v 1.3 2020/08/03 21:10:57 christos Exp $	*/
+/*	$NetBSD: dhcrelay.c,v 1.4 2021/05/21 21:07:37 christos Exp $	*/
 
 /* dhcrelay.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: dhcrelay.c,v 1.3 2020/08/03 21:10:57 christos Exp $");
+__RCSID("$NetBSD: dhcrelay.c,v 1.4 2021/05/21 21:07:37 christos Exp $");
 
 #include "dhcpd.h"
 #include 
@@ -264,7 +264,7 @@ char *progname;
  */
 
 #include 
-__RCSID("$NetBSD: dhcrelay.c,v 1.3 2020/08/03 21:10:57 christos Exp $");
+__RCSID("$NetBSD: dhcrelay.c,v 1.4 2021/05/21 21:07:37 christos Exp $");
 static const char use_noarg[] = "No argument for command: %s";
 #ifdef RELAY_PORT
 static const char use_port_defined[] = "Port already set, %s inappropriate";
@@ -317,6 +317,8 @@ main(int argc, char **argv) {
 	int local_family_set = 0;
 #endif
 
+	libdhcp_callbacks_register(_callbacks);
+
 #ifdef OLD_LOG_NAME
 	progname = "dhcrelay";
 #else



CVS commit: src/external/mpl/dhcp

2021-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 13 04:14:46 UTC 2021

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
use -fcommon here too.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.9 src/external/mpl/dhcp/Makefile.inc:1.10
--- src/external/mpl/dhcp/Makefile.inc:1.9	Sat Feb 20 01:43:04 2021
+++ src/external/mpl/dhcp/Makefile.inc	Tue Apr 13 04:14:46 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.9 2021/02/20 01:43:04 christos Exp $
+# $NetBSD: Makefile.inc,v 1.10 2021/04/13 04:14:46 mrg Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -61,3 +61,5 @@ LDADD+=-Wl,-Bdynamic
 .endif
 DPADD+= ${COBJDIR}/libdhcp.a
 DPADD+= ${OMOBJDIR}/libomapi.a
+
+COPTS+=	-fcommon



CVS commit: src/external/mpl/dhcp

2021-02-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 20 01:43:04 UTC 2021

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
libisc needs libssl now


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.8 src/external/mpl/dhcp/Makefile.inc:1.9
--- src/external/mpl/dhcp/Makefile.inc:1.8	Sat May 30 16:47:59 2020
+++ src/external/mpl/dhcp/Makefile.inc	Fri Feb 19 20:43:04 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.8 2020/05/30 20:47:59 christos Exp $
+# $NetBSD: Makefile.inc,v 1.9 2021/02/20 01:43:04 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -54,8 +54,8 @@ DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} 
 .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
-LDADD+= -lcrypto -lipsec -lcrypt
-DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
+LDADD+= -lssl -lcrypto -lipsec -lcrypt
+DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
 .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif



CVS commit: src/external/mpl/dhcp/dist/common

2021-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 13 17:01:31 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/common: options.c

Log Message:
Reset options on every loop.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/dist/common/options.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.4 src/external/mpl/dhcp/dist/common/options.c:1.5
--- src/external/mpl/dhcp/dist/common/options.c:1.4	Wed Jan 13 10:51:49 2021
+++ src/external/mpl/dhcp/dist/common/options.c	Wed Jan 13 12:01:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $	*/
 
 /* options.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.5 2021/01/13 17:01:31 christos Exp $");
 
 #define DHCP_OPTION_DATA
 #include "dhcpd.h"
@@ -130,8 +130,8 @@ int parse_option_buffer (options, buffer
 	unsigned len, offset;
 	unsigned code;
 	struct option_cache *op = NULL, *nop = NULL;
-	struct buffer *bp = (struct buffer *)0;
-	struct option *option = NULL;
+	struct buffer *bp = NULL;
+	struct option *option;
 	char *reason = "general failure";
 
 	if (!buffer_allocate (, length, MDL)) {
@@ -143,6 +143,7 @@ int parse_option_buffer (options, buffer
 	for (offset = 0;
 	 (offset + universe->tag_size) <= length &&
 	 (code = universe->get_tag(buffer + offset)) != universe->end; ) {
+		option = NULL;
 		offset += universe->tag_size;
 
 		/* Pad options don't have a length - just skip them. */



CVS commit: src/external/mpl/dhcp/dist/common

2021-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 13 15:51:49 UTC 2021

Modified Files:
src/external/mpl/dhcp/dist/common: options.c

Log Message:
If an option is not found in the standard table, log it and don't try to
dereference it. This prevents crashes from XenServer VM that PXE boots and
includes option 175 in the DHCP request. Reported by Stephen Borrill.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/common/options.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.3 src/external/mpl/dhcp/dist/common/options.c:1.4
--- src/external/mpl/dhcp/dist/common/options.c:1.3	Mon Aug  3 17:10:56 2020
+++ src/external/mpl/dhcp/dist/common/options.c	Wed Jan 13 10:51:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.3 2020/08/03 21:10:56 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $	*/
 
 /* options.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: options.c,v 1.3 2020/08/03 21:10:56 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.4 2021/01/13 15:51:49 christos Exp $");
 
 #define DHCP_OPTION_DATA
 #include "dhcpd.h"
@@ -179,13 +179,16 @@ int parse_option_buffer (options, buffer
 
 		offset += universe->length_size;
 
-		option_code_hash_lookup(, universe->code_hash, ,
-	0, MDL);
+		if (!option_code_hash_lookup(, universe->code_hash,
+		, 0, MDL)) {
+			log_error("Can't find option with code %u", code);
+		}
 
 		/* If the length is outrageous, the options are bad. */
 		if (offset + len > length) {
 			/* Avoid reference count overflow */
-			option_dereference(, MDL);
+			if (option)
+option_dereference(, MDL);
 			reason = "option length exceeds option buffer length";
 		  bogus:
 			log_error("parse_option_buffer: malformed option "
@@ -216,7 +219,8 @@ int parse_option_buffer (options, buffer
 			/* non-compliant clients can send it
 			 * we'll just drop it and go on */
 			log_debug ("Ignoring empty DHO_HOST_NAME option");
-			option_dereference(, MDL);
+			if (option)
+option_dereference(, MDL);
 			offset += len;
 			continue;
 		}
@@ -282,7 +286,8 @@ int parse_option_buffer (options, buffer
 			option_cache_dereference(, MDL);
 		}
 
-		option_dereference(, MDL);
+		if (option)
+			option_dereference(, MDL);
 		offset += len;
 	}
 	buffer_dereference (, MDL);



CVS commit: src/external/mpl/dhcp/dist/omapip

2020-11-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 12 22:11:03 UTC 2020

Modified Files:
src/external/mpl/dhcp/dist/omapip: errwarn.c

Log Message:
Don't use static buffers to store format strings; this is a multi-threaded
program and if we print from multiple threads we can end up overwriting the
formats while printf is formating and that can end up in tears.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/omapip/errwarn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/omapip/errwarn.c
diff -u src/external/mpl/dhcp/dist/omapip/errwarn.c:1.3 src/external/mpl/dhcp/dist/omapip/errwarn.c:1.4
--- src/external/mpl/dhcp/dist/omapip/errwarn.c:1.3	Mon Aug  3 17:10:57 2020
+++ src/external/mpl/dhcp/dist/omapip/errwarn.c	Thu Nov 12 17:11:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: errwarn.c,v 1.3 2020/08/03 21:10:57 christos Exp $	*/
+/*	$NetBSD: errwarn.c,v 1.4 2020/11/12 22:11:03 christos Exp $	*/
 
 /* errwarn.c
 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: errwarn.c,v 1.3 2020/08/03 21:10:57 christos Exp $");
+__RCSID("$NetBSD: errwarn.c,v 1.4 2020/11/12 22:11:03 christos Exp $");
 
 #include "dhcpd.h"
 
@@ -50,14 +50,14 @@ int log_perror = 1;
 void (*log_cleanup) (void);
 
 #define CVT_BUF_MAX 1023
-static char mbuf [CVT_BUF_MAX + 1];
-static char fbuf [CVT_BUF_MAX + 1];
 
 /* Log an error message, then exit... */
 
 void log_fatal (const char * fmt, ... )
 {
   va_list list;
+  char mbuf [CVT_BUF_MAX + 1];
+  char fbuf [CVT_BUF_MAX + 1];
 
   do_percentm (fbuf, sizeof fbuf, fmt);
 
@@ -96,6 +96,8 @@ void log_fatal (const char * fmt, ... )
 
 int log_error (const char * fmt, ...)
 {
+  char mbuf [CVT_BUF_MAX + 1];
+  char fbuf [CVT_BUF_MAX + 1];
   va_list list;
 
   do_percentm (fbuf, sizeof fbuf, fmt);
@@ -123,6 +125,8 @@ int log_error (const char * fmt, ...)
 
 int log_info (const char *fmt, ...)
 {
+  char mbuf [CVT_BUF_MAX + 1];
+  char fbuf [CVT_BUF_MAX + 1];
   va_list list;
 
   do_percentm (fbuf, sizeof fbuf, fmt);
@@ -150,6 +154,8 @@ int log_info (const char *fmt, ...)
 
 int log_debug (const char *fmt, ...)
 {
+  char mbuf [CVT_BUF_MAX + 1];
+  char fbuf [CVT_BUF_MAX + 1];
   va_list list;
 
   do_percentm (fbuf, sizeof fbuf, fmt);



CVS commit: src/external/mpl/dhcp/bin/server

2020-06-07 Thread Santhosh Raju
Module Name:src
Committed By:   fox
Date:   Sun Jun  7 23:29:16 UTC 2020

Modified Files:
src/external/mpl/dhcp/bin/server: Makefile

Log Message:
external/mpl/dhcp: Suppress -Werror=stringop-truncation error

This logic correctly uses strncpy(3) to fully initialize a fixed-width field, 
and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with 
MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mpl/dhcp/bin/server/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/bin/server/Makefile
diff -u src/external/mpl/dhcp/bin/server/Makefile:1.5 src/external/mpl/dhcp/bin/server/Makefile:1.6
--- src/external/mpl/dhcp/bin/server/Makefile:1.5	Sat May 23 00:32:42 2020
+++ src/external/mpl/dhcp/bin/server/Makefile	Sun Jun  7 23:29:16 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2020/05/23 00:32:42 rin Exp $
+# $NetBSD: Makefile,v 1.6 2020/06/07 23:29:16 fox Exp $
 
 .include 
 
@@ -21,5 +21,6 @@ COPTS.ddns.c +=-Wno-stringop-overflow
 
 COPTS.mdb6.c +=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}
 COPTS.omapi.c +=	-Wno-stack-protector
+COPTS.confpars.c+=	${GCC_NO_STRINGOP_TRUNCATION}
 
 .include 



CVS commit: src/external/mpl/dhcp

2020-05-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 25 15:37:51 UTC 2020

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Fix static build


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.6 src/external/mpl/dhcp/Makefile.inc:1.7
--- src/external/mpl/dhcp/Makefile.inc:1.6	Sun May 24 15:50:12 2020
+++ src/external/mpl/dhcp/Makefile.inc	Mon May 25 11:37:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.6 2020/05/24 19:50:12 christos Exp $
+# $NetBSD: Makefile.inc,v 1.7 2020/05/25 15:37:50 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -37,8 +37,8 @@ LDADD+= ${OMOBJDIR}/libomapi.a
 # would be to install the libraries in /lib...
 LDADD+=-Wl,-Bstatic
 .endif
-LDADD+= -lirs -lisccfg -ldns -lisc -luv
-DPADD+= ${LIBIRS} ${LIBISCCFG} ${LIBDNS} ${LIBISC} ${LIBUV}
+LDADD+= -lirs -lisccfg -ldns -lisc -luv -lkvm
+DPADD+= ${LIBIRS} ${LIBISCCFG} ${LIBDNS} ${LIBISC} ${LIBUV} ${LIBKVM}
 LDADD+= -lpthread -lz
 DPADD+= ${LIBPTHREAD} ${LIBZ}
 .if (${MKKERBEROS} != "no")



CVS commit: src/external/mpl/dhcp

2020-05-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 24 19:50:12 UTC 2020

Modified Files:
src/external/mpl/dhcp: Makefile.inc
src/external/mpl/dhcp/dist/omapip: isclib.c

Log Message:
Adjust for bind-9.16.3


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mpl/dhcp/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/omapip/isclib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.5 src/external/mpl/dhcp/Makefile.inc:1.6
--- src/external/mpl/dhcp/Makefile.inc:1.5	Thu Jan 10 12:41:47 2019
+++ src/external/mpl/dhcp/Makefile.inc	Sun May 24 15:50:12 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.5 2019/01/10 17:41:47 christos Exp $
+# $NetBSD: Makefile.inc,v 1.6 2020/05/24 19:50:12 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -37,8 +37,10 @@ LDADD+= ${OMOBJDIR}/libomapi.a
 # would be to install the libraries in /lib...
 LDADD+=-Wl,-Bstatic
 .endif
-LDADD+= -lirs -lisccfg -ldns -lisc
-LDADD+=-lpthread -lz
+LDADD+= -lirs -lisccfg -ldns -lisc -luv
+DPADD+= ${LIBIRS} ${LIBISCCFG} ${LIBDNS} ${LIBISC} ${LIBUV}
+LDADD+= -lpthread -lz
+DPADD+= ${LIBPTHREAD} ${LIBZ}
 .if (${MKKERBEROS} != "no")
 LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
 DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
@@ -53,5 +55,3 @@ LDADD+=-Wl,-Bdynamic
 .endif
 DPADD+= ${COBJDIR}/libdhcp.a
 DPADD+= ${OMOBJDIR}/libomapi.a
-DPADD+=	${LIBDNS} ${LIBISC}
-DPADD+= ${LIBPTHREAD} ${LIBZ}

Index: src/external/mpl/dhcp/dist/omapip/isclib.c
diff -u src/external/mpl/dhcp/dist/omapip/isclib.c:1.3 src/external/mpl/dhcp/dist/omapip/isclib.c:1.4
--- src/external/mpl/dhcp/dist/omapip/isclib.c:1.3	Thu Jan 10 12:41:47 2019
+++ src/external/mpl/dhcp/dist/omapip/isclib.c	Sun May 24 15:50:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: isclib.c,v 1.3 2019/01/10 17:41:47 christos Exp $	*/
+/*	$NetBSD: isclib.c,v 1.4 2020/05/24 19:50:12 christos Exp $	*/
 
 /*
  * Copyright(c) 2009-2017 by Internet Systems Consortium, Inc.("ISC")
@@ -24,7 +24,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: isclib.c,v 1.3 2019/01/10 17:41:47 christos Exp $");
+__RCSID("$NetBSD: isclib.c,v 1.4 2020/05/24 19:50:12 christos Exp $");
 
 /*Trying to figure out what we need to define to get things to work.
   It looks like we want/need the library but need the fdwatchcommand
@@ -169,10 +169,7 @@ dhcp_context_create(int flags,
 		 * the lib inits in case we aren't doing NSUPDATE
 		 * in which case dst needs a memory context
 		 */
-		result = isc_mem_create(0, 0, _gbl_ctx.mctx);
-		if (result != ISC_R_SUCCESS)
-			goto cleanup;
-
+		isc_mem_create(_gbl_ctx.mctx);
 
 #if defined (NSUPDATE)
 		result = dns_lib_init();
@@ -193,20 +190,17 @@ dhcp_context_create(int flags,
 			goto cleanup;
 
 		result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx,
-		 dhcp_gbl_ctx.actx,
 		 1, 0,
 		 _gbl_ctx.taskmgr);
 		if (result != ISC_R_SUCCESS)
 			goto cleanup;
 
 		result = isc_socketmgr_createinctx(dhcp_gbl_ctx.mctx,
-		   dhcp_gbl_ctx.actx,
 		   _gbl_ctx.socketmgr);
 		if (result != ISC_R_SUCCESS)
 			goto cleanup;
 
 		result = isc_timermgr_createinctx(dhcp_gbl_ctx.mctx,
-		  dhcp_gbl_ctx.actx,
 		  _gbl_ctx.timermgr);
 		if (result != ISC_R_SUCCESS)
 			goto cleanup;



CVS commit: src/external/mpl/dhcp/bin/server

2020-05-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 23 00:32:42 UTC 2020

Modified Files:
src/external/mpl/dhcp/bin/server: Makefile

Log Message:
GCC8 needs -Wno-stringop-overflow also for m68000 (sun2).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/bin/server/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/bin/server/Makefile
diff -u src/external/mpl/dhcp/bin/server/Makefile:1.4 src/external/mpl/dhcp/bin/server/Makefile:1.5
--- src/external/mpl/dhcp/bin/server/Makefile:1.4	Wed Feb 12 00:41:50 2020
+++ src/external/mpl/dhcp/bin/server/Makefile	Sat May 23 00:32:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/02/12 00:41:50 fox Exp $
+# $NetBSD: Makefile,v 1.5 2020/05/23 00:32:42 rin Exp $
 
 .include 
 
@@ -15,7 +15,7 @@ FILESDIR= /usr/share/examples/dhcp
 FILES=	dhcpd.conf
 .endif
 
-.if !empty(MACHINE_ARCH:Msh3*)
+.if !empty(MACHINE_ARCH:Msh3*) || ${MACHINE_ARCH} == "m68000"
 COPTS.ddns.c +=-Wno-stringop-overflow
 .endif
 



CVS commit: src/external/mpl/dhcp/dist/common

2020-05-15 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri May 15 12:31:04 UTC 2020

Modified Files:
src/external/mpl/dhcp/dist/common: bpf.c discover.c lpf.c packet.c
raw.c socket.c

Log Message:
crunchgen fix

Make sure local_port is not shared within a crunchgen binary. There is
more to do to get full functionnality in crunchgen, but at least this
change makes dhcpd listen on the right port again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/common/bpf.c
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/common/discover.c \
src/external/mpl/dhcp/dist/common/lpf.c \
src/external/mpl/dhcp/dist/common/packet.c \
src/external/mpl/dhcp/dist/common/raw.c \
src/external/mpl/dhcp/dist/common/socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/common/bpf.c
diff -u src/external/mpl/dhcp/dist/common/bpf.c:1.3 src/external/mpl/dhcp/dist/common/bpf.c:1.4
--- src/external/mpl/dhcp/dist/common/bpf.c:1.3	Fri Jun  1 00:42:49 2018
+++ src/external/mpl/dhcp/dist/common/bpf.c	Fri May 15 12:31:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.3 2018/06/01 00:42:49 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.4 2020/05/15 12:31:03 manu Exp $	*/
 
 /* bpf.c
 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: bpf.c,v 1.3 2018/06/01 00:42:49 christos Exp $");
+__RCSID("$NetBSD: bpf.c,v 1.4 2020/05/15 12:31:03 manu Exp $");
 
 #include "dhcpd.h"
 #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE)	\
@@ -366,7 +366,7 @@ void if_register_receive (info)
 		dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
 	}
 #endif
-	p.bf_insns [8].k = ntohs (local_port);
+	p.bf_insns [8].k = ntohs (*libdhcp_callbacks.local_port);
 
 	if (ioctl (info -> rfdesc, BIOCSETF, ) < 0)
 		log_fatal ("Can't install packet filter program: %m");

Index: src/external/mpl/dhcp/dist/common/discover.c
diff -u src/external/mpl/dhcp/dist/common/discover.c:1.2 src/external/mpl/dhcp/dist/common/discover.c:1.3
--- src/external/mpl/dhcp/dist/common/discover.c:1.2	Sat Apr  7 22:37:29 2018
+++ src/external/mpl/dhcp/dist/common/discover.c	Fri May 15 12:31:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: discover.c,v 1.2 2018/04/07 22:37:29 christos Exp $	*/
+/*	$NetBSD: discover.c,v 1.3 2020/05/15 12:31:03 manu Exp $	*/
 
 /* discover.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: discover.c,v 1.2 2018/04/07 22:37:29 christos Exp $");
+__RCSID("$NetBSD: discover.c,v 1.3 2020/05/15 12:31:03 manu Exp $");
 
 #include "dhcpd.h"
 
@@ -47,8 +47,6 @@ __RCSID("$NetBSD: discover.c,v 1.2 2018/
 struct interface_info *interfaces, *dummy_interfaces, *fallback_interface;
 int interfaces_invalidated;
 int quiet_interface_discovery;
-u_int16_t local_port;
-u_int16_t remote_port;
 u_int16_t relay_port = 0;
 int dhcpv4_over_dhcpv6 = 0;
 int (*dhcp_interface_setup_hook) (struct interface_info *, struct iaddr *);
Index: src/external/mpl/dhcp/dist/common/lpf.c
diff -u src/external/mpl/dhcp/dist/common/lpf.c:1.2 src/external/mpl/dhcp/dist/common/lpf.c:1.3
--- src/external/mpl/dhcp/dist/common/lpf.c:1.2	Sat Apr  7 22:37:29 2018
+++ src/external/mpl/dhcp/dist/common/lpf.c	Fri May 15 12:31:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lpf.c,v 1.2 2018/04/07 22:37:29 christos Exp $	*/
+/*	$NetBSD: lpf.c,v 1.3 2020/05/15 12:31:03 manu Exp $	*/
 
 /* lpf.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: lpf.c,v 1.2 2018/04/07 22:37:29 christos Exp $");
+__RCSID("$NetBSD: lpf.c,v 1.3 2020/05/15 12:31:03 manu Exp $");
 
 #include "dhcpd.h"
 #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
@@ -278,7 +278,7 @@ static void lpf_gen_filter_setup (info)
 		dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
 	}
 #endif
-	dhcp_bpf_filter [8].k = ntohs (local_port);
+	dhcp_bpf_filter [8].k = ntohs (*libdhcp_callbacks.local_port);
 
 	if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, ,
 			sizeof p) < 0) {
Index: src/external/mpl/dhcp/dist/common/packet.c
diff -u src/external/mpl/dhcp/dist/common/packet.c:1.2 src/external/mpl/dhcp/dist/common/packet.c:1.3
--- src/external/mpl/dhcp/dist/common/packet.c:1.2	Sat Apr  7 22:37:29 2018
+++ src/external/mpl/dhcp/dist/common/packet.c	Fri May 15 12:31:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: packet.c,v 1.2 2018/04/07 22:37:29 christos Exp $	*/
+/*	$NetBSD: packet.c,v 1.3 2020/05/15 12:31:03 manu Exp $	*/
 
 /* packet.c
 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: packet.c,v 1.2 2018/04/07 22:37:29 christos Exp $");
+__RCSID("$NetBSD: packet.c,v 1.3 2020/05/15 12:31:03 manu Exp $");
 
 #include "dhcpd.h"
 
@@ -308,10 +308,10 @@ decode_udp_ip_header(struct interface_in
 
   /* Is it to the port we're serving? */
 #if defined(RELAY_PORT)
-  if ((udp.uh_dport != local_port) &&
+  if ((udp.uh_dport != *libdhcp_callbacks.local_port) &&
   ((relay_port == 0) || (udp.uh_dport != relay_port)))
 #else
-  if (udp.uh_dport != local_port)
+  if 

CVS commit: src/external/mpl/dhcp/bin/server

2020-02-11 Thread Santhosh Raju
Module Name:src
Committed By:   fox
Date:   Wed Feb 12 00:41:50 UTC 2020

Modified Files:
src/external/mpl/dhcp/bin/server: Makefile

Log Message:
external/mpl/dhcp: Fix build failure under LLVM.

-Wno-error= flag now only applies to gcc 8 and not to LLVM based builds.

Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/bin/server/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/bin/server/Makefile
diff -u src/external/mpl/dhcp/bin/server/Makefile:1.3 src/external/mpl/dhcp/bin/server/Makefile:1.4
--- src/external/mpl/dhcp/bin/server/Makefile:1.3	Sun Feb  9 07:59:44 2020
+++ src/external/mpl/dhcp/bin/server/Makefile	Wed Feb 12 00:41:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/02/09 07:59:44 fox Exp $
+# $NetBSD: Makefile,v 1.4 2020/02/12 00:41:50 fox Exp $
 
 .include 
 
@@ -19,7 +19,7 @@ FILES=	dhcpd.conf
 COPTS.ddns.c +=-Wno-stringop-overflow
 .endif
 
-COPTS.mdb6.c +=		-Wno-error=format-overflow
+COPTS.mdb6.c +=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}
 COPTS.omapi.c +=	-Wno-stack-protector
 
 .include 



CVS commit: src/external/mpl/dhcp/bin/server

2020-02-09 Thread Santhosh Raju
Module Name:src
Committed By:   fox
Date:   Sun Feb  9 07:59:44 UTC 2020

Modified Files:
src/external/mpl/dhcp/bin/server: Makefile

Log Message:
external/mpl/dhcp: Suppress -Werror=format-overflow error.

Add -Wno-error=format-overflow mdb6.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/bin/server/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/bin/server/Makefile
diff -u src/external/mpl/dhcp/bin/server/Makefile:1.2 src/external/mpl/dhcp/bin/server/Makefile:1.3
--- src/external/mpl/dhcp/bin/server/Makefile:1.2	Wed Oct 30 00:25:00 2019
+++ src/external/mpl/dhcp/bin/server/Makefile	Sun Feb  9 07:59:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2019/10/30 00:25:00 christos Exp $
+# $NetBSD: Makefile,v 1.3 2020/02/09 07:59:44 fox Exp $
 
 .include 
 
@@ -19,6 +19,7 @@ FILES=	dhcpd.conf
 COPTS.ddns.c +=-Wno-stringop-overflow
 .endif
 
+COPTS.mdb6.c +=		-Wno-error=format-overflow
 COPTS.omapi.c +=	-Wno-stack-protector
 
 .include 



CVS commit: src/external/mpl/dhcp/dist/omapip

2019-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 25 02:31:58 UTC 2019

Modified Files:
src/external/mpl/dhcp/dist/omapip: result.c

Log Message:
Catch up with bind


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/omapip/result.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/omapip/result.c
diff -u src/external/mpl/dhcp/dist/omapip/result.c:1.2 src/external/mpl/dhcp/dist/omapip/result.c:1.3
--- src/external/mpl/dhcp/dist/omapip/result.c:1.2	Sat Apr  7 18:37:30 2018
+++ src/external/mpl/dhcp/dist/omapip/result.c	Sun Feb 24 21:31:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: result.c,v 1.2 2018/04/07 22:37:30 christos Exp $	*/
+/*	$NetBSD: result.c,v 1.3 2019/02/25 02:31:57 christos Exp $	*/
 
 /* result.c
  */
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: result.c,v 1.2 2018/04/07 22:37:30 christos Exp $");
+__RCSID("$NetBSD: result.c,v 1.3 2019/02/25 02:31:57 christos Exp $");
 
 #include "dhcpd.h"
 
@@ -77,15 +77,12 @@ static const char *text[DHCP_R_NRESULTS]
 #define DHCP_RESULT_RESULTSET		2
 #define DHCP_RESULT_UNAVAILABLESET	3
 
-// This is a placeholder as we don't allow for external message catalogs yet
-isc_msgcat_t * dhcp_msgcat = NULL;
-
 isc_result_t
 dhcp_result_register(void) {
 	isc_result_t result;
 
 	result = isc_result_register(ISC_RESULTCLASS_DHCP, DHCP_R_NRESULTS,
- text, dhcp_msgcat, DHCP_RESULT_RESULTSET);
+ text, DHCP_RESULT_RESULTSET);
 
 	return(result);
 }



CVS commit: src/external/mpl/dhcp/dist/bind

2019-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  8 20:29:06 UTC 2019

Removed Files:
src/external/mpl/dhcp/dist/bind: Makefile.in bind.tar.gz version.tmp

Log Message:
Remove the copy of bind?!?! used for its libraries...


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 src/external/mpl/dhcp/dist/bind/Makefile.in \
src/external/mpl/dhcp/dist/bind/bind.tar.gz \
src/external/mpl/dhcp/dist/bind/version.tmp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mpl/dhcp/dist/omapip

2019-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 01:51:50 UTC 2019

Modified Files:
src/external/mpl/dhcp/dist/omapip: buffer.c dispatch.c

Log Message:
apparently the fdwatch crap is needed, so undo the ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/omapip/buffer.c \
src/external/mpl/dhcp/dist/omapip/dispatch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/omapip/buffer.c
diff -u src/external/mpl/dhcp/dist/omapip/buffer.c:1.3 src/external/mpl/dhcp/dist/omapip/buffer.c:1.4
--- src/external/mpl/dhcp/dist/omapip/buffer.c:1.3	Thu Jan 10 12:41:47 2019
+++ src/external/mpl/dhcp/dist/omapip/buffer.c	Sat Jan 26 20:51:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: buffer.c,v 1.3 2019/01/10 17:41:47 christos Exp $	*/
+/*	$NetBSD: buffer.c,v 1.4 2019/01/27 01:51:50 christos Exp $	*/
 
 /* buffer.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: buffer.c,v 1.3 2019/01/10 17:41:47 christos Exp $");
+__RCSID("$NetBSD: buffer.c,v 1.4 2019/01/27 01:51:50 christos Exp $");
 
 #include "dhcpd.h"
 
@@ -341,7 +341,6 @@ isc_result_t omapi_connection_copyin (om
 	status = ISC_R_SUCCESS;
 
  leave:
-#if 0
 	/*
 	 * If we have any bytes to send and we have a proper io object
 	 * inform the socket code that we would like to know when we
@@ -355,7 +354,6 @@ isc_result_t omapi_connection_copyin (om
 	   ISC_SOCKFDWATCH_WRITE);
 		}
 	}
-#endif
 
 	return (status);
 }
Index: src/external/mpl/dhcp/dist/omapip/dispatch.c
diff -u src/external/mpl/dhcp/dist/omapip/dispatch.c:1.3 src/external/mpl/dhcp/dist/omapip/dispatch.c:1.4
--- src/external/mpl/dhcp/dist/omapip/dispatch.c:1.3	Thu Jan 10 12:41:47 2019
+++ src/external/mpl/dhcp/dist/omapip/dispatch.c	Sat Jan 26 20:51:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dispatch.c,v 1.3 2019/01/10 17:41:47 christos Exp $	*/
+/*	$NetBSD: dispatch.c,v 1.4 2019/01/27 01:51:50 christos Exp $	*/
 
 /* dispatch.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: dispatch.c,v 1.3 2019/01/10 17:41:47 christos Exp $");
+__RCSID("$NetBSD: dispatch.c,v 1.4 2019/01/27 01:51:50 christos Exp $");
 
 #include "dhcpd.h"
 
@@ -121,7 +121,6 @@ trigger_event(struct eventqueue **queue)
  * 1 is delete, 0 is leave in place
  */
 #define SOCKDELETE 1
-#ifdef ISC_SOCKFDWATCH_READ
 static int
 omapi_iscsock_cb(isc_task_t   *task,
 		 isc_socket_t *socket,
@@ -198,7 +197,6 @@ omapi_iscsock_cb(isc_task_t   *task,
 	 */
 	return (0);
 }
-#endif
 
 /* Register an I/O handle so that we can do asynchronous I/O on it. */
 
@@ -214,9 +212,7 @@ isc_result_t omapi_register_io_object (o
 {
 	isc_result_t status;
 	omapi_io_object_t *obj, *p;
-#ifdef ISC_SOCKFDWATCH_READ
 	int fd_flags = 0, fd = 0;
-#endif
 
 	/* omapi_io_states is a static object.   If its reference count
 	   is zero, this is the first I/O handle to be registered, so
@@ -254,7 +250,6 @@ isc_result_t omapi_register_io_object (o
 	 * a write socket we asssume they are the same socket.
 	 */
 
-#ifdef ISC_SOCKFDWATCH_READ
 	if (readfd) {
 		fd_flags |= ISC_SOCKFDWATCH_READ;
 		fd = readfd(h);
@@ -283,7 +278,6 @@ isc_result_t omapi_register_io_object (o
 			return (status);
 		}
 	}
-#endif
 
 
 	/* Find the last I/O state, if there are any. */
@@ -324,9 +318,7 @@ isc_result_t omapi_reregister_io_object 
 	 	(omapi_object_t *))
 {
 	omapi_io_object_t *obj;
-#ifdef ISC_SOCKFDWATCH_READ
 	int fd_flags = 0;
-#endif
 
 	if ((!h -> outer) || (h -> outer -> type != omapi_type_io_object)) {
 		/*
@@ -352,7 +344,6 @@ isc_result_t omapi_reregister_io_object 
 	obj->writer = writer;
 	obj->reaper = reaper;
 
-#ifdef ISC_SOCKFDWATCH_READ
 	if (readfd) {
 		fd_flags |= ISC_SOCKFDWATCH_READ;
 	}
@@ -362,7 +353,6 @@ isc_result_t omapi_reregister_io_object 
 	}
 
 	isc_socket_fdwatchpoke(obj->fd, fd_flags);
-#endif
 	
 	return (ISC_R_SUCCESS);
 }



CVS commit: src/external/mpl/dhcp

2019-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 10 17:41:48 UTC 2019

Modified Files:
src/external/mpl/dhcp: Makefile.inc
src/external/mpl/dhcp/dist/common: dns.c
src/external/mpl/dhcp/dist/omapip: buffer.c connection.c dispatch.c
isclib.c
src/external/mpl/dhcp/dist/server: dhcpv6.c mdb6.c
src/external/mpl/dhcp/include: config.h

Log Message:
Gut omapip support since the socket stuff to support it is gone, and
adjust to the new isc library reality.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/dhcp/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/common/dns.c
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/omapip/buffer.c \
src/external/mpl/dhcp/dist/omapip/connection.c \
src/external/mpl/dhcp/dist/omapip/dispatch.c \
src/external/mpl/dhcp/dist/omapip/isclib.c
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/server/dhcpv6.c \
src/external/mpl/dhcp/dist/server/mdb6.c
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/dhcp/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.4 src/external/mpl/dhcp/Makefile.inc:1.5
--- src/external/mpl/dhcp/Makefile.inc:1.4	Sun Aug 12 11:39:22 2018
+++ src/external/mpl/dhcp/Makefile.inc	Thu Jan 10 12:41:47 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.4 2018/08/12 15:39:22 christos Exp $
+# $NetBSD: Makefile.inc,v 1.5 2019/01/10 17:41:47 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -10,7 +10,7 @@ CWARNFLAGS.clang+=	-Wno-tautological-com
 			-Wno-format-security -Wno-error=unused-const-variable
 
 DIST:=	${.PARSEDIR}/dist
-BIND:=	${.PARSEDIR}/../../bsd/bind/dist
+BIND:=	${.PARSEDIR}/../../mpl/bind/dist
 .PATH:	${DIST}/${DHCPSRCDIR}
 
 COBJDIR!=cd ${.PARSEDIR}/lib/common && ${PRINTOBJDIR}

Index: src/external/mpl/dhcp/dist/common/dns.c
diff -u src/external/mpl/dhcp/dist/common/dns.c:1.2 src/external/mpl/dhcp/dist/common/dns.c:1.3
--- src/external/mpl/dhcp/dist/common/dns.c:1.2	Sat Apr  7 18:37:29 2018
+++ src/external/mpl/dhcp/dist/common/dns.c	Thu Jan 10 12:41:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dns.c,v 1.2 2018/04/07 22:37:29 christos Exp $	*/
+/*	$NetBSD: dns.c,v 1.3 2019/01/10 17:41:47 christos Exp $	*/
 
 /* dns.c
 
@@ -29,14 +29,13 @@
  */
 
 #include 
-__RCSID("$NetBSD: dns.c,v 1.2 2018/04/07 22:37:29 christos Exp $");
+__RCSID("$NetBSD: dns.c,v 1.3 2019/01/10 17:41:47 christos Exp $");
 
 /*! \file common/dns.c
  */
 #include "dhcpd.h"
 #include "arpa/nameser.h"
-#include 
-#include 
+#include 
 #include 
 
 /*
@@ -1482,8 +1481,9 @@ static int get_std_dhcid(dhcp_ddns_cb_t 
 		  unsigned id_len)
 {
 	struct data_string *id = _cb->dhcid;
-	isc_sha256_t sha256;
-	unsigned char buf[ISC_SHA256_DIGESTLENGTH];
+	isc_md_t *md;
+	isc_result_t result;
+	unsigned char buf[256];	// XXX: big enough > 32
 	unsigned char fwd_buf[256];
 	unsigned fwd_buflen = 0;
 
@@ -1491,6 +1491,11 @@ static int get_std_dhcid(dhcp_ddns_cb_t 
 	if (type < 0 || type > 65535)
 		return (0);
 
+	md = isc_md_new();
+	if (md == NULL) {
+		return (0);
+	}
+
 	/* We need to convert the fwd name to wire representation */
 	if (MRns_name_pton((char *)ddns_cb->fwd_name.data, fwd_buf, 256) == -1)
 		return (0);
@@ -1511,17 +1516,41 @@ static int get_std_dhcid(dhcp_ddns_cb_t 
 	/* The next is the digest type, SHA-256 is 1 */
 	putUChar(id->buffer->data + 2, 1u);
 
+
 	/* Computing the digest */
-	isc_sha256_init();
-	isc_sha256_update(, identifier, id_len);
-	isc_sha256_update(, fwd_buf, fwd_buflen);
-	isc_sha256_final(buf, );
+	result = isc_md_init(md, ISC_MD_SHA256);
+	if (result != ISC_R_SUCCESS) {
+		goto end;
+	}
+
+	result = isc_md_update(md, identifier, id_len);
+	if (result != ISC_R_SUCCESS) {
+		goto end;
+	}
+
+	result = isc_md_update(md, fwd_buf, fwd_buflen);
+	if (result != ISC_R_SUCCESS) {
+		goto end;
+	}
+
+	result = isc_md_final(md, buf, _len);
+	if (result != ISC_R_SUCCESS) {
+		goto end;
+	}
+
+	isc_md_free(md);
+	md = NULL;
 
 	memcpy(id->buffer->data + 3, , ISC_SHA256_DIGESTLENGTH);
 
 	id->len = ISC_SHA256_DIGESTLENGTH + 2 + 1;
 
 	return (1);
+end:
+	if (md != NULL) {
+		isc_md_free(md);
+	}
+	return (0);
 }
 
 /*!
@@ -1551,8 +1580,9 @@ static int get_int_dhcid (dhcp_ddns_cb_t
 		   unsigned len)
 {
 	struct data_string *id = _cb->dhcid;
-	unsigned char buf[ISC_MD5_DIGESTLENGTH];
-	isc_md5_t md5;
+	unsigned char buf[256];	// XXX: big enough (> 16)
+	isc_md_t *md;
+	isc_result_t result;
 	int i;
 
 	/* Types can only be 0..(2^16)-1. */
@@ -1584,9 +1614,28 @@ static int get_int_dhcid (dhcp_ddns_cb_t
 	id->buffer->data[2] = "0123456789abcdef"[type % 15];
 
 	/* Mash together an MD5 hash of the identifier. */
-	isc_md5_init();
-	isc_md5_update(, data, len);
-	isc_md5_final(, buf);
+	md = isc_md_new();
+	if (md == NULL) {
+		return (0);
+	}
+
+	

CVS commit: src/external/mpl/dhcp

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:39:22 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Add libz for new libisc needing it.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.3 src/external/mpl/dhcp/Makefile.inc:1.4
--- src/external/mpl/dhcp/Makefile.inc:1.3	Fri Jun 22 16:48:43 2018
+++ src/external/mpl/dhcp/Makefile.inc	Sun Aug 12 11:39:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.3 2018/06/22 20:48:43 christos Exp $
+# $NetBSD: Makefile.inc,v 1.4 2018/08/12 15:39:22 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -38,7 +38,7 @@ LDADD+= ${OMOBJDIR}/libomapi.a
 LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc
-LDADD+=-lpthread
+LDADD+=-lpthread -lz
 .if (${MKKERBEROS} != "no")
 LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
 DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
@@ -54,4 +54,4 @@ LDADD+=-Wl,-Bdynamic
 DPADD+= ${COBJDIR}/libdhcp.a
 DPADD+= ${OMOBJDIR}/libomapi.a
 DPADD+=	${LIBDNS} ${LIBISC}
-DPADD+= ${LIBPTHREAD}
+DPADD+= ${LIBPTHREAD} ${LIBZ}



CVS commit: src/external/mpl/dhcp

2018-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 22 20:48:44 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Explain the -Bstatic -Bdynamic dance.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.2 src/external/mpl/dhcp/Makefile.inc:1.3
--- src/external/mpl/dhcp/Makefile.inc:1.2	Thu Jun 21 07:02:48 2018
+++ src/external/mpl/dhcp/Makefile.inc	Fri Jun 22 16:48:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.2 2018/06/21 11:02:48 kamil Exp $
+# $NetBSD: Makefile.inc,v 1.3 2018/06/22 20:48:43 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -31,6 +31,10 @@ CPPFLAGS+= -DLOCALSTATEDIR='"/var"'
 LDADD+= ${COBJDIR}/libdhcp.a
 LDADD+= ${OMOBJDIR}/libomapi.a
 .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
+# We link the libraries that are in /usr/lib and not in /lib statically
+# because dhclient is in /sbin and is needed before /usr is mounted in
+# some configurations with a split / and /usr. Another way to fix this,
+# would be to install the libraries in /lib...
 LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc



CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:02:48 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Make building of dhcp compatible with MKSANITIZER

Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/dhcp/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.1 src/external/mpl/dhcp/Makefile.inc:1.2
--- src/external/mpl/dhcp/Makefile.inc:1.1	Sat Apr  7 22:31:36 2018
+++ src/external/mpl/dhcp/Makefile.inc	Thu Jun 21 11:02:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2018/04/07 22:31:36 christos Exp $
+# $NetBSD: Makefile.inc,v 1.2 2018/06/21 11:02:48 kamil Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -30,7 +30,7 @@ CPPFLAGS+= -I${BIND}/lib/${dir}/pthreads
 CPPFLAGS+= -DLOCALSTATEDIR='"/var"'
 LDADD+= ${COBJDIR}/libdhcp.a
 LDADD+= ${OMOBJDIR}/libomapi.a
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc
@@ -39,12 +39,12 @@ LDADD+=-lpthread
 LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
 DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
 .endif
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
 LDADD+= -lcrypto -lipsec -lcrypt
 DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
 DPADD+= ${COBJDIR}/libdhcp.a



CVS commit: src/external/mpl/dhcp/dist/common

2018-05-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun  1 00:42:49 UTC 2018

Modified Files:
src/external/mpl/dhcp/dist/common: bpf.c

Log Message:
PR/50893: Bruce Lilly: Handle carp interfaces.

XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/common/bpf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/common/bpf.c
diff -u src/external/mpl/dhcp/dist/common/bpf.c:1.2 src/external/mpl/dhcp/dist/common/bpf.c:1.3
--- src/external/mpl/dhcp/dist/common/bpf.c:1.2	Sat Apr  7 18:37:29 2018
+++ src/external/mpl/dhcp/dist/common/bpf.c	Thu May 31 20:42:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.2 2018/04/07 22:37:29 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.3 2018/06/01 00:42:49 christos Exp $	*/
 
 /* bpf.c
 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: bpf.c,v 1.2 2018/04/07 22:37:29 christos Exp $");
+__RCSID("$NetBSD: bpf.c,v 1.3 2018/06/01 00:42:49 christos Exp $");
 
 #include "dhcpd.h"
 #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE)	\
@@ -674,6 +674,9 @@ get_hw_addr(const char *name, struct har
 	 */
 switch (sa->sdl_type) {
 case IFT_ETHER:
+#ifdef IFT_CARP
+		case IFT_CARP:
+#endif
 #if defined (IFT_L2VLAN)
 		case IFT_L2VLAN:
 #endif



CVS commit: src/external/mpl/dhcp

2018-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 22:34:51 UTC 2018

Modified Files:
src/external/mpl/dhcp: dhcp2netbsd

Log Message:
now mpl


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/dhcp/dhcp2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dhcp2netbsd
diff -u src/external/mpl/dhcp/dhcp2netbsd:1.1 src/external/mpl/dhcp/dhcp2netbsd:1.2
--- src/external/mpl/dhcp/dhcp2netbsd:1.1	Sat Apr  7 18:31:36 2018
+++ src/external/mpl/dhcp/dhcp2netbsd	Sat Apr  7 18:34:51 2018
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: dhcp2netbsd,v 1.1 2018/04/07 22:31:36 christos Exp $
+#	$NetBSD: dhcp2netbsd,v 1.2 2018/04/07 22:34:51 christos Exp $
 #
 # Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -97,6 +97,6 @@ done
 echo done
 
 echo You can import now.  Use the following command:
-echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/dhcp/dist ISC DHCPX_Y_Z
+echo cvs -d cvs.netbsd.org:/cvsroot import src/external/mpl/dhcp/dist ISC DHCPX_Y_Z
 
 exit 0



CVS commit: src/external/mpl/dhcp

2018-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 22:31:38 UTC 2018

Added Files:
src/external/mpl/dhcp: Makefile Makefile.inc dhcp2netbsd
src/external/mpl/dhcp/bin: Makefile Makefile.inc
src/external/mpl/dhcp/bin/client: Makefile
src/external/mpl/dhcp/bin/clientscript: Makefile dhclient-script
src/external/mpl/dhcp/bin/omshell: Makefile
src/external/mpl/dhcp/bin/relay: Makefile
src/external/mpl/dhcp/bin/server: Makefile dhcpd.conf
src/external/mpl/dhcp/include: config.h
src/external/mpl/dhcp/lib: Makefile Makefile.inc
src/external/mpl/dhcp/lib/common: Makefile
src/external/mpl/dhcp/lib/dhcpctl: Makefile
src/external/mpl/dhcp/lib/omapip: Makefile
src/external/mpl/dhcp/share: Makefile
src/external/mpl/dhcp/share/dhcpd: Makefile pxe.defs

Log Message:
Add build glue.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/Makefile \
src/external/mpl/dhcp/Makefile.inc src/external/mpl/dhcp/dhcp2netbsd
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/Makefile \
src/external/mpl/dhcp/bin/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/client/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/clientscript/Makefile \
src/external/mpl/dhcp/bin/clientscript/dhclient-script
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/omshell/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/relay/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/bin/server/Makefile \
src/external/mpl/dhcp/bin/server/dhcpd.conf
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/include/config.h
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/lib/Makefile \
src/external/mpl/dhcp/lib/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/lib/common/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/lib/dhcpctl/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/lib/omapip/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/share/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/dhcp/share/dhcpd/Makefile \
src/external/mpl/dhcp/share/dhcpd/pxe.defs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/mpl/dhcp/Makefile
diff -u /dev/null src/external/mpl/dhcp/Makefile:1.1
--- /dev/null	Sat Apr  7 18:31:38 2018
+++ src/external/mpl/dhcp/Makefile	Sat Apr  7 18:31:36 2018
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2018/04/07 22:31:36 christos Exp $
+
+SUBDIR=	lib share .WAIT bin
+
+.include 
Index: src/external/mpl/dhcp/Makefile.inc
diff -u /dev/null src/external/mpl/dhcp/Makefile.inc:1.1
--- /dev/null	Sat Apr  7 18:31:38 2018
+++ src/external/mpl/dhcp/Makefile.inc	Sat Apr  7 18:31:36 2018
@@ -0,0 +1,53 @@
+# $NetBSD: Makefile.inc,v 1.1 2018/04/07 22:31:36 christos Exp $
+
+WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
+
+.include 
+
+USE_FORT?= yes	# network client/server
+CWARNFLAGS.clang+=	-Wno-tautological-compare \
+			-Wno-conversion -Wno-constant-logical-operand \
+			-Wno-format-security -Wno-error=unused-const-variable
+
+DIST:=	${.PARSEDIR}/dist
+BIND:=	${.PARSEDIR}/../../bsd/bind/dist
+.PATH:	${DIST}/${DHCPSRCDIR}
+
+COBJDIR!=cd ${.PARSEDIR}/lib/common && ${PRINTOBJDIR}
+OMOBJDIR!=cd ${.PARSEDIR}/lib/omapip && ${PRINTOBJDIR}
+
+.if (${USE_INET6} != "no")
+CPPFLAGS+=	-DDHCPv6
+.endif
+CPPFLAGS+= -DISC_PLATFORM_USETHREADS -DHAVE_CONFIG_H
+CPPFLAGS+= -I${DIST} -I${DIST}/includes -I${DIST}/../include
+CPPFLAGS+= -I${BIND} -I${BIND}/includes -I${BIND}/../include
+.for dir in isc dns irs
+CPPFLAGS+= -I${BIND}/lib/${dir}/include
+CPPFLAGS+= -I${BIND}/lib/${dir}/unix/include
+CPPFLAGS+= -I${BIND}/lib/${dir}/pthreads/include
+.endfor
+CPPFLAGS+= -DLOCALSTATEDIR='"/var"'
+LDADD+= ${COBJDIR}/libdhcp.a
+LDADD+= ${OMOBJDIR}/libomapi.a
+.if defined(PROG) && ${PROG} == "dhclient"
+LDADD+=-Wl,-Bstatic
+.endif
+LDADD+= -lirs -lisccfg -ldns -lisc
+LDADD+=-lpthread
+.if (${MKKERBEROS} != "no")
+LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
+DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
+.endif
+.if defined(PROG) && ${PROG} == "dhclient"
+LDADD+=-Wl,-Bdynamic
+.endif
+LDADD+= -lcrypto -lipsec -lcrypt
+DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
+.if defined(PROG) && ${PROG} == "dhclient"
+LDADD+=-Wl,-Bdynamic
+.endif
+DPADD+= ${COBJDIR}/libdhcp.a
+DPADD+= ${OMOBJDIR}/libomapi.a
+DPADD+=	${LIBDNS} ${LIBISC}
+DPADD+= ${LIBPTHREAD}
Index: src/external/mpl/dhcp/dhcp2netbsd
diff -u /dev/null src/external/mpl/dhcp/dhcp2netbsd:1.1
--- /dev/null	Sat Apr  7 18:31:38 2018
+++ src/external/mpl/dhcp/dhcp2netbsd	Sat Apr  7 18:31:36 2018
@@ -0,0 +1,102 @@
+#! /bin/sh
+#
+#	$NetBSD: dhcp2netbsd,v 1.1 2018/04/07 22:31:36 christos Exp $
+#
+# Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are