-/* $OpenBSD: in_pcb.c,v 1.296 2024/02/29 12:01:59 naddy Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.297 2024/03/22 18:05:01 bluhm Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
}
int
-in_pcbbind_locked(struct inpcb *inp, struct mbuf *nam, struct proc *p)
+in_pcbbind_locked(struct inpcb *inp, struct mbuf *nam, const void *laddr,
+ struct proc *p)
{
struct socket *so = inp->inp_socket;
u_int16_t lport = 0;
int wild = 0;
- const void *laddr = &zeroin46_addr;
int error;
if (inp->inp_lport)
/* keep lookup, modification, and rehash in sync */
mtx_enter(&table->inpt_mtx);
- error = in_pcbbind_locked(inp, nam, p);
+ error = in_pcbbind_locked(inp, nam, &zeroin46_addr, p);
mtx_leave(&table->inpt_mtx);
return error;
if (inp->inp_laddr.s_addr == INADDR_ANY) {
if (inp->inp_lport == 0) {
- error = in_pcbbind_locked(inp, NULL, curproc);
+ error = in_pcbbind_locked(inp, NULL, &ina, curproc);
if (error) {
mtx_leave(&table->inpt_mtx);
return (error);
-/* $OpenBSD: in_pcb.h,v 1.152 2024/02/13 12:22:09 bluhm Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.153 2024/03/22 18:05:01 bluhm Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
void in_init(void);
void in_losing(struct inpcb *);
int in_pcballoc(struct socket *, struct inpcbtable *, int);
-int in_pcbbind_locked(struct inpcb *, struct mbuf *, struct proc *);
+int in_pcbbind_locked(struct inpcb *, struct mbuf *, const void *,
+ struct proc *);
int in_pcbbind(struct inpcb *, struct mbuf *, struct proc *);
int in_pcbaddrisavail(const struct inpcb *, struct sockaddr_in *, int,
struct proc *);
-/* $OpenBSD: in6_pcb.c,v 1.141 2024/02/29 12:01:59 naddy Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.142 2024/03/22 18:05:01 bluhm Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
if (IN6_IS_ADDR_UNSPECIFIED(&inp->inp_laddr6)) {
if (inp->inp_lport == 0) {
- error = in_pcbbind_locked(inp, NULL, curproc);
+ error = in_pcbbind_locked(inp, NULL, in6a, curproc);
if (error) {
mtx_leave(&table->inpt_mtx);
return (error);