--- zzzz-none-000/linux-2.6.13.1/net/netlink/af_netlink.c 2005-09-10 02:42:58.000000000 +0000 +++ ohio-7170-487/linux-2.6.13.1/net/netlink/af_netlink.c 2007-08-17 12:10:39.000000000 +0000 @@ -8,7 +8,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. - * + * * Tue Jun 26 14:36:48 MEST 2001 Herbert "herp" Rosmanith * added netlink_proto_exit * Tue Jan 22 18:32:44 BRST 2002 Arnaldo C. de Melo @@ -393,8 +393,8 @@ .pid = nlk->pid, }; notifier_call_chain(&netlink_chain, NETLINK_URELEASE, &n); - } - + } + sock_put(sk); return 0; } @@ -437,11 +437,11 @@ return err; } -static inline int netlink_capable(struct socket *sock, unsigned int flag) -{ +static inline int netlink_capable(struct socket *sock, unsigned int flag) +{ return (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) || capable(CAP_NET_ADMIN); -} +} static int netlink_bind(struct socket *sock, struct sockaddr *addr, int addr_len) { @@ -449,7 +449,7 @@ struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; int err; - + if (nladdr->nl_family != AF_NETLINK) return -EINVAL; @@ -520,7 +520,7 @@ struct sock *sk = sock->sk; struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr=(struct sockaddr_nl *)addr; - + nladdr->nl_family = AF_NETLINK; nladdr->nl_pad = 0; *addr_len = sizeof(*nladdr); @@ -1017,7 +1017,7 @@ } /* - * We export these functions to other modules. They provide a + * We export these functions to other modules. They provide a * complete set of kernel non-blocking support for message * queueing. */ @@ -1054,10 +1054,10 @@ } void netlink_set_nonroot(int protocol, unsigned int flags) -{ - if ((unsigned int)protocol < MAX_LINKS) +{ + if ((unsigned int)protocol < MAX_LINKS) nl_table[protocol].nl_nonroot = flags; -} +} static void netlink_destroy_callback(struct netlink_callback *cb) { @@ -1078,7 +1078,7 @@ struct sk_buff *skb; struct nlmsghdr *nlh; int len; - + skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL); if (!skb) return -ENOBUFS; @@ -1241,7 +1241,7 @@ if (v == SEQ_START_TOKEN) return netlink_seq_socket_idx(seq, 0); - + s = sk_next(v); if (s) return s; @@ -1348,7 +1348,7 @@ { return notifier_chain_unregister(&netlink_chain, nb); } - + static struct proto_ops netlink_ops = { .family = PF_NETLINK, .owner = THIS_MODULE, @@ -1432,7 +1432,7 @@ #ifdef CONFIG_PROC_FS proc_net_fops_create("netlink", 0, &netlink_seq_fops); #endif - /* The netlink device handler may be needed early. */ + /* The netlink device handler may be needed early. */ rtnetlink_init(); out: return err; @@ -1441,7 +1441,9 @@ static void __exit netlink_proto_exit(void) { sock_unregister(PF_NETLINK); +#if defined(CONFIG_PROC_FS) proc_net_remove("netlink"); +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ kfree(nl_table); nl_table = NULL; proto_unregister(&netlink_proto);