projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[powerpc.git]
/
net
/
netfilter
/
nfnetlink.c
diff --git
a/net/netfilter/nfnetlink.c
b/net/netfilter/nfnetlink.c
index
a60c59b
..
52fdfa2
100644
(file)
--- a/
net/netfilter/nfnetlink.c
+++ b/
net/netfilter/nfnetlink.c
@@
-14,7
+14,6
@@
* of the GNU General Public License, incorporated herein by reference.
*/
* of the GNU General Public License, incorporated herein by reference.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/socket.h>
@@
-162,7
+161,7
@@
nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys,
return -EINVAL;
}
return -EINVAL;
}
- min_len = NLMSG_
ALIGN
(sizeof(struct nfgenmsg));
+ min_len = NLMSG_
SPACE
(sizeof(struct nfgenmsg));
if (unlikely(nlh->nlmsg_len < min_len))
return -EINVAL;
if (unlikely(nlh->nlmsg_len < min_len))
return -EINVAL;
@@
-191,6
+190,12
@@
nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys,
return 0;
}
return 0;
}
+int nfnetlink_has_listeners(unsigned int group)
+{
+ return netlink_has_listeners(nfnl, group);
+}
+EXPORT_SYMBOL_GPL(nfnetlink_has_listeners);
+
int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
{
gfp_t allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
{
gfp_t allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
@@
-212,7
+217,7
@@
int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags)
}
/* Process one complete nfnetlink message. */
}
/* Process one complete nfnetlink message. */
-static in
line in
t nfnetlink_rcv_msg(struct sk_buff *skb,
+static int nfnetlink_rcv_msg(struct sk_buff *skb,
struct nlmsghdr *nlh, int *errp)
{
struct nfnl_callback *nc;
struct nlmsghdr *nlh, int *errp)
{
struct nfnl_callback *nc;
@@
-223,7
+228,7
@@
static inline int nfnetlink_rcv_msg(struct sk_buff *skb,
NFNL_SUBSYS_ID(nlh->nlmsg_type),
NFNL_MSG_TYPE(nlh->nlmsg_type));
NFNL_SUBSYS_ID(nlh->nlmsg_type),
NFNL_MSG_TYPE(nlh->nlmsg_type));
- if (
!cap_raised(NETLINK_CB(skb).eff_cap
, CAP_NET_ADMIN)) {
+ if (
security_netlink_recv(skb
, CAP_NET_ADMIN)) {
DEBUGP("missing CAP_NET_ADMIN\n");
*errp = -EPERM;
return -1;
DEBUGP("missing CAP_NET_ADMIN\n");
*errp = -EPERM;
return -1;
@@
-236,8
+241,7
@@
static inline int nfnetlink_rcv_msg(struct sk_buff *skb,
}
/* All the messages must at least contain nfgenmsg */
}
/* All the messages must at least contain nfgenmsg */
- if (nlh->nlmsg_len <
- NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) {
+ if (nlh->nlmsg_len < NLMSG_SPACE(sizeof(struct nfgenmsg))) {
DEBUGP("received message was too short\n");
return 0;
}
DEBUGP("received message was too short\n");
return 0;
}