Beispiel #1
0
static int check_sock_diag(void)
{
	int ret;

	ret = collect_sockets(0);
	if (!ret)
		return 0;

	pr_msg("The sock diag infrastructure is incomplete.\n");
	pr_msg("Make sure you have:\n");
	pr_msg(" 1. *_DIAG kernel config options turned on;\n");
	pr_msg(" 2. *_diag.ko modules loaded (if compiled as modules).\n");
	return -1;
}
Beispiel #2
0
static int check_sock_diag(void)
{
    int ret;
    struct ns_id ns;

    ns.pid = 0;
    ns.net.nlsk = socket(PF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);
    if (ns.net.nlsk < 0) {
        pr_perror("Can't make diag socket for check");
        return -1;
    }

    ret = collect_sockets(&ns);
    if (!ret)
        return 0;

    pr_msg("The sock diag infrastructure is incomplete.\n");
    pr_msg("Make sure you have:\n");
    pr_msg(" 1. *_DIAG kernel config options turned on;\n");
    pr_msg(" 2. *_diag.ko modules loaded (if compiled as modules).\n");
    return -1;
}