sync with OpenBSD -current
This commit is contained in:
parent
7a404394cf
commit
1bc98b3538
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: buf_subs.c,v 1.31 2019/06/28 13:34:59 deraadt Exp $ */
|
||||
/* $OpenBSD: buf_subs.c,v 1.32 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: buf_subs.c,v 1.5 1995/03/21 09:07:08 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
@ -48,6 +48,9 @@
|
||||
* routines which implement archive and file buffering
|
||||
*/
|
||||
|
||||
static int buf_fill(void);
|
||||
static int buf_flush(int);
|
||||
|
||||
#define MINFBSZ 512 /* default block size for hole detect */
|
||||
#define MAXFLT 10 /* default media read error limit */
|
||||
|
||||
@ -825,7 +828,7 @@ cp_file(ARCHD *arcn, int fd1, int fd2)
|
||||
* 0 when finished (user specified termination in ar_next()).
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
buf_fill(void)
|
||||
{
|
||||
int cnt;
|
||||
@ -873,7 +876,7 @@ buf_fill(void)
|
||||
* 0 if all is ok, -1 when a write error occurs.
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
buf_flush(int bufcnt)
|
||||
{
|
||||
int cnt;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: extern.h,v 1.60 2020/03/23 20:04:19 espie Exp $ */
|
||||
/* $OpenBSD: extern.h,v 1.61 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
@ -92,8 +92,6 @@ int wr_skip(off_t);
|
||||
int wr_rdfile(ARCHD *, int, off_t *);
|
||||
int rd_wrfile(ARCHD *, int, off_t *);
|
||||
void cp_file(ARCHD *, int, int);
|
||||
int buf_fill(void);
|
||||
int buf_flush(int);
|
||||
|
||||
/*
|
||||
* cpio.c
|
||||
@ -127,16 +125,10 @@ int lnk_creat(ARCHD *);
|
||||
int cross_lnk(ARCHD *);
|
||||
int chk_same(ARCHD *);
|
||||
int node_creat(ARCHD *);
|
||||
int unlnk_exist(char *, int);
|
||||
int chk_path(char *, uid_t, gid_t, int);
|
||||
void set_ftime(const char *, const struct timespec *,
|
||||
const struct timespec *, int);
|
||||
void fset_ftime(const char *, int, const struct timespec *,
|
||||
const struct timespec *, int);
|
||||
int set_ids(char *, uid_t, gid_t);
|
||||
int fset_ids(char *, int, uid_t, gid_t);
|
||||
void set_pmode(char *, mode_t);
|
||||
void fset_pmode(char *, int, mode_t);
|
||||
int set_attr(const struct file_times *, int _force_times, mode_t, int _do_mode,
|
||||
int _in_sig);
|
||||
int file_write(int, char *, int, int *, int *, int, char *);
|
||||
@ -178,8 +170,6 @@ extern FSUB fsub[];
|
||||
extern int ford[];
|
||||
void options(int, char **);
|
||||
OPLIST * opt_next(void);
|
||||
int opt_add(const char *);
|
||||
int bad_opt(void);
|
||||
extern char *chdname;
|
||||
|
||||
/*
|
||||
@ -235,7 +225,6 @@ extern char *tempfile;
|
||||
extern char *tempbase;
|
||||
extern int havechd;
|
||||
|
||||
void sig_cleanup(int);
|
||||
|
||||
/*
|
||||
* sel_subs.c
|
||||
@ -279,7 +268,6 @@ int dir_start(void);
|
||||
void add_dir(char *, struct stat *, int);
|
||||
void delete_dir(dev_t, ino_t);
|
||||
void proc_dir(int _in_sig);
|
||||
u_int st_hash(const char *, int, int);
|
||||
|
||||
/*
|
||||
* tar.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: file_subs.c,v 1.55 2020/03/23 20:04:19 espie Exp $ */
|
||||
/* $OpenBSD: file_subs.c,v 1.56 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: file_subs.c,v 1.4 1995/03/21 09:07:18 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
@ -46,8 +46,13 @@
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
|
||||
static int
|
||||
mk_link(char *, struct stat *, char *, int);
|
||||
static int fset_ids(char *, int, uid_t, gid_t);
|
||||
static int unlnk_exist(char *, int);
|
||||
static int chk_path(char *, uid_t, gid_t, int);
|
||||
static int mk_link(char *, struct stat *, char *, int);
|
||||
static void fset_ftime(const char *, int, const struct timespec *,
|
||||
const struct timespec *, int);
|
||||
static void fset_pmode(char *, int, mode_t);
|
||||
|
||||
/*
|
||||
* routines that deal with file operations such as: creating, removing;
|
||||
@ -537,7 +542,7 @@ badlink:
|
||||
* 1 we found a directory and we were going to create a directory.
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
unlnk_exist(char *name, int type)
|
||||
{
|
||||
struct stat sb;
|
||||
@ -715,7 +720,7 @@ set_ftime(const char *fnm, const struct timespec *mtimp,
|
||||
fnm);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
fset_ftime(const char *fnm, int fd, const struct timespec *mtimp,
|
||||
const struct timespec *atimp, int frc)
|
||||
{
|
||||
@ -797,7 +802,7 @@ set_pmode(char *fnm, mode_t mode)
|
||||
syswarn(1, errno, "Could not set permissions on %s", fnm);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
fset_pmode(char *fnm, int fd, mode_t mode)
|
||||
{
|
||||
mode &= ABITS;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: options.c,v 1.105 2023/01/17 16:20:28 tb Exp $ */
|
||||
/* $OpenBSD: options.c,v 1.106 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
@ -49,6 +49,8 @@
|
||||
#include "tar.h"
|
||||
#include "extern.h"
|
||||
|
||||
static int bad_opt(void);
|
||||
static int opt_add(const char *);
|
||||
/*
|
||||
* argv[0] names. Used for tar and cpio emulation
|
||||
*/
|
||||
@ -1104,9 +1106,9 @@ tar_options(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
int mkpath(char *);
|
||||
static int mkpath(char *);
|
||||
|
||||
int
|
||||
static int
|
||||
mkpath(char *path)
|
||||
{
|
||||
struct stat sb;
|
||||
@ -1474,7 +1476,7 @@ opt_next(void)
|
||||
* when the format does not support options.
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
bad_opt(void)
|
||||
{
|
||||
OPLIST *opt;
|
||||
@ -1500,7 +1502,7 @@ bad_opt(void)
|
||||
* 0 if format in name=value format, -1 if -o is passed junk
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
opt_add(const char *str)
|
||||
{
|
||||
OPLIST *opt;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pax.c,v 1.56 2023/11/09 18:54:15 kn Exp $ */
|
||||
/* $OpenBSD: pax.c,v 1.57 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
@ -52,6 +52,7 @@
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
static int gen_init(void);
|
||||
static void sig_cleanup(int);
|
||||
|
||||
/*
|
||||
* PAX main routines, general globals and some simple start up routines
|
||||
@ -337,7 +338,7 @@ main(int argc, char **argv)
|
||||
* never....
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
sig_cleanup(int which_sig)
|
||||
{
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tables.c,v 1.54 2019/06/28 05:35:34 deraadt Exp $ */
|
||||
/* $OpenBSD: tables.c,v 1.55 2023/11/26 16:04:17 espie Exp $ */
|
||||
/* $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
@ -47,6 +47,7 @@
|
||||
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
static u_int st_hash(const char *, int, int);
|
||||
|
||||
/*
|
||||
* Routines for controlling the contents of all the different databases pax
|
||||
@ -1723,7 +1724,7 @@ proc_dir(int in_sig)
|
||||
* the hash value of the string MOD (%) the table size.
|
||||
*/
|
||||
|
||||
u_int
|
||||
static u_int
|
||||
st_hash(const char *name, int len, int tabsz)
|
||||
{
|
||||
const char *pt;
|
||||
|
@ -916,7 +916,8 @@ void AArch64BtiPac::writePlt(uint8_t *buf, const Symbol &sym,
|
||||
// escape to shared objects. isInIplt indicates a non-preemptible ifunc. Its
|
||||
// address may escape if referenced by a direct relocation. The condition is
|
||||
// conservative.
|
||||
bool hasBti = btiHeader && (sym.hasFlag(NEEDS_COPY) || sym.isInIplt);
|
||||
bool hasBti = btiHeader &&
|
||||
(sym.hasFlag(NEEDS_COPY) || sym.isInIplt || sym.thunkAccessed);
|
||||
if (hasBti) {
|
||||
memcpy(buf, btiData, sizeof(btiData));
|
||||
buf += sizeof(btiData);
|
||||
|
@ -25,7 +25,7 @@ using namespace llvm::ELF;
|
||||
using namespace lld;
|
||||
using namespace lld::elf;
|
||||
|
||||
static_assert(sizeof(SymbolUnion) <= 64, "SymbolUnion too large");
|
||||
static_assert(sizeof(SymbolUnion) <= 72, "SymbolUnion too large");
|
||||
|
||||
template <typename T> struct AssertSymbol {
|
||||
static_assert(std::is_trivially_destructible<T>(),
|
||||
|
@ -295,6 +295,9 @@ public:
|
||||
// True if defined in a DSO as protected visibility.
|
||||
uint8_t dsoProtected : 1;
|
||||
|
||||
// True if targeted by a range extension thunk.
|
||||
uint8_t thunkAccessed : 1;
|
||||
|
||||
// Temporary flags used to communicate which symbol entries need PLT and GOT
|
||||
// entries during postScanRelocations();
|
||||
std::atomic<uint16_t> flags;
|
||||
|
@ -1217,7 +1217,9 @@ bool PPC64LongBranchThunk::isCompatibleWith(const InputSection &isec,
|
||||
return rel.type == R_PPC64_REL24 || rel.type == R_PPC64_REL14;
|
||||
}
|
||||
|
||||
Thunk::Thunk(Symbol &d, int64_t a) : destination(d), addend(a), offset(0) {}
|
||||
Thunk::Thunk(Symbol &d, int64_t a) : destination(d), addend(a), offset(0) {
|
||||
destination.thunkAccessed = true;
|
||||
}
|
||||
|
||||
Thunk::~Thunk() = default;
|
||||
|
||||
|
@ -24250,7 +24250,7 @@ S_parse_uniprop_string(pTHX_
|
||||
* compile perl to know about them) */
|
||||
bool is_nv_type = FALSE;
|
||||
|
||||
unsigned int i, j = 0;
|
||||
unsigned int i = 0, i_zero = 0, j = 0;
|
||||
int equals_pos = -1; /* Where the '=' is found, or negative if none */
|
||||
int slash_pos = -1; /* Where the '/' is found, or negative if none */
|
||||
int table_index = 0; /* The entry number for this property in the table
|
||||
@ -24384,9 +24384,13 @@ S_parse_uniprop_string(pTHX_
|
||||
* all of them are considered to be for that package. For the purposes of
|
||||
* parsing the rest of the property, strip it off */
|
||||
if (non_pkg_begin == STRLENs("utf8::") && memBEGINPs(name, name_len, "utf8::")) {
|
||||
lookup_name += STRLENs("utf8::");
|
||||
j -= STRLENs("utf8::");
|
||||
equals_pos -= STRLENs("utf8::");
|
||||
lookup_name += STRLENs("utf8::");
|
||||
j -= STRLENs("utf8::");
|
||||
equals_pos -= STRLENs("utf8::");
|
||||
i_zero = STRLENs("utf8::"); /* When resetting 'i' to reparse
|
||||
from the beginning, it has to be
|
||||
set past what we're stripping
|
||||
off */
|
||||
stripped_utf8_pkg = TRUE;
|
||||
}
|
||||
|
||||
@ -24800,7 +24804,8 @@ S_parse_uniprop_string(pTHX_
|
||||
|
||||
/* We set the inputs back to 0 and the code below will reparse,
|
||||
* using strict */
|
||||
i = j = 0;
|
||||
i = i_zero;
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24821,7 +24826,7 @@ S_parse_uniprop_string(pTHX_
|
||||
* separates two digits */
|
||||
if (cur == '_') {
|
||||
if ( stricter
|
||||
&& ( i == 0 || (int) i == equals_pos || i == name_len- 1
|
||||
&& ( i == i_zero || (int) i == equals_pos || i == name_len- 1
|
||||
|| ! isDIGIT_A(name[i-1]) || ! isDIGIT_A(name[i+1])))
|
||||
{
|
||||
lookup_name[j++] = '_';
|
||||
|
@ -2688,6 +2688,14 @@ EOF_DEBUG_OUT
|
||||
{}, "Related to Github Issue #19350, forward \\g{x} pattern segv under use re Debug => 'PARSE'");
|
||||
}
|
||||
|
||||
{ # perl-security#140, read/write past buffer end
|
||||
fresh_perl_like('qr/\p{utf8::perl x}/',
|
||||
qr/Illegal user-defined property name "utf8::perl x" in regex/,
|
||||
{}, "perl-security#140");
|
||||
fresh_perl_is('qr/\p{utf8::_perl_surrogate}/', "",
|
||||
{}, "perl-security#140");
|
||||
}
|
||||
|
||||
|
||||
# !!! NOTE that tests that aren't at all likely to crash perl should go
|
||||
# a ways above, above these last ones. There's a comment there that, like
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: obj_dat.c,v 1.61 2023/09/05 14:59:00 tb Exp $ */
|
||||
/* $OpenBSD: obj_dat.c,v 1.62 2023/11/27 11:52:32 tb Exp $ */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -477,8 +477,8 @@ OBJ_txt2obj(const char *s, int no_name)
|
||||
int nid;
|
||||
|
||||
if (!no_name) {
|
||||
if (((nid = OBJ_sn2nid(s)) != NID_undef) ||
|
||||
((nid = OBJ_ln2nid(s)) != NID_undef) )
|
||||
if ((nid = OBJ_sn2nid(s)) != NID_undef ||
|
||||
(nid = OBJ_ln2nid(s)) != NID_undef)
|
||||
return OBJ_nid2obj(nid);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: x509_vfy.c,v 1.126 2023/11/13 10:33:00 tb Exp $ */
|
||||
/* $OpenBSD: x509_vfy.c,v 1.127 2023/11/27 00:51:12 tb Exp $ */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -2200,20 +2200,6 @@ X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk)
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_set0_crls);
|
||||
|
||||
int
|
||||
X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose)
|
||||
{
|
||||
return X509_STORE_CTX_purpose_inherit(ctx, 0, purpose, 0);
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_set_purpose);
|
||||
|
||||
int
|
||||
X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust)
|
||||
{
|
||||
return X509_STORE_CTX_purpose_inherit(ctx, 0, 0, trust);
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_set_trust);
|
||||
|
||||
/* This function is used to set the X509_STORE_CTX purpose and trust
|
||||
* values. This is intended to be used when another structure has its
|
||||
* own trust and purpose values which (if set) will be inherited by
|
||||
@ -2270,6 +2256,20 @@ X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_purpose_inherit);
|
||||
|
||||
int
|
||||
X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose)
|
||||
{
|
||||
return X509_STORE_CTX_purpose_inherit(ctx, 0, purpose, 0);
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_set_purpose);
|
||||
|
||||
int
|
||||
X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust)
|
||||
{
|
||||
return X509_STORE_CTX_purpose_inherit(ctx, 0, 0, trust);
|
||||
}
|
||||
LCRYPTO_ALIAS(X509_STORE_CTX_set_trust);
|
||||
|
||||
X509_STORE_CTX *
|
||||
X509_STORE_CTX_new(void)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: vmm_machdep.c,v 1.10 2023/11/24 21:48:25 dv Exp $ */
|
||||
/* $OpenBSD: vmm_machdep.c,v 1.11 2023/11/26 13:02:44 dv Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
|
||||
*
|
||||
@ -4155,7 +4155,7 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp)
|
||||
|
||||
if (vcpu->vc_vmx_vpid_enabled) {
|
||||
/* Invalidate old TLB mappings */
|
||||
vid.vid_vpid = vcpu->vc_parent->vm_id;
|
||||
vid.vid_vpid = vcpu->vc_vpid;
|
||||
vid.vid_addr = 0;
|
||||
invvpid(IA32_VMX_INVVPID_SINGLE_CTX_GLB, &vid);
|
||||
}
|
||||
@ -5447,7 +5447,7 @@ vmx_handle_cr0_write(struct vcpu *vcpu, uint64_t r)
|
||||
/* Paging was disabled (prev. enabled) - Flush TLB */
|
||||
if (vmm_softc->mode == VMM_MODE_EPT &&
|
||||
vcpu->vc_vmx_vpid_enabled) {
|
||||
vid.vid_vpid = vcpu->vc_parent->vm_id;
|
||||
vid.vid_vpid = vcpu->vc_vpid;
|
||||
vid.vid_addr = 0;
|
||||
invvpid(IA32_VMX_INVVPID_SINGLE_CTX_GLB, &vid);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: rtkit.c,v 1.12 2023/04/07 09:31:59 jsg Exp $ */
|
||||
/* $OpenBSD: rtkit.c,v 1.13 2023/11/25 18:12:20 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
@ -77,9 +77,14 @@
|
||||
#define RTKIT_IOREPORT_UNKNOWN2 12
|
||||
|
||||
#define RTKIT_OSLOG_TYPE(x) (((x) >> 56) & 0xff)
|
||||
#define RTKIT_OSLOG_TYPE_SHIFT 56
|
||||
#define RTKIT_OSLOG_INIT 1ULL
|
||||
#define RTKIT_OSLOG_ACK 3ULL
|
||||
#define RTKIT_OSLOG_TYPE_SHIFT (56 - RTKIT_MGMT_TYPE_SHIFT)
|
||||
#define RTKIT_OSLOG_BUFFER_REQUEST 1
|
||||
#define RTKIT_OSLOG_BUFFER_ADDR(x) (((x) >> 0) & 0xfffffffff)
|
||||
#define RTKIT_OSLOG_BUFFER_SIZE(x) (((x) >> 36) & 0xfffff)
|
||||
#define RTKIT_OSLOG_BUFFER_SIZE_SHIFT 36
|
||||
#define RTKIT_OSLOG_UNKNOWN1 3
|
||||
#define RTKIT_OSLOG_UNKNOWN2 4
|
||||
#define RTKIT_OSLOG_UNKNOWN3 5
|
||||
|
||||
/* Versions we support. */
|
||||
#define RTKIT_MINVER 11
|
||||
@ -253,7 +258,7 @@ rtkit_handle_mgmt(struct rtkit_state *state, struct aplmbox_msg *msg)
|
||||
default:
|
||||
printf("%s: unhandled management event 0x%016lld\n",
|
||||
__func__, msg->data0);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -289,7 +294,7 @@ rtkit_handle_crashlog(struct rtkit_state *state, struct aplmbox_msg *msg)
|
||||
default:
|
||||
printf("%s: unhandled crashlog event 0x%016llx\n",
|
||||
__func__, msg->data0);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -333,7 +338,7 @@ rtkit_handle_syslog(struct rtkit_state *state, struct aplmbox_msg *msg)
|
||||
default:
|
||||
printf("%s: unhandled syslog event 0x%016llx\n",
|
||||
__func__, msg->data0);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -377,7 +382,7 @@ rtkit_handle_ioreport(struct rtkit_state *state, struct aplmbox_msg *msg)
|
||||
default:
|
||||
printf("%s: unhandled ioreport event 0x%016llx\n",
|
||||
__func__, msg->data0);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -387,19 +392,39 @@ int
|
||||
rtkit_handle_oslog(struct rtkit_state *state, struct aplmbox_msg *msg)
|
||||
{
|
||||
struct mbox_channel *mc = state->mc;
|
||||
struct rtkit *rk = state->rk;
|
||||
bus_addr_t addr;
|
||||
bus_size_t size;
|
||||
int error;
|
||||
|
||||
switch (RTKIT_OSLOG_TYPE(msg->data0)) {
|
||||
case RTKIT_OSLOG_INIT:
|
||||
case RTKIT_OSLOG_BUFFER_REQUEST:
|
||||
addr = RTKIT_OSLOG_BUFFER_ADDR(msg->data0) << PAGE_SHIFT;
|
||||
size = RTKIT_OSLOG_BUFFER_SIZE(msg->data0);
|
||||
if (addr)
|
||||
break;
|
||||
|
||||
if (rk) {
|
||||
addr = rtkit_alloc(state, size);
|
||||
if (addr == (bus_addr_t)-1)
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
error = rtkit_send(mc, RTKIT_EP_OSLOG,
|
||||
0, RTKIT_OSLOG_ACK << RTKIT_OSLOG_TYPE_SHIFT);
|
||||
(RTKIT_OSLOG_BUFFER_REQUEST << RTKIT_OSLOG_TYPE_SHIFT),
|
||||
(size << RTKIT_OSLOG_BUFFER_SIZE_SHIFT) |
|
||||
(addr >> PAGE_SHIFT));
|
||||
if (error)
|
||||
return error;
|
||||
break;
|
||||
case RTKIT_OSLOG_UNKNOWN1:
|
||||
case RTKIT_OSLOG_UNKNOWN2:
|
||||
case RTKIT_OSLOG_UNKNOWN3:
|
||||
break;
|
||||
default:
|
||||
printf("%s: unhandled oslog event 0x%016llx\n",
|
||||
__func__, msg->data0);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -456,7 +481,7 @@ rtkit_poll(struct rtkit_state *state)
|
||||
}
|
||||
|
||||
printf("%s: unhandled endpoint %d\n", __func__, msg.data1);
|
||||
return EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -549,8 +574,9 @@ rtkit_set_ap_pwrstate(struct rtkit_state *state, uint16_t pwrstate)
|
||||
delay(10);
|
||||
continue;
|
||||
}
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
KASSERT(error == 0);
|
||||
if (state->ap_pwrstate == pwrstate)
|
||||
break;
|
||||
}
|
||||
@ -578,8 +604,9 @@ rtkit_set_iop_pwrstate(struct rtkit_state *state, uint16_t pwrstate)
|
||||
delay(10);
|
||||
continue;
|
||||
}
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
KASSERT(error == 0);
|
||||
if (state->iop_pwrstate == pwrstate)
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pchgpio.c,v 1.14 2022/10/20 20:40:57 kettenis Exp $ */
|
||||
/* $OpenBSD: pchgpio.c,v 1.15 2023/11/27 00:39:42 jsg Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2020 Mark Kettenis
|
||||
* Copyright (c) 2020 James Hastings
|
||||
@ -115,6 +115,9 @@ const char *pchgpio_hids[] = {
|
||||
"INT34C5",
|
||||
"INT34C6",
|
||||
"INTC1055",
|
||||
"INTC1056",
|
||||
"INTC1057",
|
||||
"INTC1085",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -311,6 +314,78 @@ const struct pchgpio_device tgl_h_device =
|
||||
.npins = 480,
|
||||
};
|
||||
|
||||
/* Alder Lake-S */
|
||||
|
||||
const struct pchgpio_group adl_s_groups[] =
|
||||
{
|
||||
/* Community 0 */
|
||||
{ 0, 0, 0, 24, 0 }, /* GPP_I */
|
||||
{ 0, 1, 25, 47, 32 }, /* GPP_R */
|
||||
{ 0, 2, 48, 59, 64 }, /* GPP_J */
|
||||
|
||||
/* Community 1 */
|
||||
{ 1, 0, 95, 118, 160 }, /* GPP_B */
|
||||
{ 1, 1, 119, 126, 192 }, /* GPP_G */
|
||||
{ 1, 2, 127, 150, 224 }, /* GPP_H */
|
||||
|
||||
/* Community 3 */
|
||||
{ 2, 1, 160, 175, 256 }, /* GPP_A */
|
||||
{ 2, 2, 176, 199, 288 }, /* GPP_C */
|
||||
|
||||
/* Community 4 */
|
||||
{ 3, 0, 200, 207, 320 }, /* GPP_S */
|
||||
{ 3, 1, 208, 230, 352 }, /* GPP_E */
|
||||
{ 3, 2, 231, 245, 384 }, /* GPP_K */
|
||||
{ 3, 3, 246, 269, 416 }, /* GPP_F */
|
||||
|
||||
/* Community 5 */
|
||||
{ 4, 0, 270, 294, 448 }, /* GPP_D */
|
||||
};
|
||||
|
||||
const struct pchgpio_device adl_s_device =
|
||||
{
|
||||
.pad_size = 16,
|
||||
.gpi_is = 0x200,
|
||||
.gpi_ie = 0x220,
|
||||
.groups = adl_s_groups,
|
||||
.ngroups = nitems(adl_s_groups),
|
||||
.npins = 480,
|
||||
};
|
||||
|
||||
/* Alder Lake-N */
|
||||
|
||||
const struct pchgpio_group adl_n_groups[] =
|
||||
{
|
||||
/* Community 0 */
|
||||
{ 0, 0, 0, 25, 0 }, /* GPP_B */
|
||||
{ 0, 1, 26, 41, 32 }, /* GPP_T */
|
||||
{ 0, 2, 42, 66, 64 }, /* GPP_A */
|
||||
|
||||
/* Community 1 */
|
||||
{ 1, 0, 67, 74, 96 }, /* GPP_S */
|
||||
{ 1, 1, 75, 94, 128 }, /* GPP_I */
|
||||
{ 1, 2, 95, 118, 160 }, /* GPP_H */
|
||||
{ 1, 3, 119, 139, 192 }, /* GPP_D */
|
||||
|
||||
/* Community 4 */
|
||||
{ 2, 0, 169, 192, 256 }, /* GPP_C */
|
||||
{ 2, 1, 193, 217, 288 }, /* GPP_F */
|
||||
{ 2, 3, 224, 248, 320 }, /* GPP_E */
|
||||
|
||||
/* Community 5 */
|
||||
{ 3, 0, 249, 256, 352 }, /* GPP_R */
|
||||
};
|
||||
|
||||
const struct pchgpio_device adl_n_device =
|
||||
{
|
||||
.pad_size = 16,
|
||||
.gpi_is = 0x100,
|
||||
.gpi_ie = 0x120,
|
||||
.groups = adl_n_groups,
|
||||
.ngroups = nitems(adl_n_groups),
|
||||
.npins = 384,
|
||||
};
|
||||
|
||||
struct pchgpio_match pchgpio_devices[] = {
|
||||
{ "INT344B", &spt_lp_device },
|
||||
{ "INT3450", &cnl_h_device },
|
||||
@ -320,6 +395,9 @@ struct pchgpio_match pchgpio_devices[] = {
|
||||
{ "INT34C5", &tgl_lp_device },
|
||||
{ "INT34C6", &tgl_h_device },
|
||||
{ "INTC1055", &tgl_lp_device },
|
||||
{ "INTC1056", &adl_s_device },
|
||||
{ "INTC1057", &adl_n_device },
|
||||
{ "INTC1085", &adl_s_device },
|
||||
};
|
||||
|
||||
int pchgpio_read_pin(void *, int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: rkclock.c,v 1.83 2023/09/29 15:51:48 kettenis Exp $ */
|
||||
/* $OpenBSD: rkclock.c,v 1.84 2023/11/26 13:47:45 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
@ -4107,6 +4107,11 @@ const struct rkclock rk3588_clocks[] = {
|
||||
{ RK3588_CLK_GPU_SRC },
|
||||
SET_PARENT
|
||||
},
|
||||
{
|
||||
RK3588_CCLK_SRC_SDIO, RK3588_CRU_CLKSEL_CON(172),
|
||||
SEL(9, 8), DIV(7, 2),
|
||||
{ RK3588_PLL_GPLL, RK3588_PLL_CPLL, RK3588_XIN24M }
|
||||
},
|
||||
{
|
||||
RK3588_ACLK_VOP_ROOT, RK3588_CRU_CLKSEL_CON(110),
|
||||
SEL(7, 5), DIV(4, 0),
|
||||
@ -4292,6 +4297,9 @@ rk3588_set_pll(struct rkclock_softc *sc, bus_size_t base, uint32_t freq)
|
||||
case 1188000000U:
|
||||
p = 2; m = 198; s = 1; k = 0;
|
||||
break;
|
||||
case 1100000000U:
|
||||
p = 3; m = 550; s = 2; k = 0;
|
||||
break;
|
||||
case 850000000U:
|
||||
p = 3; m = 425; s = 2; k = 0;
|
||||
break;
|
||||
@ -4476,6 +4484,10 @@ rk3588_reset(void *cookie, uint32_t *cells, int on)
|
||||
reg = RK3588_CRU_SOFTRST_CON(34);
|
||||
bit = 0;
|
||||
break;
|
||||
case RK3588_SRST_A_USB3OTG2:
|
||||
reg = RK3588_CRU_SOFTRST_CON(35);
|
||||
bit = 7;
|
||||
break;
|
||||
case RK3588_SRST_A_USB3OTG0:
|
||||
reg = RK3588_CRU_SOFTRST_CON(42);
|
||||
bit = 4;
|
||||
|
@ -458,6 +458,7 @@
|
||||
#define RK3588_ACLK_LOW_TOP_ROOT 258
|
||||
#define RK3588_CLK_GPU_SRC 261
|
||||
#define RK3588_CLK_GPU 262
|
||||
#define RK3588_CCLK_SRC_SDIO 395
|
||||
#define RK3588_ACLK_VOP_ROOT 600
|
||||
#define RK3588_ACLK_VOP 605
|
||||
#define RK3588_ACLK_VOP_SUB_SRC 619
|
||||
@ -497,6 +498,7 @@
|
||||
#define RK3588_SRST_P_PCIE2 301
|
||||
#define RK3588_SRST_P_PCIE3 302
|
||||
#define RK3588_SRST_P_PCIE4 303
|
||||
#define RK3588_SRST_A_USB3OTG2 308
|
||||
#define RK3588_SRST_A_USB3OTG0 338
|
||||
#define RK3588_SRST_A_USB3OTG1 339
|
||||
#define RK3588_SRST_REF_PIPE_PHY0 572
|
||||
|
@ -309,10 +309,14 @@ static const struct pci_matchid i915_devices[] = {
|
||||
{ 0x8086, 0xa789 },
|
||||
{ 0x8086, 0xa78a },
|
||||
{ 0x8086, 0xa78b },
|
||||
{ 0x8086, 0xa720 },
|
||||
{ 0x8086, 0xa721 },
|
||||
{ 0x8086, 0xa7a0 },
|
||||
{ 0x8086, 0xa7a1 },
|
||||
{ 0x8086, 0xa7a8 },
|
||||
{ 0x8086, 0xa7a9 },
|
||||
{ 0x8086, 0xa7ac },
|
||||
{ 0x8086, 0xa7ad },
|
||||
{ 0x8086, 0xa720 },
|
||||
{ 0x8086, 0xa7a0 },
|
||||
{ 0x8086, 0xa7a8 },
|
||||
{ 0x8086, 0xa7aa },
|
||||
{ 0x8086, 0xa7ab },
|
||||
};
|
||||
|
@ -685,14 +685,22 @@
|
||||
INTEL_VGA_DEVICE(0xA78A, info), \
|
||||
INTEL_VGA_DEVICE(0xA78B, info)
|
||||
|
||||
/* RPL-U */
|
||||
#define INTEL_RPLU_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0xA721, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A1, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A9, info), \
|
||||
INTEL_VGA_DEVICE(0xA7AC, info), \
|
||||
INTEL_VGA_DEVICE(0xA7AD, info)
|
||||
|
||||
/* RPL-P */
|
||||
#define INTEL_RPLP_IDS(info) \
|
||||
INTEL_RPLU_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0xA720, info), \
|
||||
INTEL_VGA_DEVICE(0xA721, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A0, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A1, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A8, info), \
|
||||
INTEL_VGA_DEVICE(0xA7A9, info)
|
||||
INTEL_VGA_DEVICE(0xA7AA, info), \
|
||||
INTEL_VGA_DEVICE(0xA7AB, info)
|
||||
|
||||
/* DG2 */
|
||||
#define INTEL_DG2_G10_IDS(info) \
|
||||
|
@ -1,4 +1,4 @@
|
||||
$OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp $
|
||||
$OpenBSD: pcidevs,v 1.2057 2023/11/26 05:47:21 jsg Exp $
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
@ -7026,7 +7026,7 @@ product INTEL RPL_DTT 0xa71d Core 13G DTT
|
||||
product INTEL RPL_XHCI 0xa71e Core 13G xHCI
|
||||
product INTEL RPL_TBT_PCIE3 0xa71f Core 13G PCIE
|
||||
product INTEL RPL_P_GT_1 0xa720 Graphics
|
||||
product INTEL RPL_P_GT_2 0xa721 Graphics
|
||||
product INTEL RPL_U_GT_1 0xa721 Graphics
|
||||
product INTEL RPL_HX_HB_4 0xa728 Core 13G Host
|
||||
product INTEL RPL_HX_HB_5 0xa729 Core 13G Host
|
||||
product INTEL RPL_HX_HB_6 0xa72a Core 13G Host
|
||||
@ -7050,10 +7050,14 @@ product INTEL RPL_S_GT_5 0xa788 Graphics
|
||||
product INTEL RPL_S_GT_6 0xa789 Graphics
|
||||
product INTEL RPL_S_GT_7 0xa78a Graphics
|
||||
product INTEL RPL_S_GT_8 0xa78b Graphics
|
||||
product INTEL RPL_P_GT_3 0xa7a0 Graphics
|
||||
product INTEL RPL_P_GT_4 0xa7a1 Graphics
|
||||
product INTEL RPL_P_GT_5 0xa7a8 Graphics
|
||||
product INTEL RPL_P_GT_6 0xa7a9 Graphics
|
||||
product INTEL RPL_P_GT_2 0xa7a0 Graphics
|
||||
product INTEL RPL_U_GT_2 0xa7a1 Graphics
|
||||
product INTEL RPL_P_GT_3 0xa7a8 Graphics
|
||||
product INTEL RPL_U_GT_3 0xa7a9 Graphics
|
||||
product INTEL RPL_P_GT_4 0xa7aa Graphics
|
||||
product INTEL RPL_P_GT_5 0xa7ab Graphics
|
||||
product INTEL RPL_U_GT_4 0xa7ac Graphics
|
||||
product INTEL RPL_U_GT_5 0xa7ad Graphics
|
||||
product INTEL 21152 0xb152 S21152BB
|
||||
product INTEL 21154 0xb154 21154AE/BE
|
||||
product INTEL CORE_DMI_0 0xd130 Core DMI
|
||||
|
@ -2,7 +2,7 @@
|
||||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp
|
||||
* OpenBSD: pcidevs,v 1.2057 2023/11/26 05:47:21 jsg Exp
|
||||
*/
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
@ -7031,7 +7031,7 @@
|
||||
#define PCI_PRODUCT_INTEL_RPL_XHCI 0xa71e /* Core 13G xHCI */
|
||||
#define PCI_PRODUCT_INTEL_RPL_TBT_PCIE3 0xa71f /* Core 13G PCIE */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_1 0xa720 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_2 0xa721 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_U_GT_1 0xa721 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_HX_HB_4 0xa728 /* Core 13G Host */
|
||||
#define PCI_PRODUCT_INTEL_RPL_HX_HB_5 0xa729 /* Core 13G Host */
|
||||
#define PCI_PRODUCT_INTEL_RPL_HX_HB_6 0xa72a /* Core 13G Host */
|
||||
@ -7055,10 +7055,14 @@
|
||||
#define PCI_PRODUCT_INTEL_RPL_S_GT_6 0xa789 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_S_GT_7 0xa78a /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_S_GT_8 0xa78b /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_3 0xa7a0 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_4 0xa7a1 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_5 0xa7a8 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_6 0xa7a9 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_2 0xa7a0 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_U_GT_2 0xa7a1 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_3 0xa7a8 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_U_GT_3 0xa7a9 /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_4 0xa7aa /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_P_GT_5 0xa7ab /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_U_GT_4 0xa7ac /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_RPL_U_GT_5 0xa7ad /* Graphics */
|
||||
#define PCI_PRODUCT_INTEL_21152 0xb152 /* S21152BB */
|
||||
#define PCI_PRODUCT_INTEL_21154 0xb154 /* 21154AE/BE */
|
||||
#define PCI_PRODUCT_INTEL_CORE_DMI_0 0xd130 /* Core DMI */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp
|
||||
* OpenBSD: pcidevs,v 1.2057 2023/11/26 05:47:21 jsg Exp
|
||||
*/
|
||||
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
@ -25464,7 +25464,7 @@ static const struct pci_known_product pci_known_products[] = {
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_P_GT_2,
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_U_GT_1,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
@ -25559,10 +25559,22 @@ static const struct pci_known_product pci_known_products[] = {
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_S_GT_8,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_P_GT_2,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_U_GT_2,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_P_GT_3,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_U_GT_3,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_P_GT_4,
|
||||
"Graphics",
|
||||
@ -25572,7 +25584,11 @@ static const struct pci_known_product pci_known_products[] = {
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_P_GT_6,
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_U_GT_4,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_RPL_U_GT_5,
|
||||
"Graphics",
|
||||
},
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: in_pcb.h,v 1.137 2023/11/12 23:19:15 bluhm Exp $ */
|
||||
/* $OpenBSD: in_pcb.h,v 1.138 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -141,7 +141,7 @@ struct inpcb {
|
||||
} inp_mou;
|
||||
#define inp_moptions inp_mou.mou_mo
|
||||
#define inp_moptions6 inp_mou.mou_mo6
|
||||
u_char inp_seclevel[4];
|
||||
u_char inp_seclevel[4]; /* [N] IPsec level of socket */
|
||||
#define SL_AUTH 0 /* Authentication level */
|
||||
#define SL_ESP_TRANS 1 /* ESP transport level */
|
||||
#define SL_ESP_NETWORK 2 /* ESP network (encapsulation) level */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip_ipsp.h,v 1.243 2023/10/11 22:13:16 tobhe Exp $ */
|
||||
/* $OpenBSD: ip_ipsp.h,v 1.244 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/*
|
||||
* The authors of this code are John Ioannidis (ji@tla.org),
|
||||
* Angelos D. Keromytis (kermit@csd.uch.gr),
|
||||
@ -671,7 +671,7 @@ int checkreplaywindow(struct tdb *, u_int64_t, u_int32_t, u_int32_t *, int);
|
||||
int ipsp_process_packet(struct mbuf *, struct tdb *, int, int);
|
||||
int ipsp_process_done(struct mbuf *, struct tdb *);
|
||||
int ipsp_spd_lookup(struct mbuf *, int, int, int, struct tdb *,
|
||||
struct inpcb *, struct tdb **, struct ipsec_ids *);
|
||||
const u_char[], struct tdb **, struct ipsec_ids *);
|
||||
int ipsp_is_unspecified(union sockaddr_union);
|
||||
int ipsp_aux_match(struct tdb *, struct ipsec_ids *,
|
||||
struct sockaddr_encap *, struct sockaddr_encap *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip_output.c,v 1.390 2023/07/07 08:05:02 bluhm Exp $ */
|
||||
/* $OpenBSD: ip_output.c,v 1.391 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@ void ip_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in *);
|
||||
static u_int16_t in_cksum_phdr(u_int32_t, u_int32_t, u_int32_t);
|
||||
void in_delayed_cksum(struct mbuf *);
|
||||
|
||||
int ip_output_ipsec_lookup(struct mbuf *m, int hlen, struct inpcb *inp,
|
||||
int ip_output_ipsec_lookup(struct mbuf *m, int hlen, const u_char seclevel[],
|
||||
struct tdb **, int ipsecflowinfo);
|
||||
void ip_output_ipsec_pmtu_update(struct tdb *, struct route *, struct in_addr,
|
||||
int, int);
|
||||
@ -98,7 +98,7 @@ int ip_output_ipsec_send(struct tdb *, struct mbuf *, struct route *, int);
|
||||
*/
|
||||
int
|
||||
ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
||||
struct ip_moptions *imo, struct inpcb *inp, u_int32_t ipsecflowinfo)
|
||||
struct ip_moptions *imo, const u_char seclevel[], u_int32_t ipsecflowinfo)
|
||||
{
|
||||
struct ip *ip;
|
||||
struct ifnet *ifp = NULL;
|
||||
@ -115,11 +115,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
||||
|
||||
NET_ASSERT_LOCKED();
|
||||
|
||||
#ifdef IPSEC
|
||||
if (inp && (inp->inp_flags & INP_IPV6) != 0)
|
||||
panic("ip_output: IPv6 pcb is passed");
|
||||
#endif /* IPSEC */
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if ((m->m_flags & M_PKTHDR) == 0)
|
||||
panic("ip_output no HDR");
|
||||
@ -240,9 +235,9 @@ reroute:
|
||||
}
|
||||
|
||||
#ifdef IPSEC
|
||||
if (ipsec_in_use || inp != NULL) {
|
||||
if (ipsec_in_use || seclevel != NULL) {
|
||||
/* Do we have any pending SAs to apply ? */
|
||||
error = ip_output_ipsec_lookup(m, hlen, inp, &tdb,
|
||||
error = ip_output_ipsec_lookup(m, hlen, seclevel, &tdb,
|
||||
ipsecflowinfo);
|
||||
if (error) {
|
||||
/* Should silently drop packet */
|
||||
@ -514,7 +509,7 @@ bad:
|
||||
|
||||
#ifdef IPSEC
|
||||
int
|
||||
ip_output_ipsec_lookup(struct mbuf *m, int hlen, struct inpcb *inp,
|
||||
ip_output_ipsec_lookup(struct mbuf *m, int hlen, const u_char seclevel[],
|
||||
struct tdb **tdbout, int ipsecflowinfo)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
@ -527,7 +522,7 @@ ip_output_ipsec_lookup(struct mbuf *m, int hlen, struct inpcb *inp,
|
||||
if (ipsecflowinfo)
|
||||
ids = ipsp_ids_lookup(ipsecflowinfo);
|
||||
error = ipsp_spd_lookup(m, AF_INET, hlen, IPSP_DIRECTION_OUT,
|
||||
NULL, inp, &tdb, ids);
|
||||
NULL, seclevel, &tdb, ids);
|
||||
ipsp_ids_free(ids);
|
||||
if (error || tdb == NULL) {
|
||||
*tdbout = NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip_spd.c,v 1.118 2023/04/22 20:51:56 mvs Exp $ */
|
||||
/* $OpenBSD: ip_spd.c,v 1.119 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/*
|
||||
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
|
||||
*
|
||||
@ -39,7 +39,7 @@
|
||||
#include <netinet/ip_ipsp.h>
|
||||
#include <net/pfkeyv2.h>
|
||||
|
||||
int ipsp_spd_inp(struct mbuf *, struct inpcb *, struct ipsec_policy *,
|
||||
int ipsp_spd_inp(struct mbuf *, const u_char *, struct ipsec_policy *,
|
||||
struct tdb **);
|
||||
int ipsp_acquire_sa(struct ipsec_policy *, union sockaddr_union *,
|
||||
union sockaddr_union *, struct sockaddr_encap *, struct mbuf *);
|
||||
@ -153,7 +153,7 @@ spd_table_walk(unsigned int rtableid,
|
||||
*/
|
||||
int
|
||||
ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
struct tdb *tdbin, struct inpcb *inp, struct tdb **tdbout,
|
||||
struct tdb *tdbin, const u_char seclevel[], struct tdb **tdbout,
|
||||
struct ipsec_ids *ipsecflowinfo_ids)
|
||||
{
|
||||
struct radix_node_head *rnh;
|
||||
@ -172,15 +172,15 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
* continuing with the SPD lookup.
|
||||
*/
|
||||
if (!ipsec_in_use)
|
||||
return ipsp_spd_inp(m, inp, NULL, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, NULL, tdbout);
|
||||
|
||||
/*
|
||||
* If an input packet is destined to a BYPASS socket, just accept it.
|
||||
*/
|
||||
if ((inp != NULL) && (direction == IPSP_DIRECTION_IN) &&
|
||||
(inp->inp_seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS) &&
|
||||
(inp->inp_seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_BYPASS) &&
|
||||
(inp->inp_seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)) {
|
||||
if ((seclevel != NULL) && (direction == IPSP_DIRECTION_IN) &&
|
||||
(seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS) &&
|
||||
(seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_BYPASS) &&
|
||||
(seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)) {
|
||||
if (tdbout != NULL)
|
||||
*tdbout = NULL;
|
||||
return 0;
|
||||
@ -311,13 +311,13 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
* Return whatever the socket requirements are, there are no
|
||||
* system-wide policies.
|
||||
*/
|
||||
return ipsp_spd_inp(m, inp, NULL, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, NULL, tdbout);
|
||||
}
|
||||
ipo = (struct ipsec_policy *)rn;
|
||||
|
||||
switch (ipo->ipo_type) {
|
||||
case IPSP_PERMIT:
|
||||
return ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
|
||||
case IPSP_DENY:
|
||||
return EHOSTUNREACH;
|
||||
@ -384,11 +384,10 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
* gateway/endhost, and the socket has the BYPASS
|
||||
* option set, skip IPsec processing.
|
||||
*/
|
||||
if ((inp != NULL) &&
|
||||
(inp->inp_seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS) &&
|
||||
(inp->inp_seclevel[SL_ESP_NETWORK] ==
|
||||
IPSEC_LEVEL_BYPASS) &&
|
||||
(inp->inp_seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)) {
|
||||
if ((seclevel != NULL) &&
|
||||
(seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS) &&
|
||||
(seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_BYPASS) &&
|
||||
(seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)) {
|
||||
/* Direct match. */
|
||||
if (dignore ||
|
||||
!memcmp(&sdst, &ipo->ipo_dst, sdst.sa.sa_len)) {
|
||||
@ -414,7 +413,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
goto nomatchout;
|
||||
|
||||
/* Cached entry is good. */
|
||||
error = ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
error = ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
mtx_leave(&ipo_tdb_mtx);
|
||||
return error;
|
||||
|
||||
@ -475,7 +474,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
TAILQ_INSERT_TAIL(
|
||||
&ipo->ipo_tdb->tdb_policy_head,
|
||||
ipo, ipo_tdb_next);
|
||||
error = ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
error = ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
mtx_leave(&ipo_tdb_mtx);
|
||||
return error;
|
||||
}
|
||||
@ -503,7 +502,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case IPSP_IPSEC_USE:
|
||||
return ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
}
|
||||
} else { /* IPSP_DIRECTION_IN */
|
||||
if (tdbin != NULL) {
|
||||
@ -528,7 +527,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
/* Direct match in the cache. */
|
||||
mtx_enter(&ipo_tdb_mtx);
|
||||
if (ipo->ipo_tdb == tdbin) {
|
||||
error = ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
error = ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
mtx_leave(&ipo_tdb_mtx);
|
||||
return error;
|
||||
}
|
||||
@ -556,7 +555,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
ipo->ipo_tdb = tdb_ref(tdbin);
|
||||
TAILQ_INSERT_TAIL(&tdbin->tdb_policy_head, ipo,
|
||||
ipo_tdb_next);
|
||||
error = ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
error = ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
mtx_leave(&ipo_tdb_mtx);
|
||||
return error;
|
||||
|
||||
@ -647,7 +646,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
case IPSP_IPSEC_ACQUIRE:
|
||||
/* If appropriate SA exists, don't acquire another. */
|
||||
if (ipo->ipo_tdb != NULL)
|
||||
return ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
|
||||
/* Acquire SA through key management. */
|
||||
ipsp_acquire_sa(ipo, dignore ? &ssrc : &ipo->ipo_dst,
|
||||
@ -655,7 +654,7 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int direction,
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case IPSP_IPSEC_USE:
|
||||
return ipsp_spd_inp(m, inp, ipo, tdbout);
|
||||
return ipsp_spd_inp(m, seclevel, ipo, tdbout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -905,23 +904,23 @@ ipsp_acquire_sa(struct ipsec_policy *ipo, union sockaddr_union *gw,
|
||||
* Deal with PCB security requirements.
|
||||
*/
|
||||
int
|
||||
ipsp_spd_inp(struct mbuf *m, struct inpcb *inp, struct ipsec_policy *ipo,
|
||||
ipsp_spd_inp(struct mbuf *m, const u_char seclevel[], struct ipsec_policy *ipo,
|
||||
struct tdb **tdbout)
|
||||
{
|
||||
/* Sanity check. */
|
||||
if (inp == NULL)
|
||||
if (seclevel == NULL)
|
||||
goto justreturn;
|
||||
|
||||
/* We only support IPSEC_LEVEL_BYPASS or IPSEC_LEVEL_AVAIL */
|
||||
|
||||
if (inp->inp_seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS &&
|
||||
inp->inp_seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_BYPASS &&
|
||||
inp->inp_seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)
|
||||
if (seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_BYPASS &&
|
||||
seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_BYPASS &&
|
||||
seclevel[SL_AUTH] == IPSEC_LEVEL_BYPASS)
|
||||
goto justreturn;
|
||||
|
||||
if (inp->inp_seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_AVAIL &&
|
||||
inp->inp_seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_AVAIL &&
|
||||
inp->inp_seclevel[SL_AUTH] == IPSEC_LEVEL_AVAIL)
|
||||
if (seclevel[SL_ESP_TRANS] == IPSEC_LEVEL_AVAIL &&
|
||||
seclevel[SL_ESP_NETWORK] == IPSEC_LEVEL_AVAIL &&
|
||||
seclevel[SL_AUTH] == IPSEC_LEVEL_AVAIL)
|
||||
goto justreturn;
|
||||
|
||||
return -EINVAL; /* Silently drop packet. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip_var.h,v 1.109 2023/04/05 21:51:47 bluhm Exp $ */
|
||||
/* $OpenBSD: ip_var.h,v 1.110 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -236,7 +236,7 @@ struct mbuf*
|
||||
int ip_mforward(struct mbuf *, struct ifnet *);
|
||||
int ip_optcopy(struct ip *, struct ip *);
|
||||
int ip_output(struct mbuf *, struct mbuf *, struct route *, int,
|
||||
struct ip_moptions *, struct inpcb *, u_int32_t);
|
||||
struct ip_moptions *, const u_char[], u_int32_t);
|
||||
u_int16_t
|
||||
ip_randomid(void);
|
||||
void ip_send(struct mbuf *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: raw_ip.c,v 1.151 2023/01/22 12:05:44 mvs Exp $ */
|
||||
/* $OpenBSD: raw_ip.c,v 1.152 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -326,7 +326,7 @@ rip_output(struct mbuf *m, struct socket *so, struct sockaddr *dstaddr,
|
||||
#endif
|
||||
|
||||
error = ip_output(m, inp->inp_options, &inp->inp_route, flags,
|
||||
inp->inp_moptions, inp, 0);
|
||||
inp->inp_moptions, inp->inp_seclevel, 0);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tcp_input.c,v 1.392 2023/11/16 18:27:48 bluhm Exp $ */
|
||||
/* $OpenBSD: tcp_input.c,v 1.393 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -586,7 +586,7 @@ findpcb:
|
||||
&tdbi->dst, tdbi->proto);
|
||||
}
|
||||
error = ipsp_spd_lookup(m, af, iphlen, IPSP_DIRECTION_IN,
|
||||
tdb, inp, NULL, NULL);
|
||||
tdb, inp->inp_seclevel, NULL, NULL);
|
||||
tdb_unref(tdb);
|
||||
if (error) {
|
||||
tcpstat_inc(tcps_rcvnosec);
|
||||
@ -4162,7 +4162,7 @@ syn_cache_respond(struct syn_cache *sc, struct mbuf *m, uint64_t now)
|
||||
ip->ip_tos = inp->inp_ip.ip_tos;
|
||||
|
||||
error = ip_output(m, sc->sc_ipopts, &sc->sc_route4,
|
||||
(ip_mtudisc ? IP_MTUDISC : 0), NULL, inp, 0);
|
||||
(ip_mtudisc ? IP_MTUDISC : 0), NULL, inp->inp_seclevel, 0);
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tcp_output.c,v 1.140 2023/07/06 09:15:24 bluhm Exp $ */
|
||||
/* $OpenBSD: tcp_output.c,v 1.141 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
|
||||
|
||||
/*
|
||||
@ -1087,8 +1087,9 @@ send:
|
||||
SET(m->m_pkthdr.csum_flags, M_FLOWID);
|
||||
#endif
|
||||
error = ip_output(m, tp->t_inpcb->inp_options,
|
||||
&tp->t_inpcb->inp_route,
|
||||
(ip_mtudisc ? IP_MTUDISC : 0), NULL, tp->t_inpcb, 0);
|
||||
&tp->t_inpcb->inp_route,
|
||||
(ip_mtudisc ? IP_MTUDISC : 0), NULL,
|
||||
tp->t_inpcb->inp_seclevel, 0);
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
@ -1107,7 +1108,8 @@ send:
|
||||
#endif
|
||||
}
|
||||
error = ip6_output(m, tp->t_inpcb->inp_outputopts6,
|
||||
&tp->t_inpcb->inp_route6, 0, NULL, tp->t_inpcb);
|
||||
&tp->t_inpcb->inp_route6, 0, NULL,
|
||||
tp->t_inpcb->inp_seclevel);
|
||||
break;
|
||||
#endif /* INET6 */
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tcp_subr.c,v 1.192 2023/07/06 09:15:24 bluhm Exp $ */
|
||||
/* $OpenBSD: tcp_subr.c,v 1.193 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -402,7 +402,7 @@ tcp_respond(struct tcpcb *tp, caddr_t template, struct tcphdr *th0,
|
||||
ip6_output(m, tp ? tp->t_inpcb->inp_outputopts6 : NULL,
|
||||
tp ? &tp->t_inpcb->inp_route6 : NULL,
|
||||
0, NULL,
|
||||
tp ? tp->t_inpcb : NULL);
|
||||
tp ? tp->t_inpcb->inp_seclevel : NULL);
|
||||
break;
|
||||
#endif /* INET6 */
|
||||
case AF_INET:
|
||||
@ -412,7 +412,7 @@ tcp_respond(struct tcpcb *tp, caddr_t template, struct tcphdr *th0,
|
||||
ip_output(m, NULL,
|
||||
tp ? &tp->t_inpcb->inp_route : NULL,
|
||||
ip_mtudisc ? IP_MTUDISC : 0, NULL,
|
||||
tp ? tp->t_inpcb : NULL, 0);
|
||||
tp ? tp->t_inpcb->inp_seclevel : NULL, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: udp_usrreq.c,v 1.306 2023/09/16 09:33:27 mpi Exp $ */
|
||||
/* $OpenBSD: udp_usrreq.c,v 1.307 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -543,7 +543,7 @@ udp_input(struct mbuf **mp, int *offp, int proto, int af)
|
||||
} else
|
||||
tdb = NULL;
|
||||
error = ipsp_spd_lookup(m, af, iphlen, IPSP_DIRECTION_IN,
|
||||
tdb, inp, NULL, NULL);
|
||||
tdb, inp->inp_seclevel, NULL, NULL);
|
||||
if (error) {
|
||||
udpstat_inc(udps_nosec);
|
||||
tdb_unref(tdb);
|
||||
@ -1065,7 +1065,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr,
|
||||
|
||||
error = ip_output(m, inp->inp_options, &inp->inp_route,
|
||||
(inp->inp_socket->so_options & SO_BROADCAST), inp->inp_moptions,
|
||||
inp, ipsecflowinfo);
|
||||
inp->inp_seclevel, ipsecflowinfo);
|
||||
|
||||
bail:
|
||||
m_freem(control);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip6_output.c,v 1.279 2023/07/07 08:05:02 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_output.c,v 1.280 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -161,7 +161,7 @@ struct idgen32_ctx ip6_id_ctx;
|
||||
*/
|
||||
int
|
||||
ip6_output(struct mbuf *m, struct ip6_pktopts *opt, struct route_in6 *ro,
|
||||
int flags, struct ip6_moptions *im6o, struct inpcb *inp)
|
||||
int flags, struct ip6_moptions *im6o, const u_char seclevel[])
|
||||
{
|
||||
struct ip6_hdr *ip6;
|
||||
struct ifnet *ifp = NULL;
|
||||
@ -185,11 +185,6 @@ ip6_output(struct mbuf *m, struct ip6_pktopts *opt, struct route_in6 *ro,
|
||||
struct tdb *tdb = NULL;
|
||||
#endif /* IPSEC */
|
||||
|
||||
#ifdef IPSEC
|
||||
if (inp && (inp->inp_flags & INP_IPV6) == 0)
|
||||
panic("%s: IPv4 pcb is passed", __func__);
|
||||
#endif /* IPSEC */
|
||||
|
||||
ip6 = mtod(m, struct ip6_hdr *);
|
||||
finaldst = ip6->ip6_dst;
|
||||
|
||||
@ -218,8 +213,8 @@ ip6_output(struct mbuf *m, struct ip6_pktopts *opt, struct route_in6 *ro,
|
||||
}
|
||||
|
||||
#ifdef IPSEC
|
||||
if (ipsec_in_use || inp != NULL) {
|
||||
error = ip6_output_ipsec_lookup(m, inp, &tdb);
|
||||
if (ipsec_in_use || seclevel != NULL) {
|
||||
error = ip6_output_ipsec_lookup(m, seclevel, &tdb);
|
||||
if (error) {
|
||||
/*
|
||||
* -EINVAL is used to indicate that the packet should
|
||||
@ -2751,7 +2746,8 @@ in6_proto_cksum_out(struct mbuf *m, struct ifnet *ifp)
|
||||
|
||||
#ifdef IPSEC
|
||||
int
|
||||
ip6_output_ipsec_lookup(struct mbuf *m, struct inpcb *inp, struct tdb **tdbout)
|
||||
ip6_output_ipsec_lookup(struct mbuf *m, const u_char seclevel[],
|
||||
struct tdb **tdbout)
|
||||
{
|
||||
struct tdb *tdb;
|
||||
struct m_tag *mtag;
|
||||
@ -2765,7 +2761,7 @@ ip6_output_ipsec_lookup(struct mbuf *m, struct inpcb *inp, struct tdb **tdbout)
|
||||
|
||||
/* Do we have any pending SAs to apply ? */
|
||||
error = ipsp_spd_lookup(m, AF_INET6, sizeof(struct ip6_hdr),
|
||||
IPSP_DIRECTION_OUT, NULL, inp, &tdb, NULL);
|
||||
IPSP_DIRECTION_OUT, NULL, seclevel, &tdb, NULL);
|
||||
if (error || tdb == NULL) {
|
||||
*tdbout = NULL;
|
||||
return error;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ip6_var.h,v 1.106 2022/11/12 02:49:34 kn Exp $ */
|
||||
/* $OpenBSD: ip6_var.h,v 1.107 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
@ -325,7 +325,7 @@ void ip6_forward(struct mbuf *, struct rtentry *, int);
|
||||
|
||||
void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *);
|
||||
int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *, int,
|
||||
struct ip6_moptions *, struct inpcb *);
|
||||
struct ip6_moptions *, const u_char[]);
|
||||
int ip6_fragment(struct mbuf *, struct mbuf_list *, int, u_char, u_long);
|
||||
int ip6_ctloutput(int, struct socket *, int, int, struct mbuf *);
|
||||
int ip6_raw_ctloutput(int, struct socket *, int, int, struct mbuf *);
|
||||
@ -376,7 +376,7 @@ u_int32_t ip6_randomflowlabel(void);
|
||||
|
||||
#ifdef IPSEC
|
||||
struct tdb;
|
||||
int ip6_output_ipsec_lookup(struct mbuf *, struct inpcb *, struct tdb **);
|
||||
int ip6_output_ipsec_lookup(struct mbuf *, const u_char[], struct tdb **);
|
||||
int ip6_output_ipsec_send(struct tdb *, struct mbuf *, struct route_in6 *,
|
||||
int, int);
|
||||
#endif /* IPSEC */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: raw_ip6.c,v 1.173 2023/09/16 09:33:27 mpi Exp $ */
|
||||
/* $OpenBSD: raw_ip6.c,v 1.174 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -514,7 +514,7 @@ rip6_output(struct mbuf *m, struct socket *so, struct sockaddr *dstaddr,
|
||||
#endif
|
||||
|
||||
error = ip6_output(m, optp, &in6p->inp_route6, flags,
|
||||
in6p->inp_moptions6, in6p);
|
||||
in6p->inp_moptions6, in6p->inp_seclevel);
|
||||
if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) {
|
||||
icmp6stat_inc(icp6s_outhist + type);
|
||||
} else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: udp6_output.c,v 1.59 2022/02/22 01:35:41 guenther Exp $ */
|
||||
/* $OpenBSD: udp6_output.c,v 1.60 2023/11/26 22:08:10 bluhm Exp $ */
|
||||
/* $KAME: udp6_output.c,v 1.21 2001/02/07 11:51:54 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -232,7 +232,7 @@ udp6_output(struct inpcb *in6p, struct mbuf *m, struct mbuf *addr6,
|
||||
#endif
|
||||
|
||||
error = ip6_output(m, optp, &in6p->inp_route6,
|
||||
flags, in6p->inp_moptions6, in6p);
|
||||
flags, in6p->inp_moptions6, in6p->inp_seclevel);
|
||||
goto releaseopt;
|
||||
|
||||
release:
|
||||
|
@ -25,13 +25,24 @@ THIS SOFTWARE.
|
||||
This file lists all bug fixes, changes, etc., made since the
|
||||
second edition of the AWK book was published in September 2023.
|
||||
|
||||
Nov 20, 2023
|
||||
Nov 24, 2023:
|
||||
Fix issue #199: gototab improvements to dynamically resize the
|
||||
table, qsort and bsearch to improve the lookup speed as the
|
||||
table gets larger for multibyte input. thanks to Arnold Robbins.
|
||||
|
||||
Nov 23, 2023:
|
||||
Fix Issue #169, related to escape sequences in strings.
|
||||
Thanks to Github user rajeevvp.
|
||||
Fix Issue #147, reported by Github user drawkula, and fixed
|
||||
by Miguel Pineiro Jr.
|
||||
|
||||
Nov 20, 2023:
|
||||
rewrite of fnematch to fix a number of issues, including
|
||||
extraneous output, out-of-bounds access, number of bytes
|
||||
to push back after a failed match etc.
|
||||
thanks to Miguel Pineiro Jr.
|
||||
|
||||
Nov 15, 2023
|
||||
Nov 15, 2023:
|
||||
Man page edit, regression test fixes. thanks to Arnold Robbins
|
||||
consolidation of sub and gsub into dosub, removing duplicate
|
||||
code. thanks to Miguel Pineiro Jr.
|
||||
@ -44,7 +55,6 @@ Oct 30, 2023:
|
||||
systems. also fixed an out-of-bounds read for empty CCL.
|
||||
fixed a buffer overflow in substr with utf-8 strings.
|
||||
many thanks to Todd C Miller.
|
||||
|
||||
|
||||
Sep 24, 2023:
|
||||
fnematch and getrune have been overhauled to solve issues around
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: awk.h,v 1.30 2023/09/18 19:32:19 millert Exp $ */
|
||||
/* $OpenBSD: awk.h,v 1.31 2023/11/25 16:31:33 millert Exp $ */
|
||||
/****************************************************************
|
||||
Copyright (C) Lucent Technologies 1997
|
||||
All Rights Reserved
|
||||
@ -257,14 +257,19 @@ typedef struct rrow {
|
||||
int *lfollow;
|
||||
} rrow;
|
||||
|
||||
typedef struct gtt { /* gototab entry */
|
||||
typedef struct gtte { /* gototab entry */
|
||||
unsigned int ch;
|
||||
unsigned int state;
|
||||
} gtte;
|
||||
|
||||
typedef struct gtt { /* gototab */
|
||||
size_t allocated;
|
||||
size_t inuse;
|
||||
gtte *entries;
|
||||
} gtt;
|
||||
|
||||
typedef struct fa {
|
||||
gtt **gototab;
|
||||
int gototab_len;
|
||||
gtt *gototab;
|
||||
uschar *out;
|
||||
uschar *restr;
|
||||
int **posns;
|
||||
|
132
usr.bin/awk/b.c
132
usr.bin/awk/b.c
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: b.c,v 1.48 2023/11/22 01:01:21 millert Exp $ */
|
||||
/* $OpenBSD: b.c,v 1.49 2023/11/25 16:31:33 millert Exp $ */
|
||||
/****************************************************************
|
||||
Copyright (C) Lucent Technologies 1997
|
||||
All Rights Reserved
|
||||
@ -97,9 +97,8 @@ extern int u8_nextlen(const char *s);
|
||||
mechanism of the goto table used 8-bit byte indices into the
|
||||
gototab entries to compute the next state. Unicode is a lot
|
||||
bigger, so the gototab entries are now structs with a character
|
||||
and a next state, and there is a linear search of the characters
|
||||
to find the state. (Yes, this is slower, by a significant
|
||||
amount. Tough.)
|
||||
and a next state. These are sorted by code point and binary
|
||||
searched.
|
||||
|
||||
Throughout the RE mechanism in b.c, utf-8 characters are
|
||||
converted to their utf-32 value. This mostly shows up in
|
||||
@ -114,9 +113,10 @@ extern int u8_nextlen(const char *s);
|
||||
|
||||
*/
|
||||
|
||||
static int entry_cmp(const void *l, const void *r);
|
||||
static int get_gototab(fa*, int, int);
|
||||
static int set_gototab(fa*, int, int, int);
|
||||
static void reset_gototab(fa*, int);
|
||||
static void clear_gototab(fa*, int);
|
||||
extern int u8_rune(int *, const uschar *);
|
||||
|
||||
static int *
|
||||
@ -151,7 +151,7 @@ resizesetvec(const char *f)
|
||||
static void
|
||||
resize_state(fa *f, int state)
|
||||
{
|
||||
gtt **p;
|
||||
gtt *p;
|
||||
uschar *p2;
|
||||
int **p3;
|
||||
int i, new_count;
|
||||
@ -161,7 +161,7 @@ resize_state(fa *f, int state)
|
||||
|
||||
new_count = state + 10; /* needs to be tuned */
|
||||
|
||||
p = (gtt **) reallocarray(f->gototab, new_count, sizeof(f->gototab[0]));
|
||||
p = (gtt *) reallocarray(f->gototab, new_count, sizeof(gtt));
|
||||
if (p == NULL)
|
||||
goto out;
|
||||
f->gototab = p;
|
||||
@ -177,13 +177,14 @@ resize_state(fa *f, int state)
|
||||
f->posns = p3;
|
||||
|
||||
for (i = f->state_count; i < new_count; ++i) {
|
||||
f->gototab[i] = (gtt *) calloc(NCHARS, sizeof(**f->gototab));
|
||||
if (f->gototab[i] == NULL)
|
||||
f->gototab[i].entries = (gtte *) calloc(NCHARS, sizeof(gtte));
|
||||
if (f->gototab[i].entries == NULL)
|
||||
goto out;
|
||||
f->out[i] = 0;
|
||||
f->gototab[i].allocated = NCHARS;
|
||||
f->gototab[i].inuse = 0;
|
||||
f->out[i] = 0;
|
||||
f->posns[i] = NULL;
|
||||
}
|
||||
f->gototab_len = NCHARS; /* should be variable, growable */
|
||||
f->state_count = new_count;
|
||||
return;
|
||||
out:
|
||||
@ -277,7 +278,7 @@ int makeinit(fa *f, bool anchor)
|
||||
}
|
||||
if ((f->posns[2])[1] == f->accept)
|
||||
f->out[2] = 1;
|
||||
reset_gototab(f, 2);
|
||||
clear_gototab(f, 2);
|
||||
f->curstat = cgoto(f, 2, HAT);
|
||||
if (anchor) {
|
||||
*f->posns[2] = k-1; /* leave out position 0 */
|
||||
@ -601,37 +602,104 @@ int member(int c, int *sarg) /* is c in s? */
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int get_gototab(fa *f, int state, int ch) /* hide gototab inplementation */
|
||||
static void resize_gototab(fa *f, int state)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < f->gototab_len; i++) {
|
||||
if (f->gototab[state][i].ch == 0)
|
||||
break;
|
||||
if (f->gototab[state][i].ch == ch)
|
||||
return f->gototab[state][i].state;
|
||||
}
|
||||
return 0;
|
||||
size_t new_size = f->gototab[state].allocated * 2;
|
||||
gtte *p = (gtte *) realloc(f->gototab[state].entries, new_size * sizeof(gtte));
|
||||
if (p == NULL)
|
||||
overflo(__func__);
|
||||
|
||||
// need to initialized the new memory to zero
|
||||
size_t orig_size = f->gototab[state].allocated; // 2nd half of new mem is this size
|
||||
memset(p + orig_size, 0, orig_size * sizeof(gtte)); // clean it out
|
||||
|
||||
f->gototab[state].allocated = new_size; // update gotottab info
|
||||
f->gototab[state].entries = p;
|
||||
}
|
||||
|
||||
static void reset_gototab(fa *f, int state) /* hide gototab inplementation */
|
||||
static int get_gototab(fa *f, int state, int ch) /* hide gototab inplementation */
|
||||
{
|
||||
memset(f->gototab[state], 0, f->gototab_len * sizeof(**f->gototab));
|
||||
gtte key;
|
||||
gtte *item;
|
||||
|
||||
key.ch = ch;
|
||||
key.state = 0; /* irrelevant */
|
||||
item = bsearch(& key, f->gototab[state].entries,
|
||||
f->gototab[state].inuse, sizeof(gtte),
|
||||
entry_cmp);
|
||||
|
||||
if (item == NULL)
|
||||
return 0;
|
||||
else
|
||||
return item->state;
|
||||
}
|
||||
|
||||
static int entry_cmp(const void *l, const void *r)
|
||||
{
|
||||
const gtte *left, *right;
|
||||
|
||||
left = (const gtte *) l;
|
||||
right = (const gtte *) r;
|
||||
|
||||
return left->ch - right->ch;
|
||||
}
|
||||
|
||||
static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab inplementation */
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < f->gototab_len; i++) {
|
||||
if (f->gototab[state][i].ch == 0 || f->gototab[state][i].ch == ch) {
|
||||
f->gototab[state][i].ch = ch;
|
||||
f->gototab[state][i].state = val;
|
||||
return val;
|
||||
if (f->gototab[state].inuse == 0) {
|
||||
f->gototab[state].entries[0].ch = ch;
|
||||
f->gototab[state].entries[0].state = val;
|
||||
f->gototab[state].inuse++;
|
||||
return val;
|
||||
} else if (ch > f->gototab[state].entries[f->gototab[state].inuse-1].ch) {
|
||||
// not seen yet, insert and return
|
||||
gtt *tab = & f->gototab[state];
|
||||
if (tab->inuse + 1 >= tab->allocated)
|
||||
resize_gototab(f, state);
|
||||
|
||||
f->gototab[state].entries[f->gototab[state].inuse-1].ch = ch;
|
||||
f->gototab[state].entries[f->gototab[state].inuse-1].state = val;
|
||||
f->gototab[state].inuse++;
|
||||
return val;
|
||||
} else {
|
||||
// maybe we have it, maybe we don't
|
||||
gtte key;
|
||||
gtte *item;
|
||||
|
||||
key.ch = ch;
|
||||
key.state = 0; /* irrelevant */
|
||||
item = bsearch(& key, f->gototab[state].entries,
|
||||
f->gototab[state].inuse, sizeof(gtte),
|
||||
entry_cmp);
|
||||
|
||||
if (item != NULL) {
|
||||
// we have it, update state and return
|
||||
item->state = val;
|
||||
return item->state;
|
||||
}
|
||||
// otherwise, fall through to insert and reallocate.
|
||||
}
|
||||
overflo(__func__);
|
||||
|
||||
gtt *tab = & f->gototab[state];
|
||||
if (tab->inuse + 1 >= tab->allocated)
|
||||
resize_gototab(f, state);
|
||||
++tab->inuse;
|
||||
f->gototab[state].entries[tab->inuse].ch = ch;
|
||||
f->gototab[state].entries[tab->inuse].state = val;
|
||||
|
||||
qsort(f->gototab[state].entries,
|
||||
f->gototab[state].inuse, sizeof(gtte), entry_cmp);
|
||||
|
||||
return val; /* not used anywhere at the moment */
|
||||
}
|
||||
|
||||
static void clear_gototab(fa *f, int state)
|
||||
{
|
||||
memset(f->gototab[state].entries, 0,
|
||||
f->gototab[state].allocated * sizeof(gtte));
|
||||
f->gototab[state].inuse = 0;
|
||||
}
|
||||
|
||||
int match(fa *f, const char *p0) /* shortest match ? */
|
||||
{
|
||||
int s, ns;
|
||||
@ -1460,6 +1528,7 @@ int cgoto(fa *f, int s, int c)
|
||||
/* add tmpset to current set of states */
|
||||
++(f->curstat);
|
||||
resize_state(f, f->curstat);
|
||||
clear_gototab(f, f->curstat);
|
||||
xfree(f->posns[f->curstat]);
|
||||
p = intalloc(setcnt + 1, __func__);
|
||||
|
||||
@ -1483,7 +1552,8 @@ void freefa(fa *f) /* free a finite automaton */
|
||||
if (f == NULL)
|
||||
return;
|
||||
for (i = 0; i < f->state_count; i++)
|
||||
xfree(f->gototab[i])
|
||||
xfree(f->gototab[i].entries);
|
||||
xfree(f->gototab);
|
||||
for (i = 0; i <= f->curstat; i++)
|
||||
xfree(f->posns[i]);
|
||||
for (i = 0; i <= f->accept; i++) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: lex.c,v 1.31 2023/09/17 14:49:44 millert Exp $ */
|
||||
/* $OpenBSD: lex.c,v 1.32 2023/11/25 16:31:33 millert Exp $ */
|
||||
/****************************************************************
|
||||
Copyright (C) Lucent Technologies 1997
|
||||
All Rights Reserved
|
||||
@ -432,8 +432,12 @@ int string(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!isxdigit(peek())) {
|
||||
unput(c);
|
||||
break;
|
||||
}
|
||||
n = 0;
|
||||
for (i = 1; i <= 2; i++) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
c = input();
|
||||
if (c == 0)
|
||||
break;
|
||||
@ -444,13 +448,13 @@ int string(void)
|
||||
n += (c - '0');
|
||||
else
|
||||
n += 10 + (c - 'a');
|
||||
} else
|
||||
} else {
|
||||
unput(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (n)
|
||||
if (i)
|
||||
*bp++ = n;
|
||||
else
|
||||
unput(c);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: main.c,v 1.65 2023/11/22 01:01:21 millert Exp $ */
|
||||
/* $OpenBSD: main.c,v 1.66 2023/11/25 16:31:33 millert Exp $ */
|
||||
/****************************************************************
|
||||
Copyright (C) Lucent Technologies 1997
|
||||
All Rights Reserved
|
||||
@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
****************************************************************/
|
||||
|
||||
const char *version = "version 20231120";
|
||||
const char *version = "version 20231124";
|
||||
|
||||
#define DEBUG
|
||||
#include <stdio.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: run.c,v 1.81 2023/11/22 01:01:21 millert Exp $ */
|
||||
/* $OpenBSD: run.c,v 1.82 2023/11/25 16:31:33 millert Exp $ */
|
||||
/****************************************************************
|
||||
Copyright (C) Lucent Technologies 1997
|
||||
All Rights Reserved
|
||||
@ -1541,8 +1541,9 @@ Cell *assign(Node **a, int n) /* a[0] = a[1], a[0] += a[1], etc. */
|
||||
if (x == y && !(x->tval & (FLD|REC)) && x != nfloc)
|
||||
; /* self-assignment: leave alone unless it's a field or NF */
|
||||
else if ((y->tval & (STR|NUM)) == (STR|NUM)) {
|
||||
yf = getfval(y);
|
||||
setsval(x, getsval(y));
|
||||
x->fval = getfval(y);
|
||||
x->fval = yf;
|
||||
x->tval |= NUM;
|
||||
}
|
||||
else if (isstr(y))
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: extern.h,v 1.46 2023/11/23 11:59:53 job Exp $ */
|
||||
/* $OpenBSD: extern.h,v 1.47 2023/11/27 11:30:49 claudio Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
*
|
||||
@ -147,6 +147,7 @@ struct opts {
|
||||
int one_file_system; /* -x */
|
||||
int ignore_times; /* -I */
|
||||
int ignore_dir_times; /* -O */
|
||||
int ignore_link_times; /* -J */
|
||||
int size_only; /* --size-only */
|
||||
int alt_base_mode;
|
||||
off_t max_size; /* --max-size */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fargs.c,v 1.25 2023/11/23 11:59:53 job Exp $ */
|
||||
/* $OpenBSD: fargs.c,v 1.26 2023/11/27 11:30:49 claudio Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
*
|
||||
@ -142,6 +142,8 @@ fargs_cmdline(struct sess *sess, const struct fargs *f, size_t *skip)
|
||||
if (f->mode == FARGS_SENDER) {
|
||||
if (sess->opts->ignore_dir_times)
|
||||
addargs(&args, "-O");
|
||||
if (sess->opts->ignore_link_times)
|
||||
addargs(&args, "-J");
|
||||
if (sess->opts->size_only)
|
||||
addargs(&args, "--size-only");
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: main.c,v 1.69 2023/11/23 11:59:53 job Exp $ */
|
||||
/* $OpenBSD: main.c,v 1.71 2023/11/27 11:30:49 claudio Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
*
|
||||
@ -322,6 +322,11 @@ const struct option lopts[] = {
|
||||
{ "no-motd", no_argument, &opts.no_motd, 1 },
|
||||
{ "numeric-ids", no_argument, &opts.numeric_ids, 1 },
|
||||
{ "omit-dir-times", no_argument, &opts.ignore_dir_times, 1 },
|
||||
{ "no-O", no_argument, &opts.ignore_dir_times, 0 },
|
||||
{ "no-omit-dir-times", no_argument, &opts.ignore_dir_times, 0 },
|
||||
{ "omit-link-times", no_argument, &opts.ignore_link_times, 1 },
|
||||
{ "no-J", no_argument, &opts.ignore_link_times, 0 },
|
||||
{ "no-omit-link-times", no_argument, &opts.ignore_link_times, 0 },
|
||||
{ "owner", no_argument, &opts.preserve_uids, 1 },
|
||||
{ "no-owner", no_argument, &opts.preserve_uids, 0 },
|
||||
{ "perms", no_argument, &opts.preserve_perms, 1 },
|
||||
@ -364,8 +369,8 @@ main(int argc, char *argv[])
|
||||
|
||||
opts.max_size = opts.min_size = -1;
|
||||
|
||||
while ((c = getopt_long(argc, argv, "aDe:ghIlnOoprtVvxz", lopts, &lidx))
|
||||
!= -1) {
|
||||
while ((c = getopt_long(argc, argv, "aDe:ghIJlnOoprtVvxz",
|
||||
lopts, &lidx)) != -1) {
|
||||
switch (c) {
|
||||
case 'D':
|
||||
opts.devices = 1;
|
||||
@ -390,6 +395,9 @@ main(int argc, char *argv[])
|
||||
case 'I':
|
||||
opts.ignore_times = 1;
|
||||
break;
|
||||
case 'J':
|
||||
opts.ignore_link_times = 1;
|
||||
break;
|
||||
case 'l':
|
||||
opts.preserve_links = 1;
|
||||
break;
|
||||
@ -641,7 +649,7 @@ basedir:
|
||||
exit(rc);
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s"
|
||||
" [-aDgIlnOoprtVvx] [-e program] [--address=sourceaddr]\n"
|
||||
" [-aDgIJlnOoprtVvx] [-e program] [--address=sourceaddr]\n"
|
||||
"\t[--contimeout=seconds] [--compare-dest=dir] [--del] [--exclude]\n"
|
||||
"\t[--exclude-from=file] [--include] [--include-from=file]\n"
|
||||
"\t[--no-motd] [--numeric-ids] [--port=portnumber]\n"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: receiver.c,v 1.31 2021/10/24 21:24:17 deraadt Exp $ */
|
||||
/* $OpenBSD: receiver.c,v 1.32 2023/11/27 11:30:49 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
@ -114,7 +114,8 @@ rsync_set_metadata_at(struct sess *sess, int newfile, int rootfd,
|
||||
|
||||
/* Conditionally adjust file modification time. */
|
||||
|
||||
if (sess->opts->preserve_times) {
|
||||
if (sess->opts->preserve_times &&
|
||||
!(S_ISLNK(f->st.mode) && sess->opts->ignore_link_times)) {
|
||||
ts[0].tv_nsec = UTIME_NOW;
|
||||
ts[1].tv_sec = f->st.mtime;
|
||||
ts[1].tv_nsec = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: rsync.1,v 1.34 2023/11/23 11:59:53 job Exp $
|
||||
.\" $OpenBSD: rsync.1,v 1.35 2023/11/27 11:32:34 claudio Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
.\"
|
||||
@ -14,7 +14,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: November 23 2023 $
|
||||
.Dd $Mdocdate: November 27 2023 $
|
||||
.Dt OPENRSYNC 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -22,7 +22,7 @@
|
||||
.Nd synchronise local and remote files
|
||||
.Sh SYNOPSIS
|
||||
.Nm openrsync
|
||||
.Op Fl aDgIlnOoprtVvx
|
||||
.Op Fl aDgIJlnOoprtVvx
|
||||
.Op Fl e Ar program
|
||||
.Op Fl -address Ns = Ns Ar sourceaddr
|
||||
.Op Fl -compare-dest Ns = Ns Ar directory
|
||||
@ -132,6 +132,8 @@ and
|
||||
.Em rules
|
||||
from
|
||||
.Em file .
|
||||
.It Fl J , -omit-link-times
|
||||
Don't set symlink modification times to match the source.
|
||||
.It Fl l , -links
|
||||
Also transfer symbolic links.
|
||||
The link is transferred as a standalone file: if the destination does
|
||||
@ -167,8 +169,6 @@ or
|
||||
is also given.
|
||||
.It Fl O , -omit-dir-times
|
||||
Don't set directory modification times to match the source.
|
||||
Takes precedence over
|
||||
.Fl t .
|
||||
.It Fl o , -owner
|
||||
Set the user name to match the source, with similar matching logic as for
|
||||
.Fl g .
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: uploader.c,v 1.35 2023/11/23 11:59:53 job Exp $ */
|
||||
/* $OpenBSD: uploader.c,v 1.36 2023/11/27 11:28:39 claudio Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
* Copyright (c) 2019 Florian Obser <florian@openbsd.org>
|
||||
@ -1099,8 +1099,7 @@ rsync_uploader_tail(struct upload *u, struct sess *sess)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
||||
if (!sess->opts->preserve_times &&
|
||||
if ((!sess->opts->preserve_times || sess->opts->ignore_dir_times) &&
|
||||
!sess->opts->preserve_perms)
|
||||
return 1;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#! /usr/bin/perl
|
||||
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: PkgAdd.pm,v 1.147 2023/11/25 10:58:45 espie Exp $
|
||||
# $OpenBSD: PkgAdd.pm,v 1.148 2023/11/25 17:43:39 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -359,7 +359,7 @@ sub find_kept_handle($set, $n, $state)
|
||||
}
|
||||
}
|
||||
$set->check_security($state, $plist, $o);
|
||||
if ($set->{quirks}) {
|
||||
if ($set->{quirks} || $plist->has('updatedb')) {
|
||||
# The installed package has inst: for a location, we want
|
||||
# the newer one (which is identical)
|
||||
$n->location->{repository}->setup_cache($state->{setlist});
|
||||
@ -843,7 +843,7 @@ sub really_add($set, $state)
|
||||
add_installed($pkgname);
|
||||
delete $handle->{partial};
|
||||
OpenBSD::PkgCfl::register($handle, $state);
|
||||
if ($set->{quirks}) {
|
||||
if ($set->{quirks} || $plist->has('updatedb')) {
|
||||
$handle->location->{repository}->setup_cache($state->{setlist});
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: slaacctl.8,v 1.6 2023/03/02 17:09:53 jmc Exp $
|
||||
.\" $OpenBSD: slaacctl.8,v 1.7 2023/11/27 09:29:48 kn Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
.\" Copyright (c) 2016 Kenneth R Westerback <kwesterback@gmail.com>
|
||||
@ -16,7 +16,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 2 2023 $
|
||||
.Dd $Mdocdate: November 27 2023 $
|
||||
.Dt SLAACCTL 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -51,15 +51,15 @@ The following commands are available:
|
||||
Disable verbose debug logging.
|
||||
.It Cm log verbose
|
||||
Enable verbose debug logging.
|
||||
.It Cm send solicitation Ar interfacename
|
||||
.It Cm send solicitation Ar interface
|
||||
Send a router solicitation on interface
|
||||
.Ar interfacename .
|
||||
.It Cm show interface Op Ar interfacename
|
||||
.Ar interface .
|
||||
.It Cm show interface Op Ar interface
|
||||
Display status about network interfaces.
|
||||
If
|
||||
.Ar interfacename
|
||||
.Ar interface
|
||||
is specified, only information relative to
|
||||
.Ar interfacename
|
||||
.Ar interface
|
||||
is shown.
|
||||
Otherwise information on all interfaces is shown.
|
||||
.El
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ypbind.c,v 1.78 2023/03/08 04:43:15 guenther Exp $ */
|
||||
/* $OpenBSD: ypbind.c,v 1.79 2023/11/27 18:37:53 tb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt <deraadt@openbsd.org>
|
||||
@ -341,8 +341,7 @@ main(int argc, char *argv[])
|
||||
DIR *dirp;
|
||||
struct dirent *dent;
|
||||
|
||||
yp_get_default_domain(&domain);
|
||||
if (domain[0] == '\0') {
|
||||
if (yp_get_default_domain(&domain) != 0 || domain[0] == '\0') {
|
||||
fprintf(stderr, "domainname not set. Aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user