sync with OpenBSD -current
This commit is contained in:
parent
62f1a75fe4
commit
01dd575d45
36 changed files with 399 additions and 217 deletions
|
@ -1,12 +1,11 @@
|
||||||
# $OpenBSD: Makefile,v 1.56 2024/03/26 01:18:16 beck Exp $
|
# $OpenBSD: Makefile,v 1.57 2024/04/22 07:31:54 anton Exp $
|
||||||
|
|
||||||
SUBDIR += api
|
SUBDIR += api
|
||||||
SUBDIR += asn1
|
SUBDIR += asn1
|
||||||
SUBDIR += buffer
|
SUBDIR += buffer
|
||||||
SUBDIR += bytestring
|
SUBDIR += bytestring
|
||||||
SUBDIR += ciphers
|
SUBDIR += ciphers
|
||||||
#Disable for now for upcoming changes. This needs to be easier to deal with.
|
SUBDIR += client
|
||||||
#SUBDIR += client
|
|
||||||
SUBDIR += dtls
|
SUBDIR += dtls
|
||||||
SUBDIR += exporter
|
SUBDIR += exporter
|
||||||
SUBDIR += handshake
|
SUBDIR += handshake
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: Makefile,v 1.4 2023/04/23 18:59:41 tb Exp $
|
# $OpenBSD: Makefile,v 1.5 2024/04/22 07:31:54 anton Exp $
|
||||||
|
|
||||||
PROG= clienttest
|
PROG= clienttest
|
||||||
LDADD= ${SSL_INT} -lcrypto
|
LDADD= ${SSL_INT} -lcrypto
|
||||||
|
@ -6,4 +6,7 @@ DPADD= ${LIBSSL} ${LIBCRYPTO}
|
||||||
WARNINGS= Yes
|
WARNINGS= Yes
|
||||||
CFLAGS+= -DLIBRESSL_INTERNAL -Werror
|
CFLAGS+= -DLIBRESSL_INTERNAL -Werror
|
||||||
|
|
||||||
|
# Disable for now for upcoming changes. This needs to be easier to deal with.
|
||||||
|
REGRESS_EXPECTED_FAILURES+=run-regress-clienttest
|
||||||
|
|
||||||
.include <bsd.regress.mk>
|
.include <bsd.regress.mk>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-aspa.c,v 1.7 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-aspa.c,v 1.8 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-cert.c,v 1.23 2023/05/30 12:14:48 claudio Exp $ */
|
/* $Id: test-cert.c,v 1.24 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode;
|
int filemode;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-gbr.c,v 1.17 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-gbr.c,v 1.18 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-geofeed.c,v 1.5 2023/09/25 11:09:30 tb Exp $ */
|
/* $Id: test-geofeed.c,v 1.6 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode;
|
int filemode;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-ip.c,v 1.9 2023/05/30 12:14:48 claudio Exp $ */
|
/* $Id: test-ip.c,v 1.10 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode;
|
int filemode;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test(const char *res, uint16_t afiv, size_t sz, size_t unused, ...)
|
test(const char *res, uint16_t afiv, size_t sz, size_t unused, ...)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-mft.c,v 1.28 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-mft.c,v 1.29 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-roa.c,v 1.25 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-roa.c,v 1.26 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: test-rrdp.c,v 1.9 2024/01/08 08:26:38 tb Exp $ */
|
/* $OpenBSD: test-rrdp.c,v 1.10 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
|
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
|
||||||
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
|
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
int filemode;
|
int filemode;
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
#define REGRESS_NOTIFY_URI "https://rpki.example.com/notify.xml"
|
#define REGRESS_NOTIFY_URI "https://rpki.example.com/notify.xml"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-rsc.c,v 1.9 2023/09/25 11:09:30 tb Exp $ */
|
/* $Id: test-rsc.c,v 1.10 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode;
|
int filemode;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-spl.c,v 1.2 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-spl.c,v 1.3 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 Job Snijders <job@fastly.com>
|
* Copyright (c) 2024 Job Snijders <job@fastly.com>
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-tak.c,v 1.7 2024/03/20 04:39:10 job Exp $ */
|
/* $Id: test-tak.c,v 1.8 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
* Copyright (c) 2022 Job Snijders <job@fastly.com>
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode = 1;
|
int filemode = 1;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: test-tal.c,v 1.13 2023/06/20 12:52:32 job Exp $ */
|
/* $Id: test-tal.c,v 1.14 2024/04/22 05:54:01 claudio Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
*
|
*
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
int outformats;
|
int outformats;
|
||||||
int verbose;
|
int verbose;
|
||||||
int filemode;
|
int filemode;
|
||||||
|
int experimental;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pfctl_parser.c,v 1.350 2024/02/07 23:53:44 jsg Exp $ */
|
/* $OpenBSD: pfctl_parser.c,v 1.351 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -519,7 +519,8 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
|
||||||
const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
|
const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
|
||||||
const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
|
const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
|
||||||
const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
|
const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
|
||||||
const char *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
|
const char *pf_scounters[SCNT_MAX+1] = FCNT_NAMES;
|
||||||
|
const char *pf_ncounters[NCNT_MAX+1] = FCNT_NAMES;
|
||||||
|
|
||||||
void
|
void
|
||||||
print_status(struct pf_status *s, struct pfctl_watermarks *synflwats, int opts)
|
print_status(struct pf_status *s, struct pfctl_watermarks *synflwats, int opts)
|
||||||
|
@ -617,6 +618,20 @@ print_status(struct pf_status *s, struct pfctl_watermarks *synflwats, int opts)
|
||||||
printf("%14s\n", "");
|
printf("%14s\n", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (opts & PF_OPT_VERBOSE) {
|
||||||
|
printf("Fragments\n");
|
||||||
|
printf(" %-25s %14u %14s\n", "current entries",
|
||||||
|
s->fragments, "");
|
||||||
|
for (i = 0; i < NCNT_MAX; i++) {
|
||||||
|
printf(" %-25s %14lld ", pf_ncounters[i],
|
||||||
|
s->ncounters[i]);
|
||||||
|
if (runtime > 0)
|
||||||
|
printf("%14.1f/s\n",
|
||||||
|
(double)s->ncounters[i] / (double)runtime);
|
||||||
|
else
|
||||||
|
printf("%14s\n", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
printf("Counters\n");
|
printf("Counters\n");
|
||||||
for (i = 0; i < PFRES_MAX; i++) {
|
for (i = 0; i < PFRES_MAX; i++) {
|
||||||
printf(" %-25s %14llu ", pf_reasons[i],
|
printf(" %-25s %14llu ", pf_reasons[i],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pf_ioctl.c,v 1.415 2023/07/06 04:55:05 dlg Exp $ */
|
/* $OpenBSD: pf_ioctl.c,v 1.416 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -1955,7 +1955,9 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
|
||||||
struct pf_status *s = (struct pf_status *)addr;
|
struct pf_status *s = (struct pf_status *)addr;
|
||||||
NET_LOCK();
|
NET_LOCK();
|
||||||
PF_LOCK();
|
PF_LOCK();
|
||||||
|
PF_FRAG_LOCK();
|
||||||
memcpy(s, &pf_status, sizeof(struct pf_status));
|
memcpy(s, &pf_status, sizeof(struct pf_status));
|
||||||
|
PF_FRAG_UNLOCK();
|
||||||
pfi_update_status(s->ifname, s);
|
pfi_update_status(s->ifname, s);
|
||||||
PF_UNLOCK();
|
PF_UNLOCK();
|
||||||
NET_UNLOCK();
|
NET_UNLOCK();
|
||||||
|
@ -1996,6 +1998,9 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
|
||||||
memset(pf_status.counters, 0, sizeof(pf_status.counters));
|
memset(pf_status.counters, 0, sizeof(pf_status.counters));
|
||||||
memset(pf_status.fcounters, 0, sizeof(pf_status.fcounters));
|
memset(pf_status.fcounters, 0, sizeof(pf_status.fcounters));
|
||||||
memset(pf_status.scounters, 0, sizeof(pf_status.scounters));
|
memset(pf_status.scounters, 0, sizeof(pf_status.scounters));
|
||||||
|
PF_FRAG_LOCK();
|
||||||
|
memset(pf_status.ncounters, 0, sizeof(pf_status.ncounters));
|
||||||
|
PF_FRAG_UNLOCK();
|
||||||
pf_status.since = getuptime();
|
pf_status.since = getuptime();
|
||||||
|
|
||||||
PF_UNLOCK();
|
PF_UNLOCK();
|
||||||
|
@ -3271,7 +3276,9 @@ pf_sysctl(void *oldp, size_t *oldlenp, void *newp, size_t newlen)
|
||||||
|
|
||||||
NET_LOCK_SHARED();
|
NET_LOCK_SHARED();
|
||||||
PF_LOCK();
|
PF_LOCK();
|
||||||
|
PF_FRAG_LOCK();
|
||||||
memcpy(&pfs, &pf_status, sizeof(struct pf_status));
|
memcpy(&pfs, &pf_status, sizeof(struct pf_status));
|
||||||
|
PF_FRAG_UNLOCK();
|
||||||
pfi_update_status(pfs.ifname, &pfs);
|
pfi_update_status(pfs.ifname, &pfs);
|
||||||
PF_UNLOCK();
|
PF_UNLOCK();
|
||||||
NET_UNLOCK_SHARED();
|
NET_UNLOCK_SHARED();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pf_norm.c,v 1.229 2023/10/10 11:25:31 bluhm Exp $ */
|
/* $OpenBSD: pf_norm.c,v 1.230 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
|
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
|
||||||
|
@ -150,13 +150,10 @@ int pf_reassemble6(struct mbuf **, struct ip6_frag *,
|
||||||
/* Globals */
|
/* Globals */
|
||||||
struct pool pf_frent_pl, pf_frag_pl, pf_frnode_pl;
|
struct pool pf_frent_pl, pf_frag_pl, pf_frnode_pl;
|
||||||
struct pool pf_state_scrub_pl;
|
struct pool pf_state_scrub_pl;
|
||||||
int pf_nfrents;
|
|
||||||
|
|
||||||
struct mutex pf_frag_mtx;
|
struct mutex pf_frag_mtx;
|
||||||
|
|
||||||
#define PF_FRAG_LOCK_INIT() mtx_init(&pf_frag_mtx, IPL_SOFTNET)
|
#define PF_FRAG_LOCK_INIT() mtx_init(&pf_frag_mtx, IPL_SOFTNET)
|
||||||
#define PF_FRAG_LOCK() mtx_enter(&pf_frag_mtx)
|
|
||||||
#define PF_FRAG_UNLOCK() mtx_leave(&pf_frag_mtx)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
pf_normalize_init(void)
|
pf_normalize_init(void)
|
||||||
|
@ -233,11 +230,12 @@ void
|
||||||
pf_flush_fragments(void)
|
pf_flush_fragments(void)
|
||||||
{
|
{
|
||||||
struct pf_fragment *frag;
|
struct pf_fragment *frag;
|
||||||
int goal;
|
u_int goal;
|
||||||
|
|
||||||
goal = pf_nfrents * 9 / 10;
|
goal = pf_status.fragments * 9 / 10;
|
||||||
DPFPRINTF(LOG_NOTICE, "trying to free > %d frents", pf_nfrents - goal);
|
DPFPRINTF(LOG_NOTICE, "trying to free > %u frents",
|
||||||
while (goal < pf_nfrents) {
|
pf_status.fragments - goal);
|
||||||
|
while (goal < pf_status.fragments) {
|
||||||
if ((frag = TAILQ_LAST(&pf_fragqueue, pf_fragqueue)) == NULL)
|
if ((frag = TAILQ_LAST(&pf_fragqueue, pf_fragqueue)) == NULL)
|
||||||
break;
|
break;
|
||||||
pf_free_fragment(frag);
|
pf_free_fragment(frag);
|
||||||
|
@ -268,9 +266,10 @@ pf_free_fragment(struct pf_fragment *frag)
|
||||||
/* Free all fragment entries */
|
/* Free all fragment entries */
|
||||||
while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) {
|
while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) {
|
||||||
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
||||||
|
pf_status.ncounters[NCNT_FRAG_REMOVALS]++;
|
||||||
m_freem(frent->fe_m);
|
m_freem(frent->fe_m);
|
||||||
pool_put(&pf_frent_pl, frent);
|
pool_put(&pf_frent_pl, frent);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
}
|
}
|
||||||
pool_put(&pf_frag_pl, frag);
|
pool_put(&pf_frag_pl, frag);
|
||||||
}
|
}
|
||||||
|
@ -283,6 +282,7 @@ pf_find_fragment(struct pf_frnode *key, u_int32_t id)
|
||||||
u_int32_t stale;
|
u_int32_t stale;
|
||||||
|
|
||||||
frnode = RB_FIND(pf_frnode_tree, &pf_frnode_tree, key);
|
frnode = RB_FIND(pf_frnode_tree, &pf_frnode_tree, key);
|
||||||
|
pf_status.ncounters[NCNT_FRAG_SEARCH]++;
|
||||||
if (frnode == NULL)
|
if (frnode == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
KASSERT(frnode->fn_fragments >= 1);
|
KASSERT(frnode->fn_fragments >= 1);
|
||||||
|
@ -328,7 +328,7 @@ pf_create_fragment(u_short *reason)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pf_nfrents++;
|
pf_status.fragments++;
|
||||||
|
|
||||||
return (frent);
|
return (frent);
|
||||||
}
|
}
|
||||||
|
@ -405,6 +405,7 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent,
|
||||||
KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off);
|
KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off);
|
||||||
TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next);
|
TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next);
|
||||||
}
|
}
|
||||||
|
pf_status.ncounters[NCNT_FRAG_INSERT]++;
|
||||||
|
|
||||||
if (frag->fr_firstoff[index] == NULL) {
|
if (frag->fr_firstoff[index] == NULL) {
|
||||||
KASSERT(prev == NULL || pf_frent_index(prev) < index);
|
KASSERT(prev == NULL || pf_frent_index(prev) < index);
|
||||||
|
@ -456,6 +457,7 @@ pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent)
|
||||||
}
|
}
|
||||||
|
|
||||||
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
||||||
|
pf_status.ncounters[NCNT_FRAG_REMOVALS]++;
|
||||||
|
|
||||||
KASSERT(frag->fr_entries[index] > 0);
|
KASSERT(frag->fr_entries[index] > 0);
|
||||||
frag->fr_entries[index]--;
|
frag->fr_entries[index]--;
|
||||||
|
@ -689,7 +691,7 @@ pf_fillup_fragment(struct pf_frnode *key, u_int32_t id,
|
||||||
"fragment requeue limit exceeded");
|
"fragment requeue limit exceeded");
|
||||||
m_freem(after->fe_m);
|
m_freem(after->fe_m);
|
||||||
pool_put(&pf_frent_pl, after);
|
pool_put(&pf_frent_pl, after);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
/* There is not way to recover */
|
/* There is not way to recover */
|
||||||
goto free_fragment;
|
goto free_fragment;
|
||||||
}
|
}
|
||||||
|
@ -703,7 +705,7 @@ pf_fillup_fragment(struct pf_frnode *key, u_int32_t id,
|
||||||
pf_frent_remove(frag, after);
|
pf_frent_remove(frag, after);
|
||||||
m_freem(after->fe_m);
|
m_freem(after->fe_m);
|
||||||
pool_put(&pf_frent_pl, after);
|
pool_put(&pf_frent_pl, after);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If part of the queue gets too long, there is not way to recover. */
|
/* If part of the queue gets too long, there is not way to recover. */
|
||||||
|
@ -730,7 +732,7 @@ bad_fragment:
|
||||||
REASON_SET(reason, PFRES_FRAG);
|
REASON_SET(reason, PFRES_FRAG);
|
||||||
drop_fragment:
|
drop_fragment:
|
||||||
pool_put(&pf_frent_pl, frent);
|
pool_put(&pf_frent_pl, frent);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -742,6 +744,7 @@ pf_join_fragment(struct pf_fragment *frag)
|
||||||
|
|
||||||
frent = TAILQ_FIRST(&frag->fr_queue);
|
frent = TAILQ_FIRST(&frag->fr_queue);
|
||||||
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
||||||
|
pf_status.ncounters[NCNT_FRAG_REMOVALS]++;
|
||||||
|
|
||||||
m = frent->fe_m;
|
m = frent->fe_m;
|
||||||
/* Strip off any trailing bytes */
|
/* Strip off any trailing bytes */
|
||||||
|
@ -752,10 +755,11 @@ pf_join_fragment(struct pf_fragment *frag)
|
||||||
m->m_next = NULL;
|
m->m_next = NULL;
|
||||||
m_cat(m, m2);
|
m_cat(m, m2);
|
||||||
pool_put(&pf_frent_pl, frent);
|
pool_put(&pf_frent_pl, frent);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
|
|
||||||
while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) {
|
while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) {
|
||||||
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
|
||||||
|
pf_status.ncounters[NCNT_FRAG_REMOVALS]++;
|
||||||
m2 = frent->fe_m;
|
m2 = frent->fe_m;
|
||||||
/* Strip off ip header */
|
/* Strip off ip header */
|
||||||
m_adj(m2, frent->fe_hdrlen);
|
m_adj(m2, frent->fe_hdrlen);
|
||||||
|
@ -763,7 +767,7 @@ pf_join_fragment(struct pf_fragment *frag)
|
||||||
if (frent->fe_len < m2->m_pkthdr.len)
|
if (frent->fe_len < m2->m_pkthdr.len)
|
||||||
m_adj(m2, frent->fe_len - m2->m_pkthdr.len);
|
m_adj(m2, frent->fe_len - m2->m_pkthdr.len);
|
||||||
pool_put(&pf_frent_pl, frent);
|
pool_put(&pf_frent_pl, frent);
|
||||||
pf_nfrents--;
|
pf_status.fragments--;
|
||||||
m_removehdr(m2);
|
m_removehdr(m2);
|
||||||
m_cat(m, m2);
|
m_cat(m, m2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pfvar.h,v 1.535 2024/01/01 22:16:51 bluhm Exp $ */
|
/* $OpenBSD: pfvar.h,v 1.536 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -1192,6 +1192,11 @@ enum pfi_kif_refs {
|
||||||
#define SCNT_SRC_NODE_REMOVALS 2
|
#define SCNT_SRC_NODE_REMOVALS 2
|
||||||
#define SCNT_MAX 3
|
#define SCNT_MAX 3
|
||||||
|
|
||||||
|
#define NCNT_FRAG_SEARCH 0
|
||||||
|
#define NCNT_FRAG_INSERT 1
|
||||||
|
#define NCNT_FRAG_REMOVALS 2
|
||||||
|
#define NCNT_MAX 3
|
||||||
|
|
||||||
#define REASON_SET(a, x) \
|
#define REASON_SET(a, x) \
|
||||||
do { \
|
do { \
|
||||||
if ((void *)(a) != NULL) { \
|
if ((void *)(a) != NULL) { \
|
||||||
|
@ -1206,6 +1211,7 @@ struct pf_status {
|
||||||
u_int64_t lcounters[LCNT_MAX]; /* limit counters */
|
u_int64_t lcounters[LCNT_MAX]; /* limit counters */
|
||||||
u_int64_t fcounters[FCNT_MAX];
|
u_int64_t fcounters[FCNT_MAX];
|
||||||
u_int64_t scounters[SCNT_MAX];
|
u_int64_t scounters[SCNT_MAX];
|
||||||
|
u_int64_t ncounters[NCNT_MAX];
|
||||||
u_int64_t pcounters[2][2][3];
|
u_int64_t pcounters[2][2][3];
|
||||||
u_int64_t bcounters[2][2];
|
u_int64_t bcounters[2][2];
|
||||||
u_int64_t stateid;
|
u_int64_t stateid;
|
||||||
|
@ -1215,6 +1221,7 @@ struct pf_status {
|
||||||
u_int32_t states;
|
u_int32_t states;
|
||||||
u_int32_t states_halfopen;
|
u_int32_t states_halfopen;
|
||||||
u_int32_t src_nodes;
|
u_int32_t src_nodes;
|
||||||
|
u_int32_t fragments;
|
||||||
u_int32_t debug;
|
u_int32_t debug;
|
||||||
u_int32_t hostid;
|
u_int32_t hostid;
|
||||||
u_int32_t reass; /* reassembly */
|
u_int32_t reass; /* reassembly */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pfvar_priv.h,v 1.35 2024/01/01 22:16:51 bluhm Exp $ */
|
/* $OpenBSD: pfvar_priv.h,v 1.36 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -370,6 +370,7 @@ void pf_state_unref(struct pf_state *);
|
||||||
|
|
||||||
extern struct rwlock pf_lock;
|
extern struct rwlock pf_lock;
|
||||||
extern struct rwlock pf_state_lock;
|
extern struct rwlock pf_state_lock;
|
||||||
|
extern struct mutex pf_frag_mtx;
|
||||||
extern struct mutex pf_inp_mtx;
|
extern struct mutex pf_inp_mtx;
|
||||||
|
|
||||||
#define PF_LOCK() do { \
|
#define PF_LOCK() do { \
|
||||||
|
@ -415,6 +416,9 @@ extern struct mutex pf_inp_mtx;
|
||||||
rw_status(&pf_state_lock), __func__);\
|
rw_status(&pf_state_lock), __func__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define PF_FRAG_LOCK() mtx_enter(&pf_frag_mtx)
|
||||||
|
#define PF_FRAG_UNLOCK() mtx_leave(&pf_frag_mtx)
|
||||||
|
|
||||||
/* for copies to/from network byte order */
|
/* for copies to/from network byte order */
|
||||||
void pf_state_peer_hton(const struct pf_state_peer *,
|
void pf_state_peer_hton(const struct pf_state_peer *,
|
||||||
struct pfsync_state_peer *);
|
struct pfsync_state_peer *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dsp.c,v 1.19 2024/03/20 08:42:11 ratchov Exp $ */
|
/* $OpenBSD: dsp.c,v 1.20 2024/04/22 12:32:51 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -19,23 +19,38 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
const int aparams_ctltovol[128] = {
|
const int aparams_ctltovol[128] = {
|
||||||
0,
|
0, 65536, 68109, 70783,
|
||||||
256, 266, 276, 287, 299, 310, 323, 335,
|
73562, 76450, 79451, 82570,
|
||||||
348, 362, 376, 391, 406, 422, 439, 456,
|
85812, 89181, 92682, 96321,
|
||||||
474, 493, 512, 532, 553, 575, 597, 621,
|
100102, 104032, 108116, 112361,
|
||||||
645, 670, 697, 724, 753, 782, 813, 845,
|
116772, 121356, 126121, 131072,
|
||||||
878, 912, 948, 985, 1024, 1064, 1106, 1149,
|
136218, 141566, 147123, 152899,
|
||||||
1195, 1241, 1290, 1341, 1393, 1448, 1505, 1564,
|
158902, 165140, 171624, 178361,
|
||||||
1625, 1689, 1756, 1825, 1896, 1971, 2048, 2128,
|
185364, 192641, 200204, 208064,
|
||||||
2212, 2299, 2389, 2483, 2580, 2682, 2787, 2896,
|
216232, 224721, 233544, 242713,
|
||||||
3010, 3128, 3251, 3379, 3511, 3649, 3792, 3941,
|
252241, 262144, 272436, 283131,
|
||||||
4096, 4257, 4424, 4598, 4778, 4966, 5161, 5363,
|
294247, 305799, 317804, 330281,
|
||||||
5574, 5793, 6020, 6256, 6502, 6757, 7023, 7298,
|
343247, 356723, 370728, 385282,
|
||||||
7585, 7883, 8192, 8514, 8848, 9195, 9556, 9931,
|
400408, 416128, 432465, 449443,
|
||||||
10321, 10726, 11148, 11585, 12040, 12513, 13004, 13515,
|
467088, 485425, 504482, 524288,
|
||||||
14045, 14596, 15170, 15765, 16384, 17027, 17696, 18390,
|
544871, 566262, 588493, 611597,
|
||||||
19112, 19863, 20643, 21453, 22295, 23170, 24080, 25025,
|
635608, 660561, 686495, 713446,
|
||||||
26008, 27029, 28090, 29193, 30339, 31530, 32768
|
741455, 770564, 800816, 832255,
|
||||||
|
864929, 898885, 934175, 970850,
|
||||||
|
1008965, 1048576, 1089742, 1132525,
|
||||||
|
1176987, 1223194, 1271216, 1321123,
|
||||||
|
1372989, 1426892, 1482910, 1541128,
|
||||||
|
1601632, 1664511, 1729858, 1797771,
|
||||||
|
1868350, 1941700, 2017930, 2097152,
|
||||||
|
2179485, 2265049, 2353974, 2446389,
|
||||||
|
2542432, 2642246, 2745978, 2853783,
|
||||||
|
2965821, 3082257, 3203264, 3329021,
|
||||||
|
3459716, 3595542, 3736700, 3883400,
|
||||||
|
4035859, 4194304, 4358969, 4530099,
|
||||||
|
4707947, 4892777, 5084864, 5284492,
|
||||||
|
5491957, 5707567, 5931642, 6164513,
|
||||||
|
6406527, 6658043, 6919432, 7191084,
|
||||||
|
7473400, 7766800, 8071719, 8388608
|
||||||
};
|
};
|
||||||
|
|
||||||
const short dec_ulawmap[256] = {
|
const short dec_ulawmap[256] = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dsp.h,v 1.10 2022/12/26 19:16:00 jmc Exp $ */
|
/* $OpenBSD: dsp.h,v 1.12 2024/04/22 12:32:51 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -74,9 +74,9 @@ typedef int adata_t;
|
||||||
struct aparams {
|
struct aparams {
|
||||||
unsigned int bps; /* bytes per sample */
|
unsigned int bps; /* bytes per sample */
|
||||||
unsigned int bits; /* actually used bits */
|
unsigned int bits; /* actually used bits */
|
||||||
unsigned int le; /* 1 if little endian, 0 if big endian */
|
unsigned int le; /* 1 if little endian, else be */
|
||||||
unsigned int sig; /* 1 if signed, 0 if unsigned */
|
unsigned int sig; /* 1 if signed, 0 if unsigned */
|
||||||
unsigned int msb; /* 1 if msb justified, 0 if lsb justified */
|
unsigned int msb; /* 1 if msb justified, else lsb */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct resamp {
|
struct resamp {
|
||||||
|
@ -93,7 +93,7 @@ struct conv {
|
||||||
int bfirst; /* bytes to skip at startup */
|
int bfirst; /* bytes to skip at startup */
|
||||||
unsigned int bps; /* bytes per sample */
|
unsigned int bps; /* bytes per sample */
|
||||||
unsigned int shift; /* shift to get 32bit MSB */
|
unsigned int shift; /* shift to get 32bit MSB */
|
||||||
unsigned int bias; /* bias of unsigned samples */
|
unsigned int bias; /* bias of unsigned samples */
|
||||||
int bnext; /* to reach the next byte */
|
int bnext; /* to reach the next byte */
|
||||||
int snext; /* to reach the next sample */
|
int snext; /* to reach the next sample */
|
||||||
int nch;
|
int nch;
|
||||||
|
@ -107,7 +107,7 @@ struct cmap {
|
||||||
int nch;
|
int nch;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MIDI_TO_ADATA(m) (aparams_ctltovol[m] << (ADATA_BITS - 16))
|
#define MIDI_TO_ADATA(m) (aparams_ctltovol[m])
|
||||||
extern const int aparams_ctltovol[128];
|
extern const int aparams_ctltovol[128];
|
||||||
|
|
||||||
void aparams_init(struct aparams *);
|
void aparams_init(struct aparams *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.\" $OpenBSD: newsyslog.8,v 1.54 2017/07/20 18:39:16 jca Exp $
|
.\" $OpenBSD: newsyslog.8,v 1.55 2024/04/22 14:16:14 jmc Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1997, Jason Downs. All rights reserved.
|
.\" Copyright (c) 1997, Jason Downs. All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
.\" the suitability of this software for any purpose. It is
|
.\" the suitability of this software for any purpose. It is
|
||||||
.\" provided "as is" without express or implied warranty.
|
.\" provided "as is" without express or implied warranty.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: July 20 2017 $
|
.Dd $Mdocdate: April 22 2024 $
|
||||||
.Dt NEWSYSLOG 8
|
.Dt NEWSYSLOG 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -399,7 +399,7 @@ signal (usually
|
||||||
to instead of
|
to instead of
|
||||||
.Pa /var/run/syslog.pid .
|
.Pa /var/run/syslog.pid .
|
||||||
.It Ar signal
|
.It Ar signal
|
||||||
Specify the signal to send to the process instead of
|
This optional field specifies the signal to send to the process instead of
|
||||||
.Dv SIGHUP .
|
.Dv SIGHUP .
|
||||||
Signal names
|
Signal names
|
||||||
must start with
|
must start with
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: newsyslog.c,v 1.113 2023/03/08 04:43:12 guenther Exp $ */
|
/* $OpenBSD: newsyslog.c,v 1.114 2024/04/22 14:20:35 millert Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2002, 2003 Todd C. Miller <millert@openbsd.org>
|
* Copyright (c) 1999, 2002, 2003 Todd C. Miller <millert@openbsd.org>
|
||||||
|
@ -616,7 +616,7 @@ nextline:
|
||||||
|
|
||||||
q = sob(++parse); /* Optional field */
|
q = sob(++parse); /* Optional field */
|
||||||
if (*q == 'Z' || *q == 'z' || *q == 'B' || *q == 'b' ||
|
if (*q == 'Z' || *q == 'z' || *q == 'B' || *q == 'b' ||
|
||||||
*q == 'M' || *q == 'm') {
|
*q == 'M' || *q == 'm' || *q == 'F' || *q == 'f') {
|
||||||
*(parse = son(q)) = '\0';
|
*(parse = son(q)) = '\0';
|
||||||
while (*q) {
|
while (*q) {
|
||||||
switch (*q) {
|
switch (*q) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: sndioctl.c,v 1.19 2023/01/31 21:38:01 ratchov Exp $ */
|
/* $OpenBSD: sndioctl.c,v 1.20 2024/04/22 10:49:01 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -879,12 +879,7 @@ ondesc(void *arg, struct sioctl_desc *d, int curval)
|
||||||
*/
|
*/
|
||||||
for (pi = &infolist; (i = *pi) != NULL; pi = &i->next) {
|
for (pi = &infolist; (i = *pi) != NULL; pi = &i->next) {
|
||||||
cmp = cmpdesc(d, &i->desc);
|
cmp = cmpdesc(d, &i->desc);
|
||||||
if (cmp == 0) {
|
if (cmp <= 0)
|
||||||
fprintf(stderr, "fatal: duplicate control:\n");
|
|
||||||
print_ent(i, "duplicate");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (cmp < 0)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i = malloc(sizeof(struct info));
|
i = malloc(sizeof(struct info));
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dev.c,v 1.108 2024/04/02 05:21:32 ratchov Exp $ */
|
/* $OpenBSD: dev.c,v 1.112 2024/04/22 11:01:02 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -41,8 +41,6 @@ void dev_sub_bcopy(struct dev *, struct slot *);
|
||||||
void dev_onmove(struct dev *, int);
|
void dev_onmove(struct dev *, int);
|
||||||
void dev_master(struct dev *, unsigned int);
|
void dev_master(struct dev *, unsigned int);
|
||||||
void dev_cycle(struct dev *);
|
void dev_cycle(struct dev *);
|
||||||
struct dev *dev_new(char *, struct aparams *, unsigned int, unsigned int,
|
|
||||||
unsigned int, unsigned int, unsigned int, unsigned int);
|
|
||||||
void dev_adjpar(struct dev *, int, int, int);
|
void dev_adjpar(struct dev *, int, int, int);
|
||||||
int dev_allocbufs(struct dev *);
|
int dev_allocbufs(struct dev *);
|
||||||
void dev_freebufs(struct dev *);
|
void dev_freebufs(struct dev *);
|
||||||
|
@ -519,7 +517,8 @@ dev_mix_badd(struct dev *d, struct slot *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->mix.resampbuf) {
|
if (s->mix.resampbuf) {
|
||||||
resamp_do(&s->mix.resamp, in, s->mix.resampbuf, s->round);
|
resamp_do(&s->mix.resamp,
|
||||||
|
in, s->mix.resampbuf, s->round, d->round);
|
||||||
in = s->mix.resampbuf;
|
in = s->mix.resampbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,7 +655,7 @@ dev_sub_bcopy(struct dev *d, struct slot *s)
|
||||||
|
|
||||||
if (s->sub.resampbuf) {
|
if (s->sub.resampbuf) {
|
||||||
resamp_do(&s->sub.resamp,
|
resamp_do(&s->sub.resamp,
|
||||||
s->sub.resampbuf, resamp_out, d->round);
|
s->sub.resampbuf, resamp_out, d->round, s->round);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->sub.encbuf)
|
if (s->sub.encbuf)
|
||||||
|
@ -2340,6 +2339,8 @@ ctlslot_update(struct ctlslot *s)
|
||||||
/* if control is hidden */
|
/* if control is hidden */
|
||||||
c->desc_mask |= s->self;
|
c->desc_mask |= s->self;
|
||||||
}
|
}
|
||||||
|
if (s->ops)
|
||||||
|
s->ops->sync(s->arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2553,6 +2554,7 @@ ctl_update(struct ctl *c)
|
||||||
c->refs_mask |= s->self;
|
c->refs_mask |= s->self;
|
||||||
/* if control is hidden */
|
/* if control is hidden */
|
||||||
c->desc_mask |= s->self;
|
c->desc_mask |= s->self;
|
||||||
|
s->ops->sync(s->arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2601,16 +2603,18 @@ ctl_onval(int scope, void *arg0, void *arg1, int val)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
ctl_del(int scope, void *arg0, void *arg1)
|
ctl_del(int scope, void *arg0, void *arg1)
|
||||||
{
|
{
|
||||||
struct ctl *c, **pc;
|
struct ctl *c, **pc;
|
||||||
|
int found;
|
||||||
|
|
||||||
|
found = 0;
|
||||||
pc = &ctl_list;
|
pc = &ctl_list;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
c = *pc;
|
c = *pc;
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
return;
|
return found;
|
||||||
if (ctl_match(c, scope, arg0, arg1)) {
|
if (ctl_match(c, scope, arg0, arg1)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (log_level >= 2) {
|
if (log_level >= 2) {
|
||||||
|
@ -2618,6 +2622,7 @@ ctl_del(int scope, void *arg0, void *arg1)
|
||||||
log_puts(": removed\n");
|
log_puts(": removed\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
found++;
|
||||||
c->refs_mask &= ~CTL_DEVMASK;
|
c->refs_mask &= ~CTL_DEVMASK;
|
||||||
if (c->refs_mask == 0) {
|
if (c->refs_mask == 0) {
|
||||||
*pc = c->next;
|
*pc = c->next;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dev.h,v 1.43 2022/12/26 19:16:03 jmc Exp $ */
|
/* $OpenBSD: dev.h,v 1.44 2024/04/22 10:39:51 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -352,7 +352,7 @@ void slot_detach(struct slot *);
|
||||||
|
|
||||||
struct ctl *ctl_new(int, void *, void *,
|
struct ctl *ctl_new(int, void *, void *,
|
||||||
int, char *, char *, int, char *, char *, int, int, int);
|
int, char *, char *, int, char *, char *, int, int, int);
|
||||||
void ctl_del(int, void *, void *);
|
int ctl_del(int, void *, void *);
|
||||||
void ctl_log(struct ctl *);
|
void ctl_log(struct ctl *);
|
||||||
int ctl_setval(struct ctl *c, int val);
|
int ctl_setval(struct ctl *c, int val);
|
||||||
int ctl_match(struct ctl *, int, void *, void *);
|
int ctl_match(struct ctl *, int, void *, void *);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dev_sioctl.c,v 1.7 2021/03/03 10:00:27 ratchov Exp $ */
|
/* $OpenBSD: dev_sioctl.c,v 1.8 2024/04/22 10:43:55 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -81,20 +81,26 @@ dev_sioctl_onval(void *arg, unsigned int addr, unsigned int val)
|
||||||
struct dev *d = arg;
|
struct dev *d = arg;
|
||||||
struct ctl *c;
|
struct ctl *c;
|
||||||
|
|
||||||
dev_log(d);
|
if (log_level >= 2) {
|
||||||
log_puts(": onctl: addr = ");
|
dev_log(d);
|
||||||
log_putu(addr);
|
log_puts(": onctl: addr = ");
|
||||||
log_puts(", val = ");
|
log_putu(addr);
|
||||||
log_putu(val);
|
log_puts(", val = ");
|
||||||
log_puts("\n");
|
log_putu(val);
|
||||||
|
log_puts("\n");
|
||||||
|
}
|
||||||
|
|
||||||
for (c = ctl_list; c != NULL; c = c->next) {
|
for (c = ctl_list; c != NULL; c = c->next) {
|
||||||
if (c->scope != CTL_HW || c->u.hw.addr != addr)
|
if (c->scope != CTL_HW || c->u.hw.addr != addr)
|
||||||
continue;
|
continue;
|
||||||
ctl_log(c);
|
|
||||||
log_puts(": new value -> ");
|
if (log_level >= 2) {
|
||||||
log_putu(val);
|
ctl_log(c);
|
||||||
log_puts("\n");
|
log_puts(": new value -> ");
|
||||||
|
log_putu(val);
|
||||||
|
log_puts("\n");
|
||||||
|
}
|
||||||
|
|
||||||
c->val_mask = ~0U;
|
c->val_mask = ~0U;
|
||||||
c->curval = val;
|
c->curval = val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dsp.c,v 1.18 2021/07/05 08:29:59 ratchov Exp $ */
|
/* $OpenBSD: dsp.c,v 1.21 2024/04/22 14:11:35 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -19,23 +19,38 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
const int aparams_ctltovol[128] = {
|
const int aparams_ctltovol[128] = {
|
||||||
0,
|
0, 65536, 68109, 70783,
|
||||||
256, 266, 276, 287, 299, 310, 323, 335,
|
73562, 76450, 79451, 82570,
|
||||||
348, 362, 376, 391, 406, 422, 439, 456,
|
85812, 89181, 92682, 96321,
|
||||||
474, 493, 512, 532, 553, 575, 597, 621,
|
100102, 104032, 108116, 112361,
|
||||||
645, 670, 697, 724, 753, 782, 813, 845,
|
116772, 121356, 126121, 131072,
|
||||||
878, 912, 948, 985, 1024, 1064, 1106, 1149,
|
136218, 141566, 147123, 152899,
|
||||||
1195, 1241, 1290, 1341, 1393, 1448, 1505, 1564,
|
158902, 165140, 171624, 178361,
|
||||||
1625, 1689, 1756, 1825, 1896, 1971, 2048, 2128,
|
185364, 192641, 200204, 208064,
|
||||||
2212, 2299, 2389, 2483, 2580, 2682, 2787, 2896,
|
216232, 224721, 233544, 242713,
|
||||||
3010, 3128, 3251, 3379, 3511, 3649, 3792, 3941,
|
252241, 262144, 272436, 283131,
|
||||||
4096, 4257, 4424, 4598, 4778, 4966, 5161, 5363,
|
294247, 305799, 317804, 330281,
|
||||||
5574, 5793, 6020, 6256, 6502, 6757, 7023, 7298,
|
343247, 356723, 370728, 385282,
|
||||||
7585, 7883, 8192, 8514, 8848, 9195, 9556, 9931,
|
400408, 416128, 432465, 449443,
|
||||||
10321, 10726, 11148, 11585, 12040, 12513, 13004, 13515,
|
467088, 485425, 504482, 524288,
|
||||||
14045, 14596, 15170, 15765, 16384, 17027, 17696, 18390,
|
544871, 566262, 588493, 611597,
|
||||||
19112, 19863, 20643, 21453, 22295, 23170, 24080, 25025,
|
635608, 660561, 686495, 713446,
|
||||||
26008, 27029, 28090, 29193, 30339, 31530, 32768
|
741455, 770564, 800816, 832255,
|
||||||
|
864929, 898885, 934175, 970850,
|
||||||
|
1008965, 1048576, 1089742, 1132525,
|
||||||
|
1176987, 1223194, 1271216, 1321123,
|
||||||
|
1372989, 1426892, 1482910, 1541128,
|
||||||
|
1601632, 1664511, 1729858, 1797771,
|
||||||
|
1868350, 1941700, 2017930, 2097152,
|
||||||
|
2179485, 2265049, 2353974, 2446389,
|
||||||
|
2542432, 2642246, 2745978, 2853783,
|
||||||
|
2965821, 3082257, 3203264, 3329021,
|
||||||
|
3459716, 3595542, 3736700, 3883400,
|
||||||
|
4035859, 4194304, 4358969, 4530099,
|
||||||
|
4707947, 4892777, 5084864, 5284492,
|
||||||
|
5491957, 5707567, 5931642, 6164513,
|
||||||
|
6406527, 6658043, 6919432, 7191084,
|
||||||
|
7473400, 7766800, 8071719, 8388608
|
||||||
};
|
};
|
||||||
|
|
||||||
const int resamp_filt[RESAMP_LENGTH / RESAMP_STEP + 1] = {
|
const int resamp_filt[RESAMP_LENGTH / RESAMP_STEP + 1] = {
|
||||||
|
@ -269,30 +284,50 @@ aparams_native(struct aparams *par)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* resample the given number of frames
|
* Return the number of input and output frame that would be consumed
|
||||||
|
* by resamp_do(p, *icnt, *ocnt).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
resamp_do(struct resamp *p, adata_t *in, adata_t *out, int todo)
|
resamp_getcnt(struct resamp *p, int *icnt, int *ocnt)
|
||||||
|
{
|
||||||
|
long long idiff, odiff;
|
||||||
|
int cdiff;
|
||||||
|
|
||||||
|
cdiff = p->oblksz - p->diff;
|
||||||
|
idiff = (long long)*icnt * p->oblksz;
|
||||||
|
odiff = (long long)*ocnt * p->iblksz;
|
||||||
|
if (odiff - idiff >= cdiff)
|
||||||
|
*ocnt = (idiff + cdiff + p->iblksz - 1) / p->iblksz;
|
||||||
|
else
|
||||||
|
*icnt = (odiff + p->diff) / p->oblksz;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Resample the given number of frames. The number of output frames
|
||||||
|
* must match the corresponding number of input frames. Either always
|
||||||
|
* use icnt and ocnt such that:
|
||||||
|
*
|
||||||
|
* icnt * oblksz = ocnt * iblksz
|
||||||
|
*
|
||||||
|
* or use resamp_getcnt() to calculate the proper numbers.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
resamp_do(struct resamp *p, adata_t *in, adata_t *out, int icnt, int ocnt)
|
||||||
{
|
{
|
||||||
unsigned int nch;
|
unsigned int nch;
|
||||||
adata_t *idata;
|
adata_t *idata;
|
||||||
unsigned int oblksz;
|
unsigned int oblksz;
|
||||||
|
unsigned int ifr;
|
||||||
int s, ds, diff;
|
int s, ds, diff;
|
||||||
adata_t *odata;
|
adata_t *odata;
|
||||||
unsigned int iblksz;
|
unsigned int iblksz;
|
||||||
|
unsigned int ofr;
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
int64_t f[NCHAN_MAX];
|
int64_t f[NCHAN_MAX];
|
||||||
adata_t *ctxbuf, *ctx;
|
adata_t *ctxbuf, *ctx;
|
||||||
unsigned int ctx_start;
|
unsigned int ctx_start;
|
||||||
int q, qi, qf, n;
|
int q, qi, qf, n;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
if (todo % p->iblksz != 0) {
|
|
||||||
log_puts("resamp_do: partial blocks not supported\n");
|
|
||||||
panic();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Partially copy structures into local variables, to avoid
|
* Partially copy structures into local variables, to avoid
|
||||||
* unnecessary indirections; this also allows the compiler to
|
* unnecessary indirections; this also allows the compiler to
|
||||||
|
@ -300,16 +335,32 @@ resamp_do(struct resamp *p, adata_t *in, adata_t *out, int todo)
|
||||||
*/
|
*/
|
||||||
idata = in;
|
idata = in;
|
||||||
odata = out;
|
odata = out;
|
||||||
diff = p->oblksz;
|
diff = p->diff;
|
||||||
iblksz = p->iblksz;
|
iblksz = p->iblksz;
|
||||||
oblksz = p->oblksz;
|
oblksz = p->oblksz;
|
||||||
ctxbuf = p->ctx;
|
ctxbuf = p->ctx;
|
||||||
ctx_start = p->ctx_start;
|
ctx_start = p->ctx_start;
|
||||||
nch = p->nch;
|
nch = p->nch;
|
||||||
|
ifr = icnt;
|
||||||
|
ofr = ocnt;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Start conversion.
|
||||||
|
*/
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (log_level >= 4) {
|
||||||
|
log_puts("resamp: copying ");
|
||||||
|
log_puti(ifr);
|
||||||
|
log_puts(" -> ");
|
||||||
|
log_putu(ofr);
|
||||||
|
log_puts(" frames, diff = ");
|
||||||
|
log_puti(diff);
|
||||||
|
log_puts("\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (diff >= oblksz) {
|
if (diff >= oblksz) {
|
||||||
if (todo == 0)
|
if (ifr == 0)
|
||||||
break;
|
break;
|
||||||
ctx_start = (ctx_start - 1) & (RESAMP_NCTX - 1);
|
ctx_start = (ctx_start - 1) & (RESAMP_NCTX - 1);
|
||||||
ctx = ctxbuf + ctx_start;
|
ctx = ctxbuf + ctx_start;
|
||||||
|
@ -318,8 +369,10 @@ resamp_do(struct resamp *p, adata_t *in, adata_t *out, int todo)
|
||||||
ctx += RESAMP_NCTX;
|
ctx += RESAMP_NCTX;
|
||||||
}
|
}
|
||||||
diff -= oblksz;
|
diff -= oblksz;
|
||||||
todo--;
|
ifr--;
|
||||||
} else {
|
} else {
|
||||||
|
if (ofr == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
for (c = 0; c < nch; c++)
|
for (c = 0; c < nch; c++)
|
||||||
f[c] = 0;
|
f[c] = 0;
|
||||||
|
@ -361,11 +414,40 @@ resamp_do(struct resamp *p, adata_t *in, adata_t *out, int todo)
|
||||||
#endif
|
#endif
|
||||||
*odata++ = s;
|
*odata++ = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff += iblksz;
|
diff += iblksz;
|
||||||
|
ofr--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p->diff = diff;
|
||||||
p->ctx_start = ctx_start;
|
p->ctx_start = ctx_start;
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (ifr != 0) {
|
||||||
|
log_puts("resamp_do: ");
|
||||||
|
log_puti(ifr);
|
||||||
|
log_puts(": too many input frames\n");
|
||||||
|
panic();
|
||||||
|
}
|
||||||
|
if (ofr != 0) {
|
||||||
|
log_puts("resamp_do: ");
|
||||||
|
log_puti(ofr);
|
||||||
|
log_puts(": too many output frames\n");
|
||||||
|
panic();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned int
|
||||||
|
uint_gcd(unsigned int a, unsigned int b)
|
||||||
|
{
|
||||||
|
unsigned int r;
|
||||||
|
|
||||||
|
while (b > 0) {
|
||||||
|
r = a % b;
|
||||||
|
a = b;
|
||||||
|
b = r;
|
||||||
|
}
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -375,8 +457,26 @@ void
|
||||||
resamp_init(struct resamp *p, unsigned int iblksz,
|
resamp_init(struct resamp *p, unsigned int iblksz,
|
||||||
unsigned int oblksz, int nch)
|
unsigned int oblksz, int nch)
|
||||||
{
|
{
|
||||||
|
unsigned int g;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* reduce iblksz/oblksz fraction
|
||||||
|
*/
|
||||||
|
g = uint_gcd(iblksz, oblksz);
|
||||||
|
iblksz /= g;
|
||||||
|
oblksz /= g;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ensure weird rates don't cause integer overflow
|
||||||
|
*/
|
||||||
|
while (iblksz > ADATA_UNIT || oblksz > ADATA_UNIT) {
|
||||||
|
iblksz >>= 1;
|
||||||
|
oblksz >>= 1;
|
||||||
|
}
|
||||||
|
|
||||||
p->iblksz = iblksz;
|
p->iblksz = iblksz;
|
||||||
p->oblksz = oblksz;
|
p->oblksz = oblksz;
|
||||||
|
p->diff = 0;
|
||||||
p->nch = nch;
|
p->nch = nch;
|
||||||
p->ctx_start = 0;
|
p->ctx_start = 0;
|
||||||
memset(p->ctx, 0, sizeof(p->ctx));
|
memset(p->ctx, 0, sizeof(p->ctx));
|
||||||
|
@ -734,33 +834,35 @@ cmap_init(struct cmap *p,
|
||||||
int imin, int imax, int isubmin, int isubmax,
|
int imin, int imax, int isubmin, int isubmax,
|
||||||
int omin, int omax, int osubmin, int osubmax)
|
int omin, int omax, int osubmin, int osubmax)
|
||||||
{
|
{
|
||||||
int cmin, cmax;
|
int inch, onch, nch;
|
||||||
|
|
||||||
cmin = -NCHAN_MAX;
|
/*
|
||||||
if (osubmin > cmin)
|
* Ignore channels outside of the available sets
|
||||||
cmin = osubmin;
|
*/
|
||||||
if (omin > cmin)
|
if (isubmin < imin)
|
||||||
cmin = omin;
|
isubmin = imin;
|
||||||
if (isubmin > cmin)
|
if (isubmax > imax)
|
||||||
cmin = isubmin;
|
isubmax = imax;
|
||||||
if (imin > cmin)
|
if (osubmin < omin)
|
||||||
cmin = imin;
|
osubmin = omin;
|
||||||
|
if (osubmax > omax)
|
||||||
|
osubmax = omax;
|
||||||
|
|
||||||
cmax = NCHAN_MAX;
|
/*
|
||||||
if (osubmax < cmax)
|
* Shrink the input or the output subset to make both subsets of
|
||||||
cmax = osubmax;
|
* the same size
|
||||||
if (omax < cmax)
|
*/
|
||||||
cmax = omax;
|
inch = isubmax - isubmin + 1;
|
||||||
if (isubmax < cmax)
|
onch = osubmax - osubmin + 1;
|
||||||
cmax = isubmax;
|
nch = (inch < onch) ? inch : onch;
|
||||||
if (imax < cmax)
|
isubmax = isubmin + nch - 1;
|
||||||
cmax = imax;
|
osubmax = osubmin + nch - 1;
|
||||||
|
|
||||||
p->ostart = cmin - omin;
|
p->ostart = osubmin - omin;
|
||||||
p->onext = omax - cmax;
|
p->onext = omax - osubmax;
|
||||||
p->istart = cmin - imin;
|
p->istart = isubmin - imin;
|
||||||
p->inext = imax - cmax;
|
p->inext = imax - isubmax;
|
||||||
p->nch = cmax - cmin + 1;
|
p->nch = nch;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (log_level >= 3) {
|
if (log_level >= 3) {
|
||||||
log_puts("cmap: nch = ");
|
log_puts("cmap: nch = ");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: dsp.h,v 1.12 2022/12/26 19:16:03 jmc Exp $ */
|
/* $OpenBSD: dsp.h,v 1.14 2024/04/22 11:07:42 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -85,6 +85,7 @@ struct resamp {
|
||||||
adata_t ctx[NCHAN_MAX * RESAMP_NCTX];
|
adata_t ctx[NCHAN_MAX * RESAMP_NCTX];
|
||||||
int filt_cutoff, filt_step;
|
int filt_cutoff, filt_step;
|
||||||
unsigned int iblksz, oblksz;
|
unsigned int iblksz, oblksz;
|
||||||
|
int diff;
|
||||||
int nch;
|
int nch;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ struct cmap {
|
||||||
int nch;
|
int nch;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MIDI_TO_ADATA(m) (aparams_ctltovol[m] << (ADATA_BITS - 16))
|
#define MIDI_TO_ADATA(m) (aparams_ctltovol[m])
|
||||||
extern const int aparams_ctltovol[128];
|
extern const int aparams_ctltovol[128];
|
||||||
|
|
||||||
void aparams_init(struct aparams *);
|
void aparams_init(struct aparams *);
|
||||||
|
@ -115,7 +116,8 @@ int aparams_strtoenc(struct aparams *, char *);
|
||||||
int aparams_enctostr(struct aparams *, char *);
|
int aparams_enctostr(struct aparams *, char *);
|
||||||
int aparams_native(struct aparams *);
|
int aparams_native(struct aparams *);
|
||||||
|
|
||||||
void resamp_do(struct resamp *, adata_t *, adata_t *, int);
|
void resamp_getcnt(struct resamp *, int *, int *);
|
||||||
|
void resamp_do(struct resamp *, adata_t *, adata_t *, int, int);
|
||||||
void resamp_init(struct resamp *, unsigned int, unsigned int, int);
|
void resamp_init(struct resamp *, unsigned int, unsigned int, int);
|
||||||
void enc_do(struct conv *, unsigned char *, unsigned char *, int);
|
void enc_do(struct conv *, unsigned char *, unsigned char *, int);
|
||||||
void enc_sil_do(struct conv *, unsigned char *, int);
|
void enc_sil_do(struct conv *, unsigned char *, int);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: opt.c,v 1.9 2021/11/01 14:43:25 ratchov Exp $ */
|
/* $OpenBSD: opt.c,v 1.10 2024/04/22 10:42:04 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2011 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2011 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -375,7 +375,7 @@ opt_done(struct opt *o)
|
||||||
* Set opt's device, and (if necessary) move clients to
|
* Set opt's device, and (if necessary) move clients to
|
||||||
* to the new device
|
* to the new device
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
opt_setdev(struct opt *o, struct dev *ndev)
|
opt_setdev(struct opt *o, struct dev *ndev)
|
||||||
{
|
{
|
||||||
struct dev *odev;
|
struct dev *odev;
|
||||||
|
@ -385,12 +385,12 @@ opt_setdev(struct opt *o, struct dev *ndev)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!dev_ref(ndev))
|
if (!dev_ref(ndev))
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
odev = o->dev;
|
odev = o->dev;
|
||||||
if (odev == ndev) {
|
if (odev == ndev) {
|
||||||
dev_unref(ndev);
|
dev_unref(ndev);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if clients can use new device */
|
/* check if clients can use new device */
|
||||||
|
@ -399,18 +399,20 @@ opt_setdev(struct opt *o, struct dev *ndev)
|
||||||
continue;
|
continue;
|
||||||
if (s->ops != NULL && !dev_iscompat(odev, ndev)) {
|
if (s->ops != NULL && !dev_iscompat(odev, ndev)) {
|
||||||
dev_unref(ndev);
|
dev_unref(ndev);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if we're using MMC, move all opts to the new device, mtc_setdev()
|
* if we're using MMC, move all opts to the new device, mtc_setdev()
|
||||||
* will call us back
|
* will call us back
|
||||||
|
*
|
||||||
|
* XXX: move this to the end to avoid the recursion
|
||||||
*/
|
*/
|
||||||
if (o->mtc != NULL && o->mtc->dev != ndev) {
|
if (o->mtc != NULL && o->mtc->dev != ndev) {
|
||||||
mtc_setdev(o->mtc, ndev);
|
mtc_setdev(o->mtc, ndev);
|
||||||
dev_unref(ndev);
|
dev_unref(ndev);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = ctl_find(CTL_OPT_DEV, o, o->dev);
|
c = ctl_find(CTL_OPT_DEV, o, o->dev);
|
||||||
|
@ -468,6 +470,7 @@ opt_setdev(struct opt *o, struct dev *ndev)
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_unref(ndev);
|
dev_unref(ndev);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: opt.h,v 1.7 2021/11/01 14:43:25 ratchov Exp $ */
|
/* $OpenBSD: opt.h,v 1.8 2024/04/22 10:42:04 ratchov Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
|
||||||
*
|
*
|
||||||
|
@ -47,7 +47,7 @@ struct opt *opt_byname(char *);
|
||||||
struct opt *opt_bynum(int);
|
struct opt *opt_bynum(int);
|
||||||
void opt_init(struct opt *);
|
void opt_init(struct opt *);
|
||||||
void opt_done(struct opt *);
|
void opt_done(struct opt *);
|
||||||
void opt_setdev(struct opt *, struct dev *);
|
int opt_setdev(struct opt *, struct dev *);
|
||||||
struct dev *opt_ref(struct opt *);
|
struct dev *opt_ref(struct opt *);
|
||||||
void opt_unref(struct opt *);
|
void opt_unref(struct opt *);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pf.c,v 1.13 2020/09/14 11:15:30 kn Exp $ */
|
/* $OpenBSD: pf.c,v 1.14 2024/04/22 13:30:22 bluhm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
|
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
|
||||||
*
|
*
|
||||||
|
@ -44,7 +44,8 @@ void print_fld_double(field_def *, double);
|
||||||
const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
|
const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
|
||||||
const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
|
const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES;
|
||||||
const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
|
const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
|
||||||
const char *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
|
const char *pf_scounters[SCNT_MAX+1] = FCNT_NAMES;
|
||||||
|
const char *pf_ncounters[NCNT_MAX+1] = FCNT_NAMES;
|
||||||
|
|
||||||
static struct pf_status status;
|
static struct pf_status status;
|
||||||
int num_pf = 0;
|
int num_pf = 0;
|
||||||
|
@ -104,6 +105,7 @@ read_pf(void)
|
||||||
|
|
||||||
num_disp += FCNT_MAX + 2;
|
num_disp += FCNT_MAX + 2;
|
||||||
num_disp += SCNT_MAX + 2;
|
num_disp += SCNT_MAX + 2;
|
||||||
|
num_disp += NCNT_MAX + 2;
|
||||||
num_disp += PFRES_MAX + 1;
|
num_disp += PFRES_MAX + 1;
|
||||||
num_disp += LCNT_MAX + 1;
|
num_disp += LCNT_MAX + 1;
|
||||||
|
|
||||||
|
@ -296,6 +298,17 @@ print_pf(void)
|
||||||
ADD_LINE_V("src track", pf_scounters[i], s->scounters[i]);
|
ADD_LINE_V("src track", pf_scounters[i], s->scounters[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ADD_EMPTY_LINE;
|
||||||
|
ADD_LINE_V("fragment", "Count", s->fragments);
|
||||||
|
|
||||||
|
for (i = 0; i < NCNT_MAX; i++) {
|
||||||
|
if (tm > 0)
|
||||||
|
ADD_LINE_VR("fragment", pf_ncounters[i], s->ncounters[i],
|
||||||
|
(double)s->ncounters[i] / (double)tm);
|
||||||
|
else
|
||||||
|
ADD_LINE_V("fragment", pf_ncounters[i], s->ncounters[i]);
|
||||||
|
}
|
||||||
|
|
||||||
ADD_EMPTY_LINE;
|
ADD_EMPTY_LINE;
|
||||||
for (i = 0; i < PFRES_MAX; i++) {
|
for (i = 0; i < PFRES_MAX; i++) {
|
||||||
if (tm > 0)
|
if (tm > 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: pftop.c,v 1.46 2023/07/04 11:34:19 sashan Exp $ */
|
/* $OpenBSD: pftop.c,v 1.47 2024/04/22 14:19:48 jsg Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2007 Can Erkin Acar
|
* Copyright (c) 2001, 2007 Can Erkin Acar
|
||||||
* Copyright (c) 2001 Daniel Hartmeier
|
* Copyright (c) 2001 Daniel Hartmeier
|
||||||
|
@ -716,15 +716,13 @@ unmask(struct pf_addr * m)
|
||||||
void
|
void
|
||||||
tb_print_addr(struct pf_addr * addr, struct pf_addr * mask, int af)
|
tb_print_addr(struct pf_addr * addr, struct pf_addr * mask, int af)
|
||||||
{
|
{
|
||||||
switch (af) {
|
switch (af) {
|
||||||
case AF_INET: {
|
case AF_INET:
|
||||||
tbprintf("%s", inetname(addr->v4));
|
tbprintf("%s", inetname(addr->v4));
|
||||||
break;
|
break;
|
||||||
}
|
case AF_INET6:
|
||||||
case AF_INET6: {
|
tbprintf("%s", inet6name(&addr->v6));
|
||||||
tbprintf("%s", inet6name(&addr->v6));
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask != NULL) {
|
if (mask != NULL) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: control.c,v 1.116 2024/01/11 15:46:25 claudio Exp $ */
|
/* $OpenBSD: control.c,v 1.117 2024/04/22 09:36:04 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
||||||
|
@ -393,31 +393,28 @@ control_dispatch_msg(struct pollfd *pfd, struct peer_head *peers)
|
||||||
case IMSG_CTL_NEIGHBOR_DOWN:
|
case IMSG_CTL_NEIGHBOR_DOWN:
|
||||||
neighbor.reason[
|
neighbor.reason[
|
||||||
sizeof(neighbor.reason) - 1] = '\0';
|
sizeof(neighbor.reason) - 1] = '\0';
|
||||||
strlcpy(p->conf.reason,
|
|
||||||
neighbor.reason,
|
|
||||||
sizeof(p->conf.reason));
|
|
||||||
p->conf.down = 1;
|
p->conf.down = 1;
|
||||||
session_stop(p, ERR_CEASE_ADMIN_DOWN);
|
session_stop(p, ERR_CEASE_ADMIN_DOWN,
|
||||||
|
neighbor.reason);
|
||||||
control_result(c, CTL_RES_OK);
|
control_result(c, CTL_RES_OK);
|
||||||
break;
|
break;
|
||||||
case IMSG_CTL_NEIGHBOR_CLEAR:
|
case IMSG_CTL_NEIGHBOR_CLEAR:
|
||||||
neighbor.reason[
|
neighbor.reason[
|
||||||
sizeof(neighbor.reason) - 1] = '\0';
|
sizeof(neighbor.reason) - 1] = '\0';
|
||||||
strlcpy(p->conf.reason,
|
|
||||||
neighbor.reason,
|
|
||||||
sizeof(p->conf.reason));
|
|
||||||
p->IdleHoldTime =
|
p->IdleHoldTime =
|
||||||
INTERVAL_IDLE_HOLD_INITIAL;
|
INTERVAL_IDLE_HOLD_INITIAL;
|
||||||
p->errcnt = 0;
|
p->errcnt = 0;
|
||||||
if (!p->conf.down) {
|
if (!p->conf.down) {
|
||||||
session_stop(p,
|
session_stop(p,
|
||||||
ERR_CEASE_ADMIN_RESET);
|
ERR_CEASE_ADMIN_RESET,
|
||||||
|
neighbor.reason);
|
||||||
timer_set(&p->timers,
|
timer_set(&p->timers,
|
||||||
Timer_IdleHold,
|
Timer_IdleHold,
|
||||||
SESSION_CLEAR_DELAY);
|
SESSION_CLEAR_DELAY);
|
||||||
} else {
|
} else {
|
||||||
session_stop(p,
|
session_stop(p,
|
||||||
ERR_CEASE_ADMIN_DOWN);
|
ERR_CEASE_ADMIN_DOWN,
|
||||||
|
neighbor.reason);
|
||||||
}
|
}
|
||||||
control_result(c, CTL_RES_OK);
|
control_result(c, CTL_RES_OK);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: session.c,v 1.470 2024/04/11 08:33:15 claudio Exp $ */
|
/* $OpenBSD: session.c,v 1.473 2024/04/22 09:43:11 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
|
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
|
||||||
|
@ -87,7 +87,7 @@ int parse_header(struct peer *, u_char *, uint16_t *, uint8_t *);
|
||||||
int parse_open(struct peer *);
|
int parse_open(struct peer *);
|
||||||
int parse_update(struct peer *);
|
int parse_update(struct peer *);
|
||||||
int parse_rrefresh(struct peer *);
|
int parse_rrefresh(struct peer *);
|
||||||
int parse_notification(struct peer *);
|
void parse_notification(struct peer *);
|
||||||
int parse_capabilities(struct peer *, u_char *, uint16_t, uint32_t *);
|
int parse_capabilities(struct peer *, u_char *, uint16_t, uint32_t *);
|
||||||
int capa_neg_calc(struct peer *);
|
int capa_neg_calc(struct peer *);
|
||||||
void session_dispatch_imsg(struct imsgbuf *, int, u_int *);
|
void session_dispatch_imsg(struct imsgbuf *, int, u_int *);
|
||||||
|
@ -266,11 +266,12 @@ session_main(int debug, int verbose)
|
||||||
if (p->demoted)
|
if (p->demoted)
|
||||||
session_demote(p, -1);
|
session_demote(p, -1);
|
||||||
p->conf.demote_group[0] = 0;
|
p->conf.demote_group[0] = 0;
|
||||||
session_stop(p, ERR_CEASE_PEER_UNCONF);
|
session_stop(p, ERR_CEASE_PEER_UNCONF,
|
||||||
|
NULL);
|
||||||
timer_remove_all(&p->timers);
|
timer_remove_all(&p->timers);
|
||||||
tcp_md5_del_listener(conf, p);
|
tcp_md5_del_listener(conf, p);
|
||||||
log_peer_warnx(&p->conf, "removed");
|
|
||||||
RB_REMOVE(peer_head, &conf->peers, p);
|
RB_REMOVE(peer_head, &conf->peers, p);
|
||||||
|
log_peer_warnx(&p->conf, "removed");
|
||||||
free(p);
|
free(p);
|
||||||
peer_cnt--;
|
peer_cnt--;
|
||||||
continue;
|
continue;
|
||||||
|
@ -513,12 +514,10 @@ session_main(int debug, int verbose)
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_FOREACH_SAFE(p, peer_head, &conf->peers, next) {
|
RB_FOREACH_SAFE(p, peer_head, &conf->peers, next) {
|
||||||
RB_REMOVE(peer_head, &conf->peers, p);
|
session_stop(p, ERR_CEASE_ADMIN_DOWN, "bgpd shutting down");
|
||||||
strlcpy(p->conf.reason,
|
|
||||||
"bgpd shutting down",
|
|
||||||
sizeof(p->conf.reason));
|
|
||||||
session_stop(p, ERR_CEASE_ADMIN_DOWN);
|
|
||||||
timer_remove_all(&p->timers);
|
timer_remove_all(&p->timers);
|
||||||
|
tcp_md5_del_listener(conf, p);
|
||||||
|
RB_REMOVE(peer_head, &conf->peers, p);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,6 +623,9 @@ bgp_fsm(struct peer *peer, enum session_events event)
|
||||||
}
|
}
|
||||||
peer->passive = 0;
|
peer->passive = 0;
|
||||||
break;
|
break;
|
||||||
|
case EVNT_STOP:
|
||||||
|
timer_stop(&peer->timers, Timer_IdleHold);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* ignore */
|
/* ignore */
|
||||||
break;
|
break;
|
||||||
|
@ -723,13 +725,7 @@ bgp_fsm(struct peer *peer, enum session_events event)
|
||||||
change_state(peer, STATE_OPENCONFIRM, event);
|
change_state(peer, STATE_OPENCONFIRM, event);
|
||||||
break;
|
break;
|
||||||
case EVNT_RCVD_NOTIFICATION:
|
case EVNT_RCVD_NOTIFICATION:
|
||||||
if (parse_notification(peer)) {
|
parse_notification(peer);
|
||||||
change_state(peer, STATE_IDLE, event);
|
|
||||||
/* don't punish, capa negotiation */
|
|
||||||
timer_set(&peer->timers, Timer_IdleHold, 0);
|
|
||||||
peer->IdleHoldTime /= 2;
|
|
||||||
} else
|
|
||||||
change_state(peer, STATE_IDLE, event);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
session_notification(peer,
|
session_notification(peer,
|
||||||
|
@ -769,7 +765,6 @@ bgp_fsm(struct peer *peer, enum session_events event)
|
||||||
break;
|
break;
|
||||||
case EVNT_RCVD_NOTIFICATION:
|
case EVNT_RCVD_NOTIFICATION:
|
||||||
parse_notification(peer);
|
parse_notification(peer);
|
||||||
change_state(peer, STATE_IDLE, event);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
session_notification(peer,
|
session_notification(peer,
|
||||||
|
@ -815,7 +810,6 @@ bgp_fsm(struct peer *peer, enum session_events event)
|
||||||
break;
|
break;
|
||||||
case EVNT_RCVD_NOTIFICATION:
|
case EVNT_RCVD_NOTIFICATION:
|
||||||
parse_notification(peer);
|
parse_notification(peer);
|
||||||
change_state(peer, STATE_IDLE, event);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
session_notification(peer,
|
session_notification(peer,
|
||||||
|
@ -2326,9 +2320,6 @@ bad_len:
|
||||||
session_notification(peer, ERR_OPEN, ERR_OPEN_OPT,
|
session_notification(peer, ERR_OPEN, ERR_OPEN_OPT,
|
||||||
NULL);
|
NULL);
|
||||||
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
|
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
|
||||||
/* no punish */
|
|
||||||
timer_set(&peer->timers, Timer_IdleHold, 0);
|
|
||||||
peer->IdleHoldTime /= 2;
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2493,7 +2484,7 @@ parse_rrefresh(struct peer *peer)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
parse_notification(struct peer *peer)
|
parse_notification(struct peer *peer)
|
||||||
{
|
{
|
||||||
struct ibuf ibuf;
|
struct ibuf ibuf;
|
||||||
|
@ -2518,7 +2509,7 @@ parse_notification(struct peer *peer)
|
||||||
if (ibuf_get_n8(&ibuf, &errcode) == -1 ||
|
if (ibuf_get_n8(&ibuf, &errcode) == -1 ||
|
||||||
ibuf_get_n8(&ibuf, &subcode) == -1) {
|
ibuf_get_n8(&ibuf, &subcode) == -1) {
|
||||||
log_peer_warnx(&peer->conf, "received bad notification");
|
log_peer_warnx(&peer->conf, "received bad notification");
|
||||||
return (-1);
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
peer->errcnt++;
|
peer->errcnt++;
|
||||||
|
@ -2541,12 +2532,8 @@ parse_notification(struct peer *peer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errcode == ERR_OPEN && subcode == ERR_OPEN_OPT) {
|
done:
|
||||||
session_capa_ann_none(peer);
|
change_state(peer, STATE_IDLE, EVNT_RCVD_NOTIFICATION);
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -3165,7 +3152,8 @@ session_dispatch_imsg(struct imsgbuf *imsgbuf, int idx, u_int *listener_cnt)
|
||||||
} else if (!depend_ok && p->depend_ok) {
|
} else if (!depend_ok && p->depend_ok) {
|
||||||
p->depend_ok = depend_ok;
|
p->depend_ok = depend_ok;
|
||||||
session_stop(p,
|
session_stop(p,
|
||||||
ERR_CEASE_OTHER_CHANGE);
|
ERR_CEASE_OTHER_CHANGE,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3631,21 +3619,21 @@ session_demote(struct peer *p, int level)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
session_stop(struct peer *peer, uint8_t subcode)
|
session_stop(struct peer *peer, uint8_t subcode, const char *reason)
|
||||||
{
|
{
|
||||||
struct ibuf *ibuf;
|
struct ibuf *ibuf;
|
||||||
char *communication;
|
|
||||||
|
|
||||||
communication = peer->conf.reason;
|
if (reason != NULL)
|
||||||
|
strlcpy(peer->conf.reason, reason, sizeof(peer->conf.reason));
|
||||||
|
|
||||||
ibuf = ibuf_dynamic(0, REASON_LEN);
|
ibuf = ibuf_dynamic(0, REASON_LEN);
|
||||||
|
|
||||||
if ((subcode == ERR_CEASE_ADMIN_DOWN ||
|
if ((subcode == ERR_CEASE_ADMIN_DOWN ||
|
||||||
subcode == ERR_CEASE_ADMIN_RESET) &&
|
subcode == ERR_CEASE_ADMIN_RESET) &&
|
||||||
communication != NULL && *communication != '\0' &&
|
reason != NULL && *reason != '\0' &&
|
||||||
ibuf != NULL) {
|
ibuf != NULL) {
|
||||||
if (ibuf_add_n8(ibuf, strlen(communication)) == -1 ||
|
if (ibuf_add_n8(ibuf, strlen(reason)) == -1 ||
|
||||||
ibuf_add(ibuf, communication, strlen(communication))) {
|
ibuf_add(ibuf, reason, strlen(reason))) {
|
||||||
log_peer_warnx(&peer->conf,
|
log_peer_warnx(&peer->conf,
|
||||||
"trying to send overly long shutdown reason");
|
"trying to send overly long shutdown reason");
|
||||||
ibuf_free(ibuf);
|
ibuf_free(ibuf);
|
||||||
|
@ -3660,6 +3648,13 @@ session_stop(struct peer *peer, uint8_t subcode)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* session not open, no need to send notification */
|
/* session not open, no need to send notification */
|
||||||
|
if (subcode >= sizeof(suberr_cease_names) / sizeof(char *) ||
|
||||||
|
suberr_cease_names[subcode] == NULL)
|
||||||
|
log_peer_warnx(&peer->conf, "session stop: %s, "
|
||||||
|
"unknown subcode %u", errnames[ERR_CEASE], subcode);
|
||||||
|
else
|
||||||
|
log_peer_warnx(&peer->conf, "session stop: %s, %s",
|
||||||
|
errnames[ERR_CEASE], suberr_cease_names[subcode]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ibuf_free(ibuf);
|
ibuf_free(ibuf);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: session.h,v 1.168 2024/03/22 07:19:28 claudio Exp $ */
|
/* $OpenBSD: session.h,v 1.169 2024/04/22 09:36:04 claudio Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
||||||
|
@ -331,7 +331,7 @@ int peer_matched(struct peer *, struct ctl_neighbor *);
|
||||||
int imsg_ctl_parent(struct imsg *);
|
int imsg_ctl_parent(struct imsg *);
|
||||||
int imsg_ctl_rde(struct imsg *);
|
int imsg_ctl_rde(struct imsg *);
|
||||||
int imsg_ctl_rde_msg(int, uint32_t, pid_t);
|
int imsg_ctl_rde_msg(int, uint32_t, pid_t);
|
||||||
void session_stop(struct peer *, uint8_t);
|
void session_stop(struct peer *, uint8_t, const char *);
|
||||||
|
|
||||||
/* timer.c */
|
/* timer.c */
|
||||||
struct timer *timer_get(struct timer_head *, enum Timer);
|
struct timer *timer_get(struct timer_head *, enum Timer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue