sync with OpenBSD -current
This commit is contained in:
parent
1cefe29c7e
commit
fdad81bcfc
32 changed files with 162 additions and 207 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: kern_sysctl.c,v 1.422 2024/01/15 15:47:37 mvs Exp $ */
|
||||
/* $OpenBSD: kern_sysctl.c,v 1.423 2024/01/18 08:48:32 mvs Exp $ */
|
||||
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -1283,13 +1283,8 @@ fill_file(struct kinfo_file *kf, struct file *fp, struct filedesc *fdp,
|
|||
if (so == NULL) {
|
||||
so = (struct socket *)fp->f_data;
|
||||
/* if so is passed as parameter it is already locked */
|
||||
switch (so->so_proto->pr_domain->dom_family) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
NET_LOCK();
|
||||
locked = 1;
|
||||
break;
|
||||
}
|
||||
solock(so);
|
||||
locked = 1;
|
||||
}
|
||||
|
||||
kf->so_type = so->so_type;
|
||||
|
@ -1312,14 +1307,14 @@ fill_file(struct kinfo_file *kf, struct file *fp, struct filedesc *fdp,
|
|||
kf->so_splicelen = -1;
|
||||
if (so->so_pcb == NULL) {
|
||||
if (locked)
|
||||
NET_UNLOCK();
|
||||
sounlock(so);
|
||||
break;
|
||||
}
|
||||
switch (kf->so_family) {
|
||||
case AF_INET: {
|
||||
struct inpcb *inpcb = so->so_pcb;
|
||||
|
||||
NET_ASSERT_LOCKED();
|
||||
soassertlocked(so);
|
||||
if (show_pointers)
|
||||
kf->inp_ppcb = PTRTOINT64(inpcb->inp_ppcb);
|
||||
kf->inp_lport = inpcb->inp_lport;
|
||||
|
@ -1341,7 +1336,7 @@ fill_file(struct kinfo_file *kf, struct file *fp, struct filedesc *fdp,
|
|||
case AF_INET6: {
|
||||
struct inpcb *inpcb = so->so_pcb;
|
||||
|
||||
NET_ASSERT_LOCKED();
|
||||
soassertlocked(so);
|
||||
if (show_pointers)
|
||||
kf->inp_ppcb = PTRTOINT64(inpcb->inp_ppcb);
|
||||
kf->inp_lport = inpcb->inp_lport;
|
||||
|
@ -1388,7 +1383,7 @@ fill_file(struct kinfo_file *kf, struct file *fp, struct filedesc *fdp,
|
|||
}
|
||||
}
|
||||
if (locked)
|
||||
NET_UNLOCK();
|
||||
sounlock(so);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue