netlink.c (48a7afe314bfc4d7f50e1608632f503dbba7e013) | netlink.c (b4b510290b056b86611757ce1175a230f1080f53) |
---|---|
1/* 2 * Netlink event notifications for SELinux. 3 * 4 * Author: James Morris <jmorris@redhat.com> 5 * 6 * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License version 2, 10 * as published by the Free Software Foundation. 11 */ 12#include <linux/init.h> 13#include <linux/types.h> 14#include <linux/stddef.h> 15#include <linux/kernel.h> 16#include <linux/list.h> 17#include <linux/skbuff.h> 18#include <linux/netlink.h> 19#include <linux/selinux_netlink.h> | 1/* 2 * Netlink event notifications for SELinux. 3 * 4 * Author: James Morris <jmorris@redhat.com> 5 * 6 * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License version 2, 10 * as published by the Free Software Foundation. 11 */ 12#include <linux/init.h> 13#include <linux/types.h> 14#include <linux/stddef.h> 15#include <linux/kernel.h> 16#include <linux/list.h> 17#include <linux/skbuff.h> 18#include <linux/netlink.h> 19#include <linux/selinux_netlink.h> |
20#include <net/net_namespace.h> |
|
20 21static struct sock *selnl; 22 23static int selnl_msglen(int msgtype) 24{ 25 int ret = 0; 26 27 switch (msgtype) { --- 71 unchanged lines hidden (view full) --- 99 100void selnl_notify_policyload(u32 seqno) 101{ 102 selnl_notify(SELNL_MSG_POLICYLOAD, &seqno); 103} 104 105static int __init selnl_init(void) 106{ | 21 22static struct sock *selnl; 23 24static int selnl_msglen(int msgtype) 25{ 26 int ret = 0; 27 28 switch (msgtype) { --- 71 unchanged lines hidden (view full) --- 100 101void selnl_notify_policyload(u32 seqno) 102{ 103 selnl_notify(SELNL_MSG_POLICYLOAD, &seqno); 104} 105 106static int __init selnl_init(void) 107{ |
107 selnl = netlink_kernel_create(NETLINK_SELINUX, SELNLGRP_MAX, NULL, NULL, 108 THIS_MODULE); | 108 selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX, 109 SELNLGRP_MAX, NULL, NULL, THIS_MODULE); |
109 if (selnl == NULL) 110 panic("SELinux: Cannot create netlink socket."); 111 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV); 112 return 0; 113} 114 115__initcall(selnl_init); | 110 if (selnl == NULL) 111 panic("SELinux: Cannot create netlink socket."); 112 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV); 113 return 0; 114} 115 116__initcall(selnl_init); |