/* Description: A new incoming connection request is represented by @req, we need to label the new request_sock here and the stack will ensure the on-the-wire label will get preserved when a full sock is created once the connection handshake is complete. Returns zero on success, negative values on failure.  */
int selinux_netlbl_inet_conn_request(struct request_sock *req, u16 family)
/* Description: A new incoming connection request is represented by @req, we need to label the new request_sock here and the stack will ensure the on-the-wire label will get preserved when a full sock is created once the connection handshake is complete. Returns zero on success, negative values on failure.  */
int selinux_netlbl_inet_conn_request(struct request_sock *req, u16 family)
{
	int rc;
	struct netlbl_lsm_secattr secattr;
	if (family != PF_INET)
		return 0;
	netlbl_secattr_init(&secattr);
	rc = security_netlbl_sid_to_secattr(req->secid, &secattr);
	if (rc != 0)
		goto inet_conn_request_return;
	rc = netlbl_req_setattr(req, &secattr);
inet_conn_request_return:
	netlbl_secattr_destroy(&secattr);
	return rc;
}