Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selinux: replace obsolete NLMSG_* with type safe nlmsg_*

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hong zhi guo and committed by
David S. Miller
77954983 94191213

+3 -4
+2 -2
security/selinux/hooks.c
··· 60 60 #include <linux/bitops.h> 61 61 #include <linux/interrupt.h> 62 62 #include <linux/netdevice.h> /* for network interface checks */ 63 - #include <linux/netlink.h> 63 + #include <net/netlink.h> 64 64 #include <linux/tcp.h> 65 65 #include <linux/udp.h> 66 66 #include <linux/dccp.h> ··· 4475 4475 struct nlmsghdr *nlh; 4476 4476 struct sk_security_struct *sksec = sk->sk_security; 4477 4477 4478 - if (skb->len < NLMSG_SPACE(0)) { 4478 + if (skb->len < NLMSG_HDRLEN) { 4479 4479 err = -EINVAL; 4480 4480 goto out; 4481 4481 }
+1 -2
security/selinux/netlink.c
··· 16 16 #include <linux/kernel.h> 17 17 #include <linux/export.h> 18 18 #include <linux/skbuff.h> 19 - #include <linux/netlink.h> 20 19 #include <linux/selinux_netlink.h> 21 20 #include <net/net_namespace.h> 22 21 #include <net/netlink.h> ··· 76 77 77 78 len = selnl_msglen(msgtype); 78 79 79 - skb = alloc_skb(NLMSG_SPACE(len), GFP_USER); 80 + skb = nlmsg_new(len, GFP_USER); 80 81 if (!skb) 81 82 goto oom; 82 83