]> git.baikalelectronics.ru Git - kernel.git/commit
NetLabel: make netlbl_lsm_secattr struct easier/quicker to understand
authorPaul Moore <paul.moore@hp.com>
Fri, 17 Nov 2006 22:38:46 +0000 (17:38 -0500)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:24:07 +0000 (21:24 -0800)
commit9f2e965182c31e6f4374cf4588691f74c614f113
tree5fed88e6707e9122d7f16e4c5d8fea7c69e090ac
parent897a66acecc40e11b76f8045e025e04fdfd7671c
NetLabel: make netlbl_lsm_secattr struct easier/quicker to understand

The existing netlbl_lsm_secattr struct required the LSM to check all of the
fields to determine if any security attributes were present resulting in a lot
of work in the common case of no attributes.  This patch adds a 'flags' field
which is used to indicate which attributes are present in the structure; this
should allow the LSM to do a quick comparison to determine if the structure
holds any security attributes.

Example:

 if (netlbl_lsm_secattr->flags)
/* security attributes present */
 else
/* NO security attributes present */

Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/net/netlabel.h
net/ipv4/cipso_ipv4.c
net/netlabel/netlabel_kapi.c
security/selinux/ss/services.c