summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/kern/uipc_usrreq.c')
-rw-r--r--freebsd/sys/kern/uipc_usrreq.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/freebsd/sys/kern/uipc_usrreq.c b/freebsd/sys/kern/uipc_usrreq.c
index c1885ed6..6b34dcb8 100644
--- a/freebsd/sys/kern/uipc_usrreq.c
+++ b/freebsd/sys/kern/uipc_usrreq.c
@@ -551,6 +551,7 @@ uipc_attach(struct socket *so, int proto, struct thread *td)
UNP_LINK_WLOCK();
unp->unp_gencnt = ++unp_gencnt;
+ unp->unp_ino = ++unp_ino;
unp_count++;
switch (so->so_type) {
case SOCK_STREAM:
@@ -1434,12 +1435,8 @@ uipc_sense(struct socket *so, struct stat *sb)
KASSERT(unp != NULL, ("uipc_sense: unp == NULL"));
sb->st_blksize = so->so_snd.sb_hiwat;
- UNP_PCB_LOCK(unp);
sb->st_dev = NODEV;
- if (unp->unp_ino == 0)
- unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino;
sb->st_ino = unp->unp_ino;
- UNP_PCB_UNLOCK(unp);
return (0);
}
@@ -1993,7 +1990,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
/*
* OK, now we're committed to doing something.
*/
- xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK);
+ xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO);
UNP_LINK_RLOCK();
gencnt = unp_gencnt;
n = unp_count;