on pru_rcvd() return value.
Drop "pru_rcvd != NULL" check within pru_rcvd() wrapper. We only call it
if the socket's protocol have PR_WANTRCVD flag set. Such sockets are
route domain, tcp(4) and unix(4) sockets.
ok guenther@ bluhm@
-/* $OpenBSD: uipc_usrreq.c,v 1.185 2022/09/03 22:43:38 mvs Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.186 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
return (0);
}
-int
+void
uipc_rcvd(struct socket *so)
{
struct socket *so2;
default:
panic("uipc 2");
}
-
- return (0);
}
int
-/* $OpenBSD: rtsock.c,v 1.355 2022/09/08 10:22:06 kn Exp $ */
+/* $OpenBSD: rtsock.c,v 1.356 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
int route_detach(struct socket *);
int route_disconnect(struct socket *);
int route_shutdown(struct socket *);
-int route_rcvd(struct socket *);
+void route_rcvd(struct socket *);
int route_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
int route_abort(struct socket *);
return (0);
}
-int
+void
route_rcvd(struct socket *so)
{
struct rtpcb *rop = sotortpcb(so);
((sbspace(rop->rop_socket, &rop->rop_socket->so_rcv) ==
rop->rop_socket->so_rcv.sb_hiwat)))
rop->rop_flags &= ~ROUTECB_FLAG_FLUSH;
-
- return (0);
}
int
-/* $OpenBSD: tcp_usrreq.c,v 1.207 2022/09/03 22:43:38 mvs Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.208 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
/*
* After a receive, possibly send window update to peer.
*/
-int
+void
tcp_rcvd(struct socket *so)
{
struct inpcb *inp;
struct tcpcb *tp;
- int error;
short ostate;
soassertlocked(so);
- if ((error = tcp_sogetpcb(so, &inp, &tp)))
- return (error);
+ if (tcp_sogetpcb(so, &inp, &tp))
+ return;
if (so->so_options & SO_DEBUG)
ostate = tp->t_state;
if (so->so_options & SO_DEBUG)
tcp_trace(TA_USER, ostate, tp, tp, NULL, PRU_RCVD, 0);
- return (0);
}
/*
-/* $OpenBSD: tcp_var.h,v 1.157 2022/09/03 22:43:38 mvs Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.158 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
int tcp_accept(struct socket *, struct mbuf *);
int tcp_disconnect(struct socket *);
int tcp_shutdown(struct socket *);
-int tcp_rcvd(struct socket *);
+void tcp_rcvd(struct socket *);
int tcp_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
int tcp_abort(struct socket *);
-/* $OpenBSD: protosw.h,v 1.55 2022/09/05 14:56:09 bluhm Exp $ */
+/* $OpenBSD: protosw.h,v 1.56 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
int (*pru_accept)(struct socket *, struct mbuf *);
int (*pru_disconnect)(struct socket *);
int (*pru_shutdown)(struct socket *);
- int (*pru_rcvd)(struct socket *);
+ void (*pru_rcvd)(struct socket *);
int (*pru_send)(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
int (*pru_abort)(struct socket *);
return (*so->so_proto->pr_usrreqs->pru_shutdown)(so);
}
-static inline int
+static inline void
pru_rcvd(struct socket *so)
{
- if (so->so_proto->pr_usrreqs->pru_rcvd)
- return (*so->so_proto->pr_usrreqs->pru_rcvd)(so);
- return (EOPNOTSUPP);
+ (*so->so_proto->pr_usrreqs->pru_rcvd)(so);
}
static inline int
-/* $OpenBSD: unpcb.h,v 1.40 2022/09/03 22:43:39 mvs Exp $ */
+/* $OpenBSD: unpcb.h,v 1.41 2022/09/13 09:05:47 mvs Exp $ */
/* $NetBSD: unpcb.h,v 1.6 1994/06/29 06:46:08 cgd Exp $ */
/*
int uipc_accept(struct socket *, struct mbuf *);
int uipc_disconnect(struct socket *);
int uipc_shutdown(struct socket *);
-int uipc_rcvd(struct socket *);
+void uipc_rcvd(struct socket *);
int uipc_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
int uipc_abort(struct socket *);