sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-10-06 03:27:58 +00:00
parent 736de251f0
commit a959d2beea
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
11 changed files with 70 additions and 34 deletions

View file

@ -1,4 +1,4 @@
dnl $OpenBSD: features,v 1.3 2021/03/15 09:29:51 jsg Exp $ dnl $OpenBSD: features,v 1.4 2023/10/05 11:58:34 kn Exp $
dnl dnl
dnl This file lists almost all the conditional features of this port, dnl This file lists almost all the conditional features of this port,
dnl which are used to provide accurate installation notes. dnl which are used to provide accurate installation notes.
@ -38,3 +38,6 @@ define({:-MDXAPERTURE-:},1)dnl
dnl dnl
dnl define if the X server can start without a configuration file dnl define if the X server can start without a configuration file
define({:-MDXDM-:},1)dnl define({:-MDXDM-:},1)dnl
dnl
dnl define if boot loaders support softraid(4) volumes
define({:-MDBOOTSR-:},1)dnl

View file

@ -1,4 +1,4 @@
dnl $OpenBSD: features,v 1.4 2023/03/16 18:04:08 miod Exp $ dnl $OpenBSD: features,v 1.5 2023/10/05 11:58:34 kn Exp $
dnl dnl
dnl This file lists almost all the conditional features of this port, dnl This file lists almost all the conditional features of this port,
dnl which are used to provide accurate installation notes. dnl which are used to provide accurate installation notes.
@ -38,3 +38,6 @@ define({:-MDXAPERTURE-:},)dnl
dnl dnl
dnl define if the X server can start without a configuration file dnl define if the X server can start without a configuration file
define({:-MDXDM-:},1)dnl define({:-MDXDM-:},1)dnl
dnl
dnl define if boot loaders support softraid(4) volumes
define({:-MDBOOTSR-:},1)dnl

View file

@ -1,4 +1,4 @@
dnl $OpenBSD: features,v 1.3 2021/03/15 09:29:51 jsg Exp $ dnl $OpenBSD: features,v 1.4 2023/10/05 11:58:34 kn Exp $
dnl dnl
dnl This file lists almost all the conditional features of this port, dnl This file lists almost all the conditional features of this port,
dnl which are used to provide accurate installation notes. dnl which are used to provide accurate installation notes.
@ -38,3 +38,6 @@ define({:-MDXAPERTURE-:},)dnl
dnl dnl
dnl define if the X server can start without a configuration file dnl define if the X server can start without a configuration file
define({:-MDXDM-:},)dnl define({:-MDXDM-:},)dnl
dnl
dnl define if boot loaders support softraid(4) volumes
define({:-MDBOOTSR-:},)dnl

View file

@ -1,4 +1,4 @@
dnl $OpenBSD: features,v 1.3 2021/03/15 09:29:51 jsg Exp $ dnl $OpenBSD: features,v 1.4 2023/10/05 11:58:34 kn Exp $
dnl dnl
dnl This file lists almost all the conditional features of this port, dnl This file lists almost all the conditional features of this port,
dnl which are used to provide accurate installation notes. dnl which are used to provide accurate installation notes.
@ -38,3 +38,6 @@ define({:-MDXAPERTURE-:},1)dnl
dnl dnl
dnl define if the X server can start without a configuration file dnl define if the X server can start without a configuration file
define({:-MDXDM-:},1)dnl define({:-MDXDM-:},1)dnl
dnl
dnl define if boot loaders support softraid(4) volumes
define({:-MDBOOTSR-:},1)dnl

View file

@ -1,5 +1,5 @@
dnl dnl
dnl $OpenBSD: m4.common,v 1.135 2022/10/10 10:42:42 jsg Exp $ dnl $OpenBSD: m4.common,v 1.136 2023/10/05 11:58:34 kn Exp $
dnl dnl
dnl Copyright (c) 2004 Todd T. Fries <todd@OpenBSD.org> dnl Copyright (c) 2004 Todd T. Fries <todd@OpenBSD.org>
dnl dnl
@ -432,7 +432,11 @@ dnl install.sh ask whether to use DUIDs before the md_prep_disklabel loop
The installation program will now tell you which disks it can The installation program will now tell you which disks it can
install on, and ask you which it should use. install on, and ask you which it should use.
Reply with the name of your root disk.-:})dnl Reply with the name of your root disk.ifelse(MDBOOTSR,,,{:-
You will be given the possibility to encrypt the contents of that
disk with a passphrase.-:})dnl
-:})dnl
dnl install.sh md_prep_disklabel loop dnl install.sh md_prep_disklabel loop
dnl dnl
dnl OpenBSDInstallMBRPart1 dnl OpenBSDInstallMBRPart1

View file

@ -1 +1 @@
# SecBSD 1.4-37f6beb: Wed Oct 4 04:28:37 UTC 2023 (Tezcatlipoca) # SecBSD 1.4-7869b2f: Fri Oct 6 03:12:48 UTC 2023 (Tezcatlipoca)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1time.c,v 1.20 2023/10/02 11:14:15 tb Exp $ */ /* $OpenBSD: asn1time.c,v 1.21 2023/10/05 07:59:41 tb Exp $ */
/* /*
* Copyright (c) 2015 Joel Sing <jsing@openbsd.org> * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
* *
@ -21,6 +21,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
struct asn1_time_test { struct asn1_time_test {
const char *str; const char *str;
const char *data; const char *data;
@ -527,10 +529,15 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size,
comparison_failure |= 1; comparison_failure |= 1;
} }
/* time_cmp = ASN1_UTCTIME_cmp_time_t(t1, att2->time);
* XXX - add ASN1_UTCTIME_cmp_time_t later. Don't want if (t1->type != V_ASN1_UTCTIME)
* to mess with LIBRESSL_INTERNAL right before lock. asn1_cmp = -2;
*/ if (time_cmp != asn1_cmp) {
fprintf(stderr, "%s vs. %lld: want %d, got %d\n",
att1->str, (long long)att2->time,
asn1_cmp, time_cmp);
comparison_failure |= 1;
}
} }
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ifq.c,v 1.50 2023/07/30 05:39:52 dlg Exp $ */ /* $OpenBSD: ifq.c,v 1.51 2023/10/05 11:08:56 bluhm Exp $ */
/* /*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org> * Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@ -529,6 +529,14 @@ ifq_hdatalen(struct ifqueue *ifq)
return (len); return (len);
} }
void
ifq_set_maxlen(struct ifqueue *ifq, unsigned int maxlen)
{
mtx_enter(&ifq->ifq_mtx);
ifq->ifq_maxlen = maxlen;
mtx_leave(&ifq->ifq_mtx);
}
unsigned int unsigned int
ifq_purge(struct ifqueue *ifq) ifq_purge(struct ifqueue *ifq)
{ {

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ifq.h,v 1.38 2023/07/30 05:39:52 dlg Exp $ */ /* $OpenBSD: ifq.h,v 1.39 2023/10/05 11:08:56 bluhm Exp $ */
/* /*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org> * Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@ -435,6 +435,7 @@ void ifq_deq_commit(struct ifqueue *, struct mbuf *);
void ifq_deq_rollback(struct ifqueue *, struct mbuf *); void ifq_deq_rollback(struct ifqueue *, struct mbuf *);
struct mbuf *ifq_dequeue(struct ifqueue *); struct mbuf *ifq_dequeue(struct ifqueue *);
int ifq_hdatalen(struct ifqueue *); int ifq_hdatalen(struct ifqueue *);
void ifq_set_maxlen(struct ifqueue *, unsigned int);
void ifq_mfreem(struct ifqueue *, struct mbuf *); void ifq_mfreem(struct ifqueue *, struct mbuf *);
void ifq_mfreeml(struct ifqueue *, struct mbuf_list *); void ifq_mfreeml(struct ifqueue *, struct mbuf_list *);
unsigned int ifq_purge(struct ifqueue *); unsigned int ifq_purge(struct ifqueue *);
@ -448,9 +449,8 @@ int ifq_deq_sleep(struct ifqueue *, struct mbuf **, int, int,
const char *, volatile unsigned int *, const char *, volatile unsigned int *,
volatile unsigned int *); volatile unsigned int *);
#define ifq_len(_ifq) ((_ifq)->ifq_len) #define ifq_len(_ifq) READ_ONCE((_ifq)->ifq_len)
#define ifq_empty(_ifq) (ifq_len(_ifq) == 0) #define ifq_empty(_ifq) (ifq_len(_ifq) == 0)
#define ifq_set_maxlen(_ifq, _l) ((_ifq)->ifq_maxlen = (_l))
static inline int static inline int
ifq_is_priq(struct ifqueue *ifq) ifq_is_priq(struct ifqueue *ifq)
@ -490,8 +490,8 @@ int ifiq_input(struct ifiqueue *, struct mbuf_list *);
int ifiq_enqueue(struct ifiqueue *, struct mbuf *); int ifiq_enqueue(struct ifiqueue *, struct mbuf *);
void ifiq_add_data(struct ifiqueue *, struct if_data *); void ifiq_add_data(struct ifiqueue *, struct if_data *);
#define ifiq_len(_ifiq) ml_len(&(_ifiq)->ifiq_ml) #define ifiq_len(_ifiq) READ_ONCE(ml_len(&(_ifiq)->ifiq_ml))
#define ifiq_empty(_ifiq) ml_empty(&(_ifiq)->ifiq_ml) #define ifiq_empty(_ifiq) (ifiq_len(_ifiq) == 0)
#endif /* _KERNEL */ #endif /* _KERNEL */

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: dhcpd.8,v 1.33 2023/09/04 16:11:00 jmc Exp $ .\" $OpenBSD: dhcpd.8,v 1.34 2023/10/05 18:46:14 mvs Exp $
.\" .\"
.\" Copyright (c) 1995, 1996 The Internet Software Consortium. .\" Copyright (c) 1995, 1996 The Internet Software Consortium.
.\" All rights reserved. .\" All rights reserved.
@ -36,7 +36,7 @@
.\" see ``http://www.isc.org/''. To learn more about Vixie .\" see ``http://www.isc.org/''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''. .\" Enterprises, see ``http://www.vix.com''.
.\" .\"
.Dd $Mdocdate: September 4 2023 $ .Dd $Mdocdate: October 5 2023 $
.Dt DHCPD 8 .Dt DHCPD 8
.Os .Os
.Sh NAME .Sh NAME
@ -45,7 +45,7 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm dhcpd .Nm dhcpd
.Bk -words .Bk -words
.Op Fl dfn .Op Fl dfnv
.Op Fl A Ar abandoned_ip_table .Op Fl A Ar abandoned_ip_table
.Op Fl C Ar changed_ip_table .Op Fl C Ar changed_ip_table
.Op Fl c Ar config-file .Op Fl c Ar config-file
@ -239,6 +239,8 @@ is specified,
.Nm .Nm
will bind to that address; otherwise will bind to that address; otherwise
the limited broadcast address (255.255.255.255) is used as the default. the limited broadcast address (255.255.255.255) is used as the default.
.It Fl v
Produce more verbose output.
.It Fl Y Ar synctarget .It Fl Y Ar synctarget
Add target Add target
.Ar synctarget .Ar synctarget

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dhcpd.c,v 1.57 2019/08/06 11:07:37 krw Exp $ */ /* $OpenBSD: dhcpd.c,v 1.58 2023/10/05 18:46:14 mvs Exp $ */
/* /*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org> * Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@ -87,7 +87,8 @@ char *leased_tab = NULL;
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int ch, cftest = 0, daemonize = 1, rdomain = -1, udpsockmode = 0; int ch, cftest = 0, rdomain = -1, udpsockmode = 0;
int debug = 0, verbose = 0;
char *sync_iface = NULL; char *sync_iface = NULL;
char *sync_baddr = NULL; char *sync_baddr = NULL;
u_short sync_port = 0; u_short sync_port = 0;
@ -98,7 +99,7 @@ main(int argc, char *argv[])
log_setverbose(1); log_setverbose(1);
opterr = 0; opterr = 0;
while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::Y:y:")) != -1) while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::vY:y:")) != -1)
switch (ch) { switch (ch) {
case 'Y': case 'Y':
syncsend = 1; syncsend = 1;
@ -117,7 +118,7 @@ main(int argc, char *argv[])
udpaddr.s_addr = htonl(INADDR_BROADCAST); udpaddr.s_addr = htonl(INADDR_BROADCAST);
optreset = optind = opterr = 1; optreset = optind = opterr = 1;
while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::Y:y:")) != -1) while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::vY:y:")) != -1)
switch (ch) { switch (ch) {
case 'A': case 'A':
abandoned_tab = optarg; abandoned_tab = optarg;
@ -132,16 +133,15 @@ main(int argc, char *argv[])
path_dhcpd_conf = optarg; path_dhcpd_conf = optarg;
break; break;
case 'd': case 'd':
daemonize = 0; /* FALLTHROUGH */
break;
case 'f': case 'f':
daemonize = 0; debug = 1;
break; break;
case 'l': case 'l':
path_dhcpd_db = optarg; path_dhcpd_db = optarg;
break; break;
case 'n': case 'n':
daemonize = 0; debug = 1;
cftest = 1; cftest = 1;
break; break;
case 'u': case 'u':
@ -152,6 +152,9 @@ main(int argc, char *argv[])
"address: %s", optarg); "address: %s", optarg);
} }
break; break;
case 'v':
verbose = 1;
break;
case 'Y': case 'Y':
if (sync_addhost(optarg, sync_port) != 0) if (sync_addhost(optarg, sync_port) != 0)
sync_iface = optarg; sync_iface = optarg;
@ -206,11 +209,11 @@ main(int argc, char *argv[])
err(1, "sync init"); err(1, "sync init");
} }
if (daemonize) log_init(debug, LOG_DAEMON);
daemon(0, 0); log_setverbose(verbose);
log_init(0, LOG_DAEMON); /* stop logging to stderr */ if (!debug)
log_setverbose(0); daemon(0, 0);
if ((pw = getpwnam("_dhcp")) == NULL) if ((pw = getpwnam("_dhcp")) == NULL)
fatalx("user \"_dhcp\" not found"); fatalx("user \"_dhcp\" not found");