/* Returns 0 on success, and error code otherwise  */
static int smack_socket_connect(struct socket *sock, struct sockaddr *sap, int addrlen)
/* Returns 0 on success, and error code otherwise  */
static int smack_socket_connect(struct socket *sock, struct sockaddr *sap, int addrlen)
{
	if (sock->sk == NULL || sock->sk->sk_family != PF_INET)
		return 0;
	if (addrlen < sizeof(struct sockaddr_in))
		return -EINVAL;
	return smack_netlabel_send(sock->sk, (struct sockaddr_in *)sap);
}