optional.
We have no interest on pru_abort() return value. We call it only from
soabort() which is dummy pru_abort() wrapper and has no return value.
Only the connection oriented sockets need to implement (*pru_abort)()
handler. Such sockets are tcp(4) and unix(4) sockets, so remove existing
code for all others, it doesn't called.
ok guenther@
-/* $OpenBSD: uipc_usrreq.c,v 1.190 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.191 2022/10/17 14:49:01 mvs Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
return (error);
}
-int
+void
uipc_abort(struct socket *so)
{
struct unpcb *unp = sotounpcb(so);
unp_detach(unp);
sofree(so, 0);
-
- return (0);
}
int
-/* $OpenBSD: pfkeyv2.c,v 1.253 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.254 2022/10/17 14:49:01 mvs Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
int pfkeyv2_shutdown(struct socket *);
int pfkeyv2_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int pfkeyv2_abort(struct socket *);
int pfkeyv2_sockaddr(struct socket *, struct mbuf *);
int pfkeyv2_peeraddr(struct socket *, struct mbuf *);
int pfkeyv2_output(struct mbuf *, struct socket *);
.pru_disconnect = pfkeyv2_disconnect,
.pru_shutdown = pfkeyv2_shutdown,
.pru_send = pfkeyv2_send,
- .pru_abort = pfkeyv2_abort,
.pru_sockaddr = pfkeyv2_sockaddr,
.pru_peeraddr = pfkeyv2_peeraddr,
};
return (error);
}
-int
-pfkeyv2_abort(struct socket *so)
-{
- soisdisconnected(so);
- return (0);
-}
-
int
pfkeyv2_sockaddr(struct socket *so, struct mbuf *nam)
{
-/* $OpenBSD: rtsock.c,v 1.357 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: rtsock.c,v 1.358 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
void route_rcvd(struct socket *);
int route_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int route_abort(struct socket *);
int route_sockaddr(struct socket *, struct mbuf *);
int route_peeraddr(struct socket *, struct mbuf *);
void route_input(struct mbuf *m0, struct socket *, sa_family_t);
return (error);
}
-int
-route_abort(struct socket *so)
-{
- soisdisconnected(so);
- return (0);
-}
-
int
route_sockaddr(struct socket *so, struct mbuf *nam)
{
.pru_shutdown = route_shutdown,
.pru_rcvd = route_rcvd,
.pru_send = route_send,
- .pru_abort = route_abort,
.pru_sockaddr = route_sockaddr,
.pru_peeraddr = route_peeraddr,
};
-/* $OpenBSD: ip_divert.c,v 1.88 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip_divert.c,v 1.89 2022/10/17 14:49:02 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
.pru_bind = divert_bind,
.pru_shutdown = divert_shutdown,
.pru_send = divert_send,
- .pru_abort = divert_abort,
.pru_control = in_control,
.pru_sockaddr = in_sockaddr,
.pru_peeraddr = in_peeraddr,
return (divert_output(inp, m, addr, control));
}
-int
-divert_abort(struct socket *so)
-{
- struct inpcb *inp = sotoinpcb(so);
-
- soassertlocked(so);
-
- soisdisconnected(so);
- in_pcbdetach(inp);
-
- return (0);
-}
-
int
divert_sysctl_divstat(void *oldp, size_t *oldlenp, void *newp)
{
-/* $OpenBSD: ip_divert.h,v 1.23 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip_divert.h,v 1.24 2022/10/17 14:49:02 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
int divert_shutdown(struct socket *);
int divert_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int divert_abort(struct socket *);
#endif /* _KERNEL */
#endif /* _IP_DIVERT_H_ */
-/* $OpenBSD: ip_gre.c,v 1.84 2022/09/03 22:43:38 mvs Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.85 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
.pru_disconnect = rip_disconnect,
.pru_shutdown = rip_shutdown,
.pru_send = gre_send,
- .pru_abort = rip_abort,
.pru_control = in_control,
.pru_sockaddr = in_sockaddr,
.pru_peeraddr = in_peeraddr,
-/* $OpenBSD: ip_var.h,v 1.106 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip_var.h,v 1.107 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
/*
int rip_shutdown(struct socket *);
int rip_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int rip_abort(struct socket *);
#ifdef MROUTING
extern struct socket *ip_mrouter[]; /* multicast routing daemon */
#endif
-/* $OpenBSD: raw_ip.c,v 1.149 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.150 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
.pru_disconnect = rip_disconnect,
.pru_shutdown = rip_shutdown,
.pru_send = rip_send,
- .pru_abort = rip_abort,
.pru_control = in_control,
.pru_sockaddr = in_sockaddr,
.pru_peeraddr = in_peeraddr,
return (error);
}
-
-int
-rip_abort(struct socket *so)
-{
- struct inpcb *inp = sotoinpcb(so);
-
- soassertlocked(so);
-
- soisdisconnected(so);
-#ifdef MROUTING
- if (so == ip_mrouter[inp->inp_rtableid])
- ip_mrouter_done(so);
-#endif
- in_pcbdetach(inp);
-
- return (0);
-}
-/* $OpenBSD: tcp_usrreq.c,v 1.209 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.210 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
/*
* Abort the TCP.
*/
-int
+void
tcp_abort(struct socket *so)
{
struct inpcb *inp;
struct tcpcb *tp, *otp = NULL;
- 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) {
otp = tp;
if (otp)
tcp_trace(TA_USER, ostate, tp, otp, NULL, PRU_ABORT, 0);
- return (0);
}
int
-/* $OpenBSD: tcp_var.h,v 1.159 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.160 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
void tcp_rcvd(struct socket *);
int tcp_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int tcp_abort(struct socket *);
+void tcp_abort(struct socket *);
int tcp_sockaddr(struct socket *, struct mbuf *);
int tcp_peeraddr(struct socket *, struct mbuf *);
int tcp_sense(struct socket *, struct stat *);
-/* $OpenBSD: udp_usrreq.c,v 1.303 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.304 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
.pru_disconnect = udp_disconnect,
.pru_shutdown = udp_shutdown,
.pru_send = udp_send,
- .pru_abort = udp_abort,
.pru_control = in_control,
.pru_sockaddr = in_sockaddr,
.pru_peeraddr = in_peeraddr,
.pru_disconnect = udp_disconnect,
.pru_shutdown = udp_shutdown,
.pru_send = udp_send,
- .pru_abort = udp_abort,
.pru_control = in6_control,
.pru_sockaddr = in6_sockaddr,
.pru_peeraddr = in6_peeraddr,
return (error);
}
-int
-udp_abort(struct socket *so)
-{
- struct inpcb *inp = sotoinpcb(so);
-
- soassertlocked(so);
-
- soisdisconnected(so);
- in_pcbdetach(inp);
-
- return (0);
-}
-
/*
* Sysctl for udp variables.
*/
-/* $OpenBSD: udp_var.h,v 1.48 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: udp_var.h,v 1.49 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: udp_var.h,v 1.12 1996/02/13 23:44:41 christos Exp $ */
/*
int udp_shutdown(struct socket *);
int udp_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int udp_abort(struct socket *);
#endif /* _KERNEL */
#endif /* _NETINET_UDP_VAR_H_ */
-/* $OpenBSD: ip6_divert.c,v 1.87 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip6_divert.c,v 1.88 2022/10/17 14:49:02 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
.pru_bind = divert6_bind,
.pru_shutdown = divert6_shutdown,
.pru_send = divert6_send,
- .pru_abort = divert6_abort,
.pru_control = in6_control,
.pru_sockaddr = in6_sockaddr,
.pru_peeraddr = in6_peeraddr,
return (divert6_output(inp, m, addr, control));
}
-int
-divert6_abort(struct socket *so)
-{
- struct inpcb *inp = sotoinpcb(so);
-
- soassertlocked(so);
- soisdisconnected(so);
- in_pcbdetach(inp);
-
- return (0);
-}
-
int
divert6_sysctl_div6stat(void *oldp, size_t *oldlenp, void *newp)
{
-/* $OpenBSD: ip6_divert.h,v 1.21 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip6_divert.h,v 1.22 2022/10/17 14:49:02 mvs Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
int divert6_shutdown(struct socket *);
int divert6_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int divert6_abort(struct socket *);
#endif /* _KERNEL */
#endif /* _IP6_DIVERT_H_ */
-/* $OpenBSD: ip6_var.h,v 1.104 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.105 2022/10/17 14:49:02 mvs Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
int rip6_shutdown(struct socket *);
int rip6_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int rip6_abort(struct socket *);
int rip6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int dest6_input(struct mbuf **, int *, int, int);
-/* $OpenBSD: raw_ip6.c,v 1.170 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.171 2022/10/17 14:49:02 mvs Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
.pru_disconnect = rip6_disconnect,
.pru_shutdown = rip6_shutdown,
.pru_send = rip6_send,
- .pru_abort = rip6_abort,
.pru_control = in6_control,
.pru_sockaddr = in6_sockaddr,
.pru_peeraddr = in6_peeraddr,
return (error);
}
-int
-rip6_abort(struct socket *so)
-{
- struct inpcb *in6p = sotoinpcb(so);
-
- soassertlocked(so);
-
- soisdisconnected(so);
-#ifdef MROUTING
- if (so == ip6_mrouter[in6p->inp_rtableid])
- ip6_mrouter_done(so);
-#endif
- free(in6p->inp_icmp6filt, M_PCB, sizeof(struct icmp6_filter));
- in6p->inp_icmp6filt = NULL;
-
- in_pcbdetach(in6p);
-
- return (0);
-}
-
int
rip6_sysctl_rip6stat(void *oldp, size_t *oldplen, void *newp)
{
-/* $OpenBSD: protosw.h,v 1.57 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: protosw.h,v 1.58 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
void (*pru_rcvd)(struct socket *);
int (*pru_send)(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
- int (*pru_abort)(struct socket *);
+ void (*pru_abort)(struct socket *);
int (*pru_control)(struct socket *, u_long, caddr_t,
struct ifnet *);
int (*pru_sense)(struct socket *, struct stat *);
return (*so->so_proto->pr_usrreqs->pru_send)(so, top, addr, control);
}
-static inline int
+static inline void
pru_abort(struct socket *so)
{
- return (*so->so_proto->pr_usrreqs->pru_abort)(so);
+ (*so->so_proto->pr_usrreqs->pru_abort)(so);
}
static inline int
-/* $OpenBSD: unpcb.h,v 1.42 2022/10/03 16:43:52 bluhm Exp $ */
+/* $OpenBSD: unpcb.h,v 1.43 2022/10/17 14:49:02 mvs Exp $ */
/* $NetBSD: unpcb.h,v 1.6 1994/06/29 06:46:08 cgd Exp $ */
/*
void uipc_rcvd(struct socket *);
int uipc_send(struct socket *, struct mbuf *, struct mbuf *,
struct mbuf *);
-int uipc_abort(struct socket *);
+void uipc_abort(struct socket *);
int uipc_sense(struct socket *, struct stat *);
int uipc_sockaddr(struct socket *, struct mbuf *);
int uipc_peeraddr(struct socket *, struct mbuf *);