From 1ad65ec5558a78e0b11a136df0e67d66397cdcff Mon Sep 17 00:00:00 2001 From: glebius Date: Thu, 18 Nov 2004 13:49:18 +0000 Subject: - 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 --- sys/netinet/ip_divert.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'sys/netinet') 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, -- cgit v1.1