sync with OpenBSD -current

This commit is contained in:
purplerain 2023-12-06 11:41:20 +00:00
parent bd69b5651c
commit f7289b5181
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
11 changed files with 388 additions and 27 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ip_mroute.c,v 1.139 2023/06/14 14:30:08 mvs Exp $ */
/* $OpenBSD: ip_mroute.c,v 1.140 2023/12/06 09:27:17 bluhm Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
@ -1048,11 +1048,18 @@ del_mfc(struct socket *so, struct mbuf *m)
}
int
socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src)
socket_send(struct socket *so, struct mbuf *mm, struct sockaddr_in *src)
{
if (s != NULL) {
if (sbappendaddr(s, &s->so_rcv, sintosa(src), mm, NULL) != 0) {
sorwakeup(s);
if (so != NULL) {
struct inpcb *inp = sotoinpcb(so);
int ret;
mtx_enter(&inp->inp_mtx);
ret = sbappendaddr(so, &so->so_rcv, sintosa(src), mm, NULL);
mtx_leave(&inp->inp_mtx);
if (ret != 0) {
sorwakeup(so);
return (0);
}
}