sync with OpenBSD -current

This commit is contained in:
purplerain 2024-01-29 17:38:40 +00:00
parent 20629a8b0d
commit 604988d5d3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
58 changed files with 592 additions and 377 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: in_pcb.c,v 1.286 2024/01/19 02:24:07 bluhm Exp $ */
/* $OpenBSD: in_pcb.c,v 1.287 2024/01/28 20:34:25 bluhm Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@ -720,18 +720,14 @@ in_peeraddr(struct socket *so, struct mbuf *nam)
* any errors for each matching socket.
*/
void
in_pcbnotifyall(struct inpcbtable *table, struct sockaddr *dst, u_int rtable,
int errno, void (*notify)(struct inpcb *, int))
in_pcbnotifyall(struct inpcbtable *table, const struct sockaddr_in *dst,
u_int rtable, int errno, void (*notify)(struct inpcb *, int))
{
SIMPLEQ_HEAD(, inpcb) inpcblist;
struct inpcb *inp;
struct in_addr faddr;
u_int rdomain;
if (dst->sa_family != AF_INET)
return;
faddr = satosin(dst)->sin_addr;
if (faddr.s_addr == INADDR_ANY)
if (dst->sin_addr.s_addr == INADDR_ANY)
return;
if (notify == NULL)
return;
@ -754,7 +750,7 @@ in_pcbnotifyall(struct inpcbtable *table, struct sockaddr *dst, u_int rtable,
if (ISSET(inp->inp_flags, INP_IPV6))
continue;
#endif
if (inp->inp_faddr.s_addr != faddr.s_addr ||
if (inp->inp_faddr.s_addr != dst->sin_addr.s_addr ||
rtable_l2(inp->inp_rtableid) != rdomain) {
continue;
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: in_pcb.h,v 1.148 2024/01/09 19:57:00 bluhm Exp $ */
/* $OpenBSD: in_pcb.h,v 1.149 2024/01/28 20:34:25 bluhm Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@ -352,7 +352,7 @@ void in_pcbinit(struct inpcbtable *, int);
struct inpcb *
in_pcblookup_local_lock(struct inpcbtable *, const void *, u_int, int,
u_int, int);
void in_pcbnotifyall(struct inpcbtable *, struct sockaddr *,
void in_pcbnotifyall(struct inpcbtable *, const struct sockaddr_in *,
u_int, int, void (*)(struct inpcb *, int));
void in_pcbrehash(struct inpcb *);
void in_rtchange(struct inpcb *, int);
@ -367,7 +367,7 @@ struct rtentry *
in_pcbrtentry(struct inpcb *);
/* INET6 stuff */
void in6_pcbnotify(struct inpcbtable *, struct sockaddr_in6 *,
void in6_pcbnotify(struct inpcbtable *, const struct sockaddr_in6 *,
u_int, const struct sockaddr_in6 *, u_int, u_int, int, void *,
void (*)(struct inpcb *, int));
int in6_selecthlim(const struct inpcb *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_subr.c,v 1.196 2024/01/27 21:13:46 bluhm Exp $ */
/* $OpenBSD: tcp_subr.c,v 1.197 2024/01/28 20:34:25 bluhm Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@ -833,7 +833,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v)
}
in_pcbunref(inp);
} else
in_pcbnotifyall(&tcbtable, sa, rdomain, errno, notify);
in_pcbnotifyall(&tcbtable, satosin(sa), rdomain, errno, notify);
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_timer.c,v 1.75 2024/01/27 21:35:13 bluhm Exp $ */
/* $OpenBSD: tcp_timer.c,v 1.76 2024/01/28 20:34:25 bluhm Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
@ -236,8 +236,8 @@ tcp_timer_rexmt(void *arg)
sin.sin_len = sizeof(sin);
sin.sin_family = AF_INET;
sin.sin_addr = inp->inp_faddr;
in_pcbnotifyall(&tcbtable, sintosa(&sin), inp->inp_rtableid,
EMSGSIZE, tcp_mtudisc);
in_pcbnotifyall(&tcbtable, &sin, inp->inp_rtableid, EMSGSIZE,
tcp_mtudisc);
goto out;
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: udp_usrreq.c,v 1.315 2024/01/21 01:17:20 bluhm Exp $ */
/* $OpenBSD: udp_usrreq.c,v 1.316 2024/01/28 20:34:25 bluhm Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@ -919,7 +919,7 @@ udp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v)
notify(inp, errno);
in_pcbunref(inp);
} else
in_pcbnotifyall(&udbtable, sa, rdomain, errno, notify);
in_pcbnotifyall(&udbtable, satosin(sa), rdomain, errno, notify);
}
int