sync with OpenBSD -current
This commit is contained in:
parent
bef867f8da
commit
a289465f63
9 changed files with 60 additions and 43 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: dhcp6leased.h,v 1.4 2024/06/03 11:08:31 florian Exp $ */
|
||||
/* $OpenBSD: dhcp6leased.h,v 1.5 2024/06/03 18:10:04 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
|
||||
|
@ -221,13 +221,6 @@ struct imsg_ifinfo {
|
|||
char lease[LEASE_SIZE];
|
||||
};
|
||||
|
||||
struct imsg_propose_rdns {
|
||||
uint32_t if_index;
|
||||
int rdomain;
|
||||
int rdns_count;
|
||||
struct in_addr rdns[MAX_RDNS_COUNT];
|
||||
};
|
||||
|
||||
struct imsg_dhcp {
|
||||
uint32_t if_index;
|
||||
ssize_t len;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: engine.c,v 1.44 2024/06/02 12:39:26 florian Exp $ */
|
||||
/* $OpenBSD: engine.c,v 1.45 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
|
||||
|
@ -1819,7 +1819,7 @@ send_rdns_proposal(struct dhcpleased_iface *iface)
|
|||
imsg.rdomain = iface->rdomain;
|
||||
for (imsg.rdns_count = 0; imsg.rdns_count < MAX_RDNS_COUNT &&
|
||||
iface->nameservers[imsg.rdns_count].s_addr != INADDR_ANY;
|
||||
imsg.rdns_count++)
|
||||
imsg.rdns_count++)
|
||||
;
|
||||
memcpy(imsg.rdns, iface->nameservers, sizeof(imsg.rdns));
|
||||
engine_imsg_compose_main(IMSG_PROPOSE_RDNS, 0, &imsg, sizeof(imsg));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: frontend.c,v 1.33 2024/01/26 21:14:08 jan Exp $ */
|
||||
/* $OpenBSD: frontend.c,v 1.34 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
|
||||
|
@ -797,7 +797,7 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info)
|
|||
case RTM_IFANNOUNCE:
|
||||
ifan = (struct if_announcemsghdr *)rtm;
|
||||
if_index = ifan->ifan_index;
|
||||
if (ifan->ifan_what == IFAN_DEPARTURE) {
|
||||
if (ifan->ifan_what == IFAN_DEPARTURE) {
|
||||
frontend_imsg_compose_engine(IMSG_REMOVE_IF, 0, 0,
|
||||
&if_index, sizeof(if_index));
|
||||
remove_iface(if_index);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: log.h,v 1.3 2021/12/13 18:28:39 deraadt Exp $ */
|
||||
/* $OpenBSD: log.h,v 1.4 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
||||
|
@ -44,16 +44,16 @@ __dead void fatal(const char *, ...)
|
|||
__dead void fatalx(const char *, ...)
|
||||
__attribute__((__format__ (printf, 1, 2)));
|
||||
#else
|
||||
#define log_init(x...) do {} while(0)
|
||||
#define log_procinit(x...) do {} while(0)
|
||||
#define log_setverbose(x...) do {} while(0)
|
||||
#define log_init(x...) do {} while (0)
|
||||
#define log_procinit(x...) do {} while (0)
|
||||
#define log_setverbose(x...) do {} while (0)
|
||||
#define log_getverbose(x...) (0)
|
||||
#define log_warn(x...) do {} while(0)
|
||||
#define log_warnx(x...) do {} while(0)
|
||||
#define log_info(x...) do {} while(0)
|
||||
#define log_debug(x...) do {} while(0)
|
||||
#define logit(x...) do {} while(0)
|
||||
#define vlog(x...) do {} while(0)
|
||||
#define log_warn(x...) do {} while (0)
|
||||
#define log_warnx(x...) do {} while (0)
|
||||
#define log_info(x...) do {} while (0)
|
||||
#define log_debug(x...) do {} while (0)
|
||||
#define logit(x...) do {} while (0)
|
||||
#define vlog(x...) do {} while (0)
|
||||
#define fatal(x...) exit(1)
|
||||
#define fatalx(x...) exit(1)
|
||||
#endif /* SMALL */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: parse.y,v 1.8 2023/11/25 12:00:39 florian Exp $ */
|
||||
/* $OpenBSD: parse.y,v 1.9 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
|
||||
|
@ -57,7 +57,7 @@ static struct file {
|
|||
TAILQ_ENTRY(file) entry;
|
||||
FILE *stream;
|
||||
char *name;
|
||||
size_t ungetpos;
|
||||
size_t ungetpos;
|
||||
size_t ungetsize;
|
||||
u_char *ungetbuf;
|
||||
int eof_reached;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: engine.c,v 1.89 2024/04/21 17:33:05 florian Exp $ */
|
||||
/* $OpenBSD: engine.c,v 1.90 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
|
@ -782,7 +782,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
|
|||
LIST_FOREACH(addr_proposal, &iface->addr_proposals, entries) {
|
||||
memset(&cei_addr_proposal, 0, sizeof(cei_addr_proposal));
|
||||
cei_addr_proposal.id = addr_proposal->id;
|
||||
if(strlcpy(cei_addr_proposal.state,
|
||||
if (strlcpy(cei_addr_proposal.state,
|
||||
proposal_state_name(addr_proposal->state),
|
||||
sizeof(cei_addr_proposal.state)) >=
|
||||
sizeof(cei_addr_proposal.state))
|
||||
|
@ -811,7 +811,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
|
|||
LIST_FOREACH(dfr_proposal, &iface->dfr_proposals, entries) {
|
||||
memset(&cei_dfr_proposal, 0, sizeof(cei_dfr_proposal));
|
||||
cei_dfr_proposal.id = dfr_proposal->id;
|
||||
if(strlcpy(cei_dfr_proposal.state,
|
||||
if (strlcpy(cei_dfr_proposal.state,
|
||||
proposal_state_name(dfr_proposal->state),
|
||||
sizeof(cei_dfr_proposal.state)) >=
|
||||
sizeof(cei_dfr_proposal.state))
|
||||
|
@ -823,7 +823,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
|
|||
cei_dfr_proposal.addr));
|
||||
cei_dfr_proposal.router_lifetime =
|
||||
dfr_proposal->router_lifetime;
|
||||
if(strlcpy(cei_dfr_proposal.rpref,
|
||||
if (strlcpy(cei_dfr_proposal.rpref,
|
||||
rpref_name[dfr_proposal->rpref],
|
||||
sizeof(cei_dfr_proposal.rpref)) >=
|
||||
sizeof(cei_dfr_proposal.rpref))
|
||||
|
@ -840,7 +840,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
|
|||
LIST_FOREACH(rdns_proposal, &iface->rdns_proposals, entries) {
|
||||
memset(&cei_rdns_proposal, 0, sizeof(cei_rdns_proposal));
|
||||
cei_rdns_proposal.id = rdns_proposal->id;
|
||||
if(strlcpy(cei_rdns_proposal.state,
|
||||
if (strlcpy(cei_rdns_proposal.state,
|
||||
proposal_state_name(rdns_proposal->state),
|
||||
sizeof(cei_rdns_proposal.state)) >=
|
||||
sizeof(cei_rdns_proposal.state))
|
||||
|
@ -1524,7 +1524,7 @@ parse_ra(struct slaacd_iface *iface, struct imsg_ra *ra)
|
|||
in6 = (struct in6_addr*) (p + 6);
|
||||
for (i=0; i < (nd_opt_hdr->nd_opt_len - 1)/2; i++,
|
||||
in6++) {
|
||||
if((rdns = calloc(1, sizeof(*rdns))) == NULL)
|
||||
if ((rdns = calloc(1, sizeof(*rdns))) == NULL)
|
||||
fatal("calloc");
|
||||
memcpy(&rdns->rdns, in6, sizeof(rdns->rdns));
|
||||
LIST_INSERT_HEAD(&radv->rdns_servers, rdns,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: frontend.c,v 1.66 2024/02/11 21:29:12 bluhm Exp $ */
|
||||
/* $OpenBSD: frontend.c,v 1.67 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
|
@ -507,7 +507,7 @@ update_iface(uint32_t if_index, char* if_name)
|
|||
if (!(xflags & (IFXF_AUTOCONF6 | IFXF_AUTOCONF6TEMP)))
|
||||
return;
|
||||
|
||||
if((ifrdomain = get_ifrdomain(if_name)) == -1)
|
||||
if ((ifrdomain = get_ifrdomain(if_name)) == -1)
|
||||
return;
|
||||
|
||||
iface = get_iface_by_id(if_index);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $OpenBSD: mime.types,v 1.4 2018/01/06 22:05:03 sthen Exp $
|
||||
# $OpenBSD: mime.types,v 1.5 2024/06/03 20:08:12 matthieu Exp $
|
||||
|
||||
application/atom+xml atom
|
||||
application/font-woff woff
|
||||
|
@ -79,6 +79,7 @@ image/x-ms-bmp bmp
|
|||
|
||||
text/css css
|
||||
text/html html htm shtml
|
||||
text/javascript mjs
|
||||
text/mathml mml
|
||||
text/plain txt
|
||||
text/vnd.sun.j2me.app-descriptor jad
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pmap.c,v 1.167 2024/05/03 13:48:29 dv Exp $ */
|
||||
/* $OpenBSD: pmap.c,v 1.168 2024/06/03 20:53:00 dv Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -2408,6 +2408,8 @@ pmap_remove_ept(struct pmap *pmap, vaddr_t sgpa, vaddr_t egpa)
|
|||
struct vmx_invept_descriptor vid;
|
||||
#endif /* NVMM > 0 */
|
||||
|
||||
mtx_enter(&pmap->pm_mtx);
|
||||
|
||||
DPRINTF("%s: sgpa=0x%llx egpa=0x%llx\n", __func__, (uint64_t)sgpa,
|
||||
(uint64_t)egpa);
|
||||
for (v = sgpa; v < egpa + PAGE_SIZE; v += PAGE_SIZE)
|
||||
|
@ -2422,6 +2424,8 @@ pmap_remove_ept(struct pmap *pmap, vaddr_t sgpa, vaddr_t egpa)
|
|||
invept(IA32_VMX_INVEPT_SINGLE_CTX, &vid);
|
||||
}
|
||||
#endif /* NVMM > 0 */
|
||||
|
||||
mtx_leave(&pmap->pm_mtx);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2433,6 +2437,8 @@ pmap_do_remove_ept(struct pmap *pmap, paddr_t gpa)
|
|||
pd_entry_t *pd4, *pd3, *pd2, *pd1;
|
||||
pd_entry_t *pptes;
|
||||
|
||||
MUTEX_ASSERT_LOCKED(&pmap->pm_mtx);
|
||||
|
||||
l4idx = (gpa & L4_MASK) >> L4_SHIFT; /* PML4E idx */
|
||||
l3idx = (gpa & L3_MASK) >> L3_SHIFT; /* PDPTE idx */
|
||||
l2idx = (gpa & L2_MASK) >> L2_SHIFT; /* PDE idx */
|
||||
|
@ -2510,6 +2516,7 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
struct vm_page *ptp, *pptp;
|
||||
paddr_t npa;
|
||||
struct uvm_object *obj;
|
||||
int ret = 0;
|
||||
|
||||
if (gpa > MAXDSIZ)
|
||||
return ENOMEM;
|
||||
|
@ -2519,11 +2526,15 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
l2idx = (gpa & L2_MASK) >> L2_SHIFT; /* PDE idx */
|
||||
l1idx = (gpa & L1_MASK) >> L1_SHIFT; /* PTE idx */
|
||||
|
||||
mtx_enter(&pmap->pm_mtx);
|
||||
|
||||
/* Start at PML4 / top level */
|
||||
pd = (pd_entry_t *)pmap->pm_pdir;
|
||||
|
||||
if (pd == NULL)
|
||||
return ENOMEM;
|
||||
if (pd == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* npa = physaddr of PDPT */
|
||||
npa = pd[l4idx] & PMAP_PA_MASK;
|
||||
|
@ -2535,8 +2546,11 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
ptp = uvm_pagealloc(obj, ptp_va2o(gpa, 3), NULL,
|
||||
UVM_PGA_USERESERVE|UVM_PGA_ZERO);
|
||||
|
||||
if (ptp == NULL)
|
||||
return ENOMEM;
|
||||
if (ptp == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
atomic_clearbits_int(&ptp->pg_flags, PG_BUSY);
|
||||
|
||||
/*
|
||||
* New PDPT page - we are setting the first entry, so set
|
||||
|
@ -2576,8 +2590,11 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
ptp = uvm_pagealloc(obj, ptp_va2o(gpa, 2), NULL,
|
||||
UVM_PGA_USERESERVE|UVM_PGA_ZERO);
|
||||
|
||||
if (ptp == NULL)
|
||||
return ENOMEM;
|
||||
if (ptp == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
atomic_clearbits_int(&ptp->pg_flags, PG_BUSY);
|
||||
|
||||
/*
|
||||
* New PD page - we are setting the first entry, so set
|
||||
|
@ -2617,8 +2634,11 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
ptp = uvm_pagealloc(obj, ptp_va2o(gpa, 1), NULL,
|
||||
UVM_PGA_USERESERVE|UVM_PGA_ZERO);
|
||||
|
||||
if (ptp == NULL)
|
||||
return ENOMEM;
|
||||
if (ptp == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
atomic_clearbits_int(&ptp->pg_flags, PG_BUSY);
|
||||
|
||||
pptp->wire_count++;
|
||||
|
||||
|
@ -2661,7 +2681,10 @@ pmap_enter_ept(struct pmap *pmap, paddr_t gpa, paddr_t hpa, vm_prot_t prot)
|
|||
|
||||
pd[l1idx] = npte;
|
||||
|
||||
return 0;
|
||||
unlock:
|
||||
mtx_leave(&pmap->pm_mtx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue