summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2004-11-18 13:49:18 +0000
committerglebius <glebius@FreeBSD.org>2004-11-18 13:49:18 +0000
commit1ad65ec5558a78e0b11a136df0e67d66397cdcff (patch)
treee7a7bee1ea8df5b8e096ffa2ab18d5a1bde4e9d8
parentb18d29fccd36590b0a4caf6d0b44d57b2b8d0635 (diff)
downloadFreeBSD-src-1ad65ec5558a78e0b11a136df0e67d66397cdcff.zip
FreeBSD-src-1ad65ec5558a78e0b11a136df0e67d66397cdcff.tar.gz
- Since divert protocol is not connection oriented, remove SS_ISCONNECTED flag
from divert sockets. - Remove div_disconnect() method, since it shouldn't be called now. - Remove div_abort() method. It was never called directly, since protocol doesn't have listen queue. It was called only from div_disconnect(), which is removed now. Reviewed by: rwatson, maxim Approved by: julian (mentor) MT5 after: 1 week MT4 after: 1 month
-rw-r--r--sys/netinet/ip_divert.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 8d2b61b..6287e76 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -415,12 +415,7 @@ div_attach(struct socket *so, int proto, struct thread *td)
inp->inp_ip_p = proto;
inp->inp_vflag |= INP_IPV4;
inp->inp_flags |= INP_HDRINCL;
- /* The socket is always "connected" because
- we always know "where" to send the packet */
INP_UNLOCK(inp);
- SOCK_LOCK(so);
- so->so_state |= SS_ISCONNECTED;
- SOCK_UNLOCK(so);
return 0;
}
@@ -442,32 +437,6 @@ div_detach(struct socket *so)
}
static int
-div_abort(struct socket *so)
-{
- struct inpcb *inp;
-
- INP_INFO_WLOCK(&divcbinfo);
- inp = sotoinpcb(so);
- if (inp == 0) {
- INP_INFO_WUNLOCK(&divcbinfo);
- return EINVAL; /* ??? possible? panic instead? */
- }
- INP_LOCK(inp);
- soisdisconnected(so);
- in_pcbdetach(inp);
- INP_INFO_WUNLOCK(&divcbinfo);
- return 0;
-}
-
-static int
-div_disconnect(struct socket *so)
-{
- if ((so->so_state & SS_ISCONNECTED) == 0)
- return ENOTCONN;
- return div_abort(so);
-}
-
-static int
div_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct inpcb *inp;
@@ -662,12 +631,10 @@ SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, 0, 0,
#endif
struct pr_usrreqs div_usrreqs = {
- .pru_abort = div_abort,
.pru_attach = div_attach,
.pru_bind = div_bind,
.pru_control = in_control,
.pru_detach = div_detach,
- .pru_disconnect = div_disconnect,
.pru_peeraddr = div_peeraddr,
.pru_send = div_send,
.pru_shutdown = div_shutdown,
OpenPOWER on IntegriCloud