On Tue, Dec 1, 2015 at 11:53 AM, Tom Herbert <t...@herbertland.com> wrote: > This is awesome! The only thing I would suggest is to make > sock_destroy a proto_op so that it can be called from within the > kernel. This should be preferred to externally calling tcp_done > (hopefully we can unexport that symbol then).
I'm not sure there is value in making it a proto op. The sock_diag code that finds the socket based on the netlink diag request is specific to both the protocol family (e.g., the sock_diag structures for inet and unix differ) and protocol (e.g., TCP, UDPv4 and UDPv6 use different hash tables). So even if we add a proto_op (or struct proto function pointer) to destroy a socket, we can't just have a generic function (or even an inet-specific function) that just finds a socket and does "return sk->sk_prot->diag_destroy(sk)" regardless of what protocol that socket is. The code does look better if the protocol-specific code is moved to a new tcp_abort function that just takes a pointer to the sk. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html