This commit is contained in:
purplerain 2023-06-17 09:22:54 +00:00
parent bb198177ef
commit 123b6c5611
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
35 changed files with 224 additions and 128 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ex_data.c,v 1.20 2018/03/17 16:20:01 beck Exp $ */
/* $OpenBSD: ex_data.c,v 1.21 2023/06/16 11:20:01 tb Exp $ */
/*
* Overhaul notes;
@ -320,7 +320,7 @@ def_get_class(int class_index)
gen = malloc(sizeof(EX_CLASS_ITEM));
if (gen) {
gen->class_index = class_index;
gen->meth_num = 0;
gen->meth_num = 1;
gen->meth = sk_CRYPTO_EX_DATA_FUNCS_new_null();
if (!gen->meth)
free(gen);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: obj_xref.h,v 1.6 2023/06/15 16:59:54 tb Exp $ */
/* $OpenBSD: obj_xref.h,v 1.7 2023/06/15 17:58:27 tb Exp $ */
/* AUTOGENERATED BY objxref.pl, DO NOT EDIT */
__BEGIN_HIDDEN_DECLS
@ -55,6 +55,10 @@ static const nid_triple sigoid_srt[] =
{NID_dhSinglePass_cofactorDH_sha256kdf_scheme, NID_sha256, NID_dh_cofactor_kdf},
{NID_dhSinglePass_cofactorDH_sha384kdf_scheme, NID_sha384, NID_dh_cofactor_kdf},
{NID_dhSinglePass_cofactorDH_sha512kdf_scheme, NID_sha512, NID_dh_cofactor_kdf},
{NID_RSA_SHA3_224, NID_sha3_224, NID_rsaEncryption},
{NID_RSA_SHA3_256, NID_sha3_256, NID_rsaEncryption},
{NID_RSA_SHA3_384, NID_sha3_384, NID_rsaEncryption},
{NID_RSA_SHA3_512, NID_sha3_512, NID_rsaEncryption},
};
static const nid_triple * const sigoid_srt_xref[] =
@ -102,6 +106,10 @@ static const nid_triple * const sigoid_srt_xref[] =
&sigoid_srt[28],
&sigoid_srt[30],
&sigoid_srt[31],
&sigoid_srt[43],
&sigoid_srt[44],
&sigoid_srt[45],
&sigoid_srt[46],
};
__END_HIDDEN_DECLS

View File

@ -15,6 +15,10 @@ sha512WithRSAEncryption sha512 rsaEncryption
sha224WithRSAEncryption sha224 rsaEncryption
mdc2WithRSA mdc2 rsaEncryption
ripemd160WithRSA ripemd160 rsaEncryption
RSA_SHA3_224 sha3_224 rsaEncryption
RSA_SHA3_256 sha3_256 rsaEncryption
RSA_SHA3_384 sha3_384 rsaEncryption
RSA_SHA3_512 sha3_512 rsaEncryption
# For PSS the digest algorithm can vary and depends on the included
# AlgorithmIdentifier.
rsassaPss undef rsaEncryption

View File

@ -1,4 +1,4 @@
/* $OpenBSD: x509type.c,v 1.18 2023/02/16 08:38:17 tb Exp $ */
/* $OpenBSD: x509type.c,v 1.19 2023/06/15 18:30:09 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -89,6 +89,9 @@ X509_certificate_type(const X509 *x, const EVP_PKEY *pkey)
case EVP_PKEY_EC:
ret = EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH;
break;
case EVP_PKEY_ED25519:
ret = EVP_PKT_SIGN;
break;
case EVP_PKEY_DH:
ret = EVP_PK_DH|EVP_PKT_EXCH;
break;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde_community_test.c,v 1.6 2023/01/30 17:02:48 claudio Exp $ */
/* $OpenBSD: rde_community_test.c,v 1.7 2023/06/17 08:01:22 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
@ -161,7 +161,7 @@ test_filter(size_t num, struct testfilter *f)
if (f->next != 0) {
if (community_count(&comm, COMMUNITY_TYPE_EXT) !=
f->next - 1) {
printf("Test %zu: community_count unexpected "
printf("Test %zu: ext community_count unexpected "
"return %d != %d\n", num, r, f->next - 1);
return -1;
}
@ -170,7 +170,7 @@ test_filter(size_t num, struct testfilter *f)
if (f->nlarge != 0) {
if (community_count(&comm, COMMUNITY_TYPE_LARGE) !=
f->nlarge - 1) {
printf("Test %zu: community_count unexpected "
printf("Test %zu: large community_count unexpected "
"return %d != %d\n", num, r, f->nlarge - 1);
return -1;
}

View File

@ -502,6 +502,22 @@ struct community filters[] = {
.data2 = 196618,
.data3 = EXT_COMMUNITY_TRANS_TWO_AS << 8 | 0x02,
},
{ /* 42 */
.flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 24),
},
{ /* 43 */
.flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8),
.data3 = (-1 << 8) | 0x02,
},
{ /* 44 */
.flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 8),
.data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02,
},
{ /* 45 */
.flags = COMMUNITY_TYPE_EXT | (COMMUNITY_ANY << 16),
.data3 = EXT_COMMUNITY_TRANS_FOUR_AS << 8 | 0x02,
.data1 = 196618,
},
};
struct testfilter {
@ -514,12 +530,6 @@ struct testfilter {
int nlarge;
struct rde_peer *peer;
} testfilters[] = {
{
.in = { 38, -1 },
.match = 30,
.mout = 1,
.peer = &peer,
},
{
.in = { 1, 2, -1 },
.match = 1,
@ -952,5 +962,54 @@ struct testfilter {
.mout = 1,
.peer = &peer_r4,
},
{
.in = { 38, -1 },
.match = 30,
.mout = 1,
.peer = &peer,
},
{ /* 70 */
.in = { 38, 39, 40, -1 },
.match = 42,
.mout = 1,
.delete = 42,
.next = 0 + 1,
.peer = &peer,
},
{
.in = { 38, 39, 40, -1 },
.match = 43,
.mout = 1,
.delete = 43,
.next = 0 + 1,
.peer = &peer,
},
{
.in = { 39, 40, -1 },
.match = 44,
.mout = 1,
.delete = 44,
.next = 0 + 1,
.peer = &peer,
},
{
.in = { 38, -1 },
.match = 44,
.mout = 0,
.peer = &peer,
},
{
.in = { 40, -1 },
.match = 45,
.mout = 1,
.delete = 45,
.next = 0 + 1,
.peer = &peer,
},
{ /* 75 */
.in = { 38, 39, 41, -1 },
.match = 45,
.mout = 0,
.peer = &peer,
},
};

View File

@ -1,4 +1,4 @@
/* $OpenBSD: iked.h,v 1.216 2023/06/13 12:34:12 tb Exp $ */
/* $OpenBSD: iked.h,v 1.217 2023/06/16 10:28:43 tb Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@ -1250,8 +1250,6 @@ struct in6_addr *
prefixlen2mask6(uint8_t, uint32_t *);
uint32_t
prefixlen2mask(uint8_t);
const char *
print_host(struct sockaddr *, char *, size_t);
const char *
print_addr(void *);
char *get_string(uint8_t *, size_t);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: util.c,v 1.41 2023/06/13 12:34:12 tb Exp $ */
/* $OpenBSD: util.c,v 1.42 2023/06/16 10:28:43 tb Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@ -636,19 +636,20 @@ prefixlen2mask6(uint8_t prefixlen, uint32_t *mask)
}
const char *
print_host(struct sockaddr *sa, char *buf, size_t len)
print_addr(void *addr)
{
static char sbuf[IKED_CYCLE_BUFFERS][NI_MAXHOST + 7];
static int idx = 0;
char pbuf[7];
in_port_t port;
static char sbuf[IKED_CYCLE_BUFFERS][NI_MAXHOST + 7];
static int idx;
struct sockaddr *sa = addr;
char *buf;
size_t len;
char pbuf[7];
in_port_t port;
if (buf == NULL) {
buf = sbuf[idx];
len = sizeof(sbuf[idx]);
if (++idx >= IKED_CYCLE_BUFFERS)
idx = 0;
}
buf = sbuf[idx];
len = sizeof(sbuf[idx]);
if (++idx >= IKED_CYCLE_BUFFERS)
idx = 0;
if (sa->sa_family == AF_UNSPEC) {
strlcpy(buf, "any", len);
@ -669,12 +670,6 @@ print_host(struct sockaddr *sa, char *buf, size_t len)
return (buf);
}
const char *
print_addr(void *addr)
{
return print_host(addr, NULL, 0);
}
char *
get_string(uint8_t *ptr, size_t len)
{

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.168 2023/04/24 09:04:03 dv Exp $ */
/* $OpenBSD: cpu.c,v 1.169 2023/06/15 22:18:06 cheloha Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@ -664,6 +664,7 @@ cpu_attach(struct device *parent, struct device *self, void *aux)
#if defined(MULTIPROCESSOR)
cpu_intr_init(ci);
cpu_start_secondary(ci);
clockqueue_init(&ci->ci_queue);
sched_init_cpu(ci);
ncpus++;
if (ci->ci_flags & CPUF_PRESENT) {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.57 2022/03/12 14:40:41 mpi Exp $ */
/* $OpenBSD: cpu.c,v 1.58 2023/06/15 22:18:06 cheloha Exp $ */
/* $NetBSD: cpu.c,v 1.56 2004/04/14 04:01:49 bsh Exp $ */
@ -391,6 +391,7 @@ cpu_attach(struct device *parent, struct device *dev, void *aux)
"cpu-release-addr", 0);
}
clockqueue_init(&ci->ci_queue);
sched_init_cpu(ci);
if (cpu_hatch_secondary(ci, spinup_method, spinup_data)) {
atomic_setbits_int(&ci->ci_flags, CPUF_IDENTIFY);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.94 2023/06/11 21:42:01 kettenis Exp $ */
/* $OpenBSD: cpu.c,v 1.95 2023/06/15 22:18:07 cheloha Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@ -875,6 +875,7 @@ cpu_attach(struct device *parent, struct device *dev, void *aux)
"cpu-release-addr", 0);
}
clockqueue_init(&ci->ci_queue);
sched_init_cpu(ci);
if (cpu_start_secondary(ci, spinup_method, spinup_data)) {
atomic_setbits_int(&ci->ci_flags, CPUF_IDENTIFY);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: db_trace.c,v 1.14 2023/04/26 16:53:58 claudio Exp $ */
/* $OpenBSD: db_trace.c,v 1.15 2023/06/17 08:13:56 kettenis Exp $ */
/* $NetBSD: db_trace.c,v 1.8 2003/01/17 22:28:48 thorpej Exp $ */
/*
@ -49,18 +49,6 @@ db_regs_t ddb_regs;
#define INKERNEL(va) (((vaddr_t)(va)) & (1ULL << 63))
#ifndef __clang__
/*
* Clang uses a different stack frame, which looks like the following.
*
* return link value [fp, #+4]
* return fp value [fp] <- fp points to here
*
*/
#define FR_RFP (0x0)
#define FR_RLV (0x4)
#endif /* !__clang__ */
void
db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
char *modif, int (*pr)(const char *, ...))
@ -98,7 +86,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
lastlr = p->p_addr->u_pcb.pcb_tf->tf_elr;
} else {
sp = addr;
db_read_bytes(sp+16, sizeof(vaddr_t),
db_read_bytes(sp, sizeof(vaddr_t),
(char *)&frame);
db_read_bytes(sp + 8, sizeof(vaddr_t),
(char *)&lr);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.111 2023/01/30 10:49:04 jsg Exp $ */
/* $OpenBSD: cpu.c,v 1.112 2023/06/15 22:18:07 cheloha Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
@ -360,6 +360,7 @@ cpu_attach(struct device *parent, struct device *self, void *aux)
#endif
cpu_tsx_disable(ci);
identifycpu(ci);
clockqueue_init(&ci->ci_queue);
sched_init_cpu(ci);
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;

View File

@ -1096,6 +1096,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
(pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
return false;
if (adev->asic_type < CHIP_RAVEN)
return false;
/*
* If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
* risky to do any special firmware-related preparations for entering

View File

@ -2409,8 +2409,10 @@ static int amdgpu_pmops_suspend(struct device *dev)
if (amdgpu_acpi_is_s0ix_active(adev))
adev->in_s0ix = true;
else
else if (amdgpu_acpi_is_s3_active(adev))
adev->in_s3 = true;
if (!adev->in_s0ix && !adev->in_s3)
return 0;
return amdgpu_device_suspend(drm_dev, true);
}
@ -2431,6 +2433,9 @@ static int amdgpu_pmops_resume(struct device *dev)
struct amdgpu_device *adev = drm_to_adev(drm_dev);
int r;
if (!adev->in_s0ix && !adev->in_s3)
return 0;
/* Avoids registers access if device is physically gone */
if (!pci_device_is_present(adev->pdev))
adev->no_hw_access = true;

View File

@ -1328,12 +1328,9 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
struct amdgpu_mes_ctx_data ctx_data = {0};
struct amdgpu_ring *added_rings[AMDGPU_MES_CTX_MAX_RINGS] = { NULL };
int gang_ids[3] = {0};
int queue_types[][2] = { { AMDGPU_RING_TYPE_GFX,
AMDGPU_MES_CTX_MAX_GFX_RINGS},
{ AMDGPU_RING_TYPE_COMPUTE,
AMDGPU_MES_CTX_MAX_COMPUTE_RINGS},
{ AMDGPU_RING_TYPE_SDMA,
AMDGPU_MES_CTX_MAX_SDMA_RINGS } };
int queue_types[][2] = { { AMDGPU_RING_TYPE_GFX, 1 },
{ AMDGPU_RING_TYPE_COMPUTE, 1 },
{ AMDGPU_RING_TYPE_SDMA, 1} };
int i, r, pasid, k = 0;
pasid = amdgpu_pasid_alloc(16);

View File

@ -390,6 +390,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)
mes_set_hw_res_pkt.disable_reset = 1;
mes_set_hw_res_pkt.disable_mes_log = 1;
mes_set_hw_res_pkt.use_different_vmid_compute = 1;
mes_set_hw_res_pkt.enable_reg_active_poll = 1;
mes_set_hw_res_pkt.oversubscription_timer = 50;
return mes_v11_0_submit_pkt_and_poll_completion(mes,

View File

@ -1634,14 +1634,18 @@ static bool dc_link_construct_legacy(struct dc_link *link,
link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
switch (link->dc->config.allow_edp_hotplug_detection) {
case 1: // only the 1st eDP handles hotplug
case HPD_EN_FOR_ALL_EDP:
link->irq_source_hpd_rx =
dal_irq_get_rx_source(link->hpd_gpio);
break;
case HPD_EN_FOR_PRIMARY_EDP_ONLY:
if (link->link_index == 0)
link->irq_source_hpd_rx =
dal_irq_get_rx_source(link->hpd_gpio);
else
link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
break;
case 2: // only the 2nd eDP handles hotplug
case HPD_EN_FOR_SECONDARY_EDP_ONLY:
if (link->link_index == 1)
link->irq_source_hpd_rx =
dal_irq_get_rx_source(link->hpd_gpio);
@ -1649,6 +1653,7 @@ static bool dc_link_construct_legacy(struct dc_link *link,
link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
break;
default:
link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
break;
}
}

View File

@ -993,4 +993,10 @@ struct display_endpoint_id {
enum display_endpoint_type ep_type;
};
enum dc_hpd_enable_select {
HPD_EN_FOR_ALL_EDP = 0,
HPD_EN_FOR_PRIMARY_EDP_ONLY,
HPD_EN_FOR_SECONDARY_EDP_ONLY,
};
#endif /* DC_TYPES_H_ */

View File

@ -222,7 +222,11 @@ union MESAPI_SET_HW_RESOURCES {
uint32_t apply_grbm_remote_register_dummy_read_wa : 1;
uint32_t second_gfx_pipe_enabled : 1;
uint32_t enable_level_process_quantum_check : 1;
uint32_t reserved : 25;
uint32_t legacy_sch_mode : 1;
uint32_t disable_add_queue_wptr_mc_addr : 1;
uint32_t enable_mes_event_int_logging : 1;
uint32_t enable_reg_active_poll : 1;
uint32_t reserved : 21;
};
uint32_t uint32_t_all;
};

View File

@ -871,13 +871,11 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev,
}
if (ret == -ENOENT) {
size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf);
if (size > 0) {
size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
}
size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
}
if (size == 0)

View File

@ -125,6 +125,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] =
MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0),
MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0),
MSG_MAP(NotifyPowerSource, PPSMC_MSG_NotifyPowerSource, 0),
};
static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {

View File

@ -103,6 +103,16 @@ static void radeon_hotplug_work_func(struct work_struct *work)
static void radeon_dp_work_func(struct work_struct *work)
{
struct radeon_device *rdev = container_of(work, struct radeon_device,
dp_work);
struct drm_device *dev = rdev->ddev;
struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector;
mutex_lock(&mode_config->mutex);
list_for_each_entry(connector, &mode_config->connector_list, head)
radeon_connector_hotplug(connector);
mutex_unlock(&mode_config->mutex);
}
/**

View File

@ -1,4 +1,4 @@
/* $OpenBSD: init_main.c,v 1.320 2023/01/01 07:00:51 jsg Exp $ */
/* $OpenBSD: init_main.c,v 1.321 2023/06/15 22:18:06 cheloha Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@ -47,6 +47,7 @@
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/clockintr.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/tty.h>
@ -314,6 +315,7 @@ main(void *framep)
/* Initialize run queues */
sched_init_runqueues();
sleep_queue_init();
clockqueue_init(&curcpu()->ci_queue);
sched_init_cpu(curcpu());
p->p_cpu->ci_randseed = (arc4random() & 0x7fffffff) + 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kern_clockintr.c,v 1.21 2023/04/23 00:08:36 cheloha Exp $ */
/* $OpenBSD: kern_clockintr.c,v 1.22 2023/06/15 22:18:06 cheloha Exp $ */
/*
* Copyright (c) 2003 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@ -66,7 +66,6 @@ void clockintr_schedule(struct clockintr *, uint64_t);
void clockintr_schedule_locked(struct clockintr *, uint64_t);
void clockintr_statclock(struct clockintr *, void *);
void clockintr_statvar_init(int, uint32_t *, uint32_t *, uint32_t *);
void clockqueue_init(struct clockintr_queue *);
uint64_t clockqueue_next(const struct clockintr_queue *);
void clockqueue_reset_intrclock(struct clockintr_queue *);
uint64_t nsec_advance(uint64_t *, uint64_t, uint64_t);
@ -114,7 +113,6 @@ clockintr_cpu_init(const struct intrclock *ic)
KASSERT(ISSET(clockintr_flags, CL_INIT));
clockqueue_init(cq);
if (ic != NULL && !ISSET(cq->cq_flags, CQ_INTRCLOCK)) {
cq->cq_intrclock = *ic;
SET(cq->cq_flags, CQ_INTRCLOCK);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: msdosfs_fat.c,v 1.35 2023/04/30 17:16:36 sf Exp $ */
/* $OpenBSD: msdosfs_fat.c,v 1.36 2023/06/16 08:42:08 sf Exp $ */
/* $NetBSD: msdosfs_fat.c,v 1.26 1997/10/17 11:24:02 ws Exp $ */
/*-
@ -411,7 +411,7 @@ usemap_alloc(struct msdosfsmount *pmp, uint32_t cn)
{
KASSERT(cn <= pmp->pm_maxcluster);
pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
pmp->pm_freeclustercount--;
}
@ -421,7 +421,7 @@ usemap_free(struct msdosfsmount *pmp, uint32_t cn)
KASSERT(cn <= pmp->pm_maxcluster);
pmp->pm_freeclustercount++;
pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS));
pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS));
}
int
@ -652,7 +652,7 @@ chainlength(struct msdosfsmount *pmp, uint32_t start, uint32_t count)
idx = start / N_INUSEBITS;
start %= N_INUSEBITS;
map = pmp->pm_inusemap[idx];
map &= ~((1 << start) - 1);
map &= ~((1U << start) - 1);
if (map) {
len = ffs(map) - 1 - start;
len = MIN(len, count);
@ -759,7 +759,7 @@ clusteralloc(struct msdosfsmount *pmp, uint32_t start, uint32_t count,
for (cn = newst; cn <= pmp->pm_maxcluster;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
map |= (1 << (cn % N_INUSEBITS)) - 1;
map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != (u_int)-1) {
cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@ -776,7 +776,7 @@ clusteralloc(struct msdosfsmount *pmp, uint32_t start, uint32_t count,
for (cn = 0; cn < newst;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
map |= (1 << (cn % N_INUSEBITS)) - 1;
map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != (u_int)-1) {
cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ip6_forward.c,v 1.110 2023/06/01 09:05:33 jan Exp $ */
/* $OpenBSD: ip6_forward.c,v 1.111 2023/06/16 19:18:56 bluhm Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
@ -321,35 +321,30 @@ reroute:
error = tcp_if_output_tso(ifp, &m, sin6tosa(sin6), rt, IFCAP_TSOv6,
ifp->if_mtu);
if (error)
ip6stat_inc(ip6s_cantforward);
else if (m == NULL)
ip6stat_inc(ip6s_forward);
if (error || m == NULL)
goto freecopy;
goto senderr;
/* Check the size after pf_test to give pf a chance to refragment. */
if (m->m_pkthdr.len > ifp->if_mtu) {
if (mcopy)
icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0,
ifp->if_mtu);
m_freem(m);
goto out;
if (m->m_pkthdr.len <= ifp->if_mtu) {
in6_proto_cksum_out(m, ifp);
error = ifp->if_output(ifp, m, sin6tosa(sin6), rt);
if (error)
ip6stat_inc(ip6s_cantforward);
else
ip6stat_inc(ip6s_forward);
goto senderr;
}
in6_proto_cksum_out(m, ifp);
error = ifp->if_output(ifp, m, sin6tosa(sin6), rt);
if (error) {
ip6stat_inc(ip6s_cantforward);
} else {
ip6stat_inc(ip6s_forward);
if (type)
ip6stat_inc(ip6s_redirectsent);
else {
if (mcopy)
goto freecopy;
}
}
if (mcopy != NULL)
icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu);
m_freem(m);
goto out;
#if NPF > 0 || defined(IPSEC)
senderr:
#endif
if (mcopy == NULL)
goto out;
@ -357,6 +352,7 @@ senderr:
case 0:
if (type == ND_REDIRECT) {
icmp6_redirect_output(mcopy, rt);
ip6stat_inc(ip6s_redirectsent);
goto out;
}
goto freecopy;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: clockintr.h,v 1.7 2023/04/20 14:51:28 cheloha Exp $ */
/* $OpenBSD: clockintr.h,v 1.8 2023/06/15 22:18:06 cheloha Exp $ */
/*
* Copyright (c) 2020-2022 Scott Cheloha <cheloha@openbsd.org>
*
@ -129,6 +129,7 @@ void clockintr_trigger(void);
* Kernel API
*/
void clockqueue_init(struct clockintr_queue *);
int sysctl_clockintr(int *, u_int, void *, size_t *, void *, size_t);
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde_community.c,v 1.11 2023/01/30 16:51:34 claudio Exp $ */
/* $OpenBSD: rde_community.c,v 1.12 2023/06/17 08:05:48 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
@ -97,6 +97,16 @@ fc2c(struct community *fc, struct rde_peer *peer, struct community *c,
type = (int32_t)fc->data3 >> 8;
subtype = fc->data3 & 0xff;
if ((fc->flags >> 24 & 0xff) == COMMUNITY_ANY) {
/* special case for 'ext-community * *' */
if (m == NULL)
return -1;
m->data1 = 0;
m->data2 = 0;
m->data3 = 0;
return 0;
}
if (type == -1) {
/* special case for 'ext-community rt *' */
if ((fc->flags >> 8 & 0xff) != COMMUNITY_ANY ||
@ -149,10 +159,11 @@ fc2c(struct community *fc, struct rde_peer *peer, struct community *c,
return 0;
}
if (m) {
m->data1 = 0;
m->data2 = 0;
}
/* this is for 'ext-community subtype *' */
if (m == NULL)
return -1;
m->data1 = 0;
m->data2 = 0;
return 0;
default:
fatalx("%s: unknown type %d", __func__, (uint8_t)c->flags);

View File

@ -1,5 +1,5 @@
%{
/* $OpenBSD: scan.l,v 1.24 2017/07/09 14:04:50 espie Exp $ */
/* $OpenBSD: scan.l,v 1.25 2023/06/16 16:14:34 tb Exp $ */
/* $NetBSD: scan.l,v 1.13 1997/02/02 21:12:37 thorpej Exp $ */
/*
@ -178,8 +178,7 @@ rmoptions return RMOPTIONS;
* Open the "main" file (conffile).
*/
int
firstfile(fname)
const char *fname;
firstfile(const char *fname)
{
if ((yyin = fopen(fname, "r")) == NULL)
@ -197,9 +196,7 @@ firstfile(fname)
* If ateof == 0 then nothing is inserted.
*/
int
include(fname, ateof)
const char *fname;
int ateof;
include(const char *fname, int ateof)
{
FILE *fp;
struct incl *in;

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Getopt.pm,v 1.16 2023/06/13 09:07:17 espie Exp $
# $OpenBSD: Getopt.pm,v 1.17 2023/06/16 06:44:14 espie Exp $
#
# Copyright (c) 2006 Marc Espie <espie@openbsd.org>
#
@ -45,9 +45,8 @@ sub handle_option($opt, $hash, @params)
}
}
sub getopts($args, $hash)
sub getopts($args, $hash = {})
{
$hash = {} unless defined $hash;
local @EXPORT;
while ($_ = shift @ARGV) {

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: PkgCheck.pm,v 1.79 2023/06/13 09:07:17 espie Exp $
# $OpenBSD: PkgCheck.pm,v 1.81 2023/06/16 10:38:29 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@ -213,7 +213,7 @@ sub basic_check($self, $state)
{
$self->SUPER::basic_check($state);
my $name = $state->destdir($self->fullname);
for my $file (OpenBSD::Paths::man_cruft()) {
for my $file (OpenBSD::Paths->man_cruft) {
$state->{known}{$name}{$file} = 1;
}
return 1;
@ -521,7 +521,7 @@ sub run_command($self)
$self->{params} = [];
}
sub result($self)
sub show_results($self)
{
while (@{$self->{params}} > 0) {
$self->run_command;
@ -919,12 +919,12 @@ sub locate_unknown($self, $state)
$locator->add_param($p);
});
}
$locator->result($state);
$locator->show_results;
}
sub fill_localbase($self, $state, $base)
{
for my $file (OpenBSD::Paths::man_cruft()) {
for my $file (OpenBSD::Paths->man_cruft) {
$state->{known}{$base."/man"}{$file} = 1;
}
$state->{known}{$base."/info"}{'dir'} = 1;

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: PkgDelete.pm,v 1.49 2023/06/13 09:07:17 espie Exp $
# $OpenBSD: PkgDelete.pm,v 1.50 2023/06/16 10:08:17 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@ -170,7 +170,7 @@ sub create_locations($state, @l)
my $inst = $state->repo->installed;
my $result = [];
for my $name (@l) {
my $l = $inst->find($name, $state->{arch});
my $l = $inst->find($name);
if (!defined $l) {
$state->errsay("Can't find #1 in installed packages",
$name);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cms.c,v 1.35 2023/06/12 18:22:02 job Exp $ */
/* $OpenBSD: cms.c,v 1.36 2023/06/17 04:46:11 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@ -225,6 +225,9 @@ cms_parse_validate_internal(X509 **xp, const char *fn, const unsigned char *der,
if (has_bst)
warnx("%s: unsupported CMS signing-time attribute", fn);
if (!has_st)
warnx("%s: missing CMS signing-time attribute", fn);
if (CMS_unsigned_get_attr_count(si) != -1) {
cryptowarnx("%s: RFC 6488: CMS has unsignedAttrs", fn);
goto out;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: smtpd.h,v 1.676 2023/05/31 16:51:46 op Exp $ */
/* $OpenBSD: smtpd.h,v 1.677 2023/06/17 08:32:48 op Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@ -55,7 +55,7 @@
#define SMTPD_QUEUE_EXPIRY (4 * 24 * 60 * 60)
#define SMTPD_SOCKET "/var/run/smtpd.sock"
#define SMTPD_NAME "OpenSMTPD"
#define SMTPD_VERSION "7.0.0"
#define SMTPD_VERSION "7.3.0"
#define SMTPD_SESSION_TIMEOUT 300
#define SMTPD_BACKLOG 5