Commit ac6d439d authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETLINK]: Convert netlink users to use group numbers instead of bitmasks

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d629b836
...@@ -51,7 +51,7 @@ void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg) ...@@ -51,7 +51,7 @@ void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg)
memcpy(data, msg, sizeof(struct w1_netlink_msg)); memcpy(data, msg, sizeof(struct w1_netlink_msg));
NETLINK_CB(skb).dst_groups = dev->groups; NETLINK_CB(skb).dst_group = dev->groups;
netlink_broadcast(dev->nls, skb, 0, dev->groups, GFP_ATOMIC); netlink_broadcast(dev->nls, skb, 0, dev->groups, GFP_ATOMIC);
nlmsg_failure: nlmsg_failure:
......
...@@ -2,13 +2,34 @@ ...@@ -2,13 +2,34 @@
#define _NFNETLINK_H #define _NFNETLINK_H
#include <linux/types.h> #include <linux/types.h>
/* nfnetlink groups: Up to 32 maximum */ #ifndef __KERNEL__
/* nfnetlink groups: Up to 32 maximum - backwards compatibility for userspace */
#define NF_NETLINK_CONNTRACK_NEW 0x00000001 #define NF_NETLINK_CONNTRACK_NEW 0x00000001
#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002 #define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004 #define NF_NETLINK_CONNTRACK_DESTROY 0x00000004
#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008 #define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010 #define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020 #define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
#endif
enum nfnetlink_groups {
NFNLGRP_NONE,
#define NFNLGRP_NONE NFNLGRP_NONE
NFNLGRP_CONNTRACK_NEW,
#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
NFNLGRP_CONNTRACK_UPDATE,
#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
NFNLGRP_CONNTRACK_DESTROY,
#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
NFNLGRP_CONNTRACK_EXP_NEW,
#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
NFNLGRP_CONNTRACK_EXP_UPDATE,
#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
NFNLGRP_CONNTRACK_EXP_DESTROY,
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
__NFNLGRP_MAX,
};
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
/* Generic structure for encapsulation optional netfilter information. /* Generic structure for encapsulation optional netfilter information.
* It is reminiscent of sockaddr, but with sa_family replaced * It is reminiscent of sockaddr, but with sa_family replaced
......
...@@ -56,7 +56,21 @@ struct nf_dn_rtmsg { ...@@ -56,7 +56,21 @@ struct nf_dn_rtmsg {
#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg))) #define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)))
#ifndef __KERNEL__
/* backwards compatibility for userspace */
#define DNRMG_L1_GROUP 0x01 #define DNRMG_L1_GROUP 0x01
#define DNRMG_L2_GROUP 0x02 #define DNRMG_L2_GROUP 0x02
#endif
enum {
DNRNG_NLGRP_NONE,
#define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE
DNRNG_NLGRP_L1,
#define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1
DNRNG_NLGRP_L2,
#define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2
__DNRNG_NLGRP_MAX
};
#define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1)
#endif /*__LINUX_DECNET_NETFILTER_H*/ #endif /*__LINUX_DECNET_NETFILTER_H*/
...@@ -826,9 +826,8 @@ enum ...@@ -826,9 +826,8 @@ enum
#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
#ifndef __KERNEL__
/* RTnetlink multicast groups */ /* RTnetlink multicast groups - backwards compatibility for userspace */
#define RTMGRP_LINK 1 #define RTMGRP_LINK 1
#define RTMGRP_NOTIFY 2 #define RTMGRP_NOTIFY 2
#define RTMGRP_NEIGH 4 #define RTMGRP_NEIGH 4
...@@ -847,6 +846,43 @@ enum ...@@ -847,6 +846,43 @@ enum
#define RTMGRP_DECnet_ROUTE 0x4000 #define RTMGRP_DECnet_ROUTE 0x4000
#define RTMGRP_IPV6_PREFIX 0x20000 #define RTMGRP_IPV6_PREFIX 0x20000
#endif
/* RTnetlink multicast groups */
enum rtnetlink_groups {
RTNLGRP_NONE,
#define RTNLGRP_NONE RTNLGRP_NONE
RTNLGRP_LINK,
#define RTNLGRP_LINK RTNLGRP_LINK
RTNLGRP_NOTIFY,
#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
RTNLGRP_NEIGH,
#define RTNLGRP_NEIGH RTNLGRP_NEIGH
RTNLGRP_TC,
#define RTNLGRP_TC RTNLGRP_TC
RTNLGRP_IPV4_IFADDR,
#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
RTNLGRP_IPV4_MROUTE,
#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
RTNLGRP_IPV4_ROUTE,
#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
RTNLGRP_IPV6_IFADDR,
#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
RTNLGRP_IPV6_MROUTE,
#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
RTNLGRP_IPV6_ROUTE,
#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
RTNLGRP_IPV6_IFINFO,
#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
RTNLGRP_DECnet_IFADDR,
#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
RTNLGRP_DECnet_ROUTE,
#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
RTNLGRP_IPV6_PREFIX,
#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
__RTNLGRP_MAX
};
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
/* TC action piece */ /* TC action piece */
struct tcamsg struct tcamsg
......
...@@ -20,10 +20,21 @@ enum { ...@@ -20,10 +20,21 @@ enum {
SELNL_MSG_MAX SELNL_MSG_MAX
}; };
/* Multicast groups */ #ifndef __KERNEL__
/* Multicast groups - backwards compatiblility for userspace */
#define SELNL_GRP_NONE 0x00000000 #define SELNL_GRP_NONE 0x00000000
#define SELNL_GRP_AVC 0x00000001 /* AVC notifications */ #define SELNL_GRP_AVC 0x00000001 /* AVC notifications */
#define SELNL_GRP_ALL 0xffffffff #define SELNL_GRP_ALL 0xffffffff
#endif
enum selinux_nlgroups {
SELNLGRP_NONE,
#define SELNLGRP_NONE SELNLGRP_NONE
SELNLGRP_AVC,
#define SELNLGRP_AVC SELNLGRP_AVC
__SELNLGRP_MAX
};
#define SELNLGRP_MAX (__SELNLGRP_MAX - 1)
/* Message structures */ /* Message structures */
struct selnl_msg_setenforce { struct selnl_msg_setenforce {
......
...@@ -258,9 +258,27 @@ struct xfrm_usersa_flush { ...@@ -258,9 +258,27 @@ struct xfrm_usersa_flush {
__u8 proto; __u8 proto;
}; };
#ifndef __KERNEL__
/* backwards compatibility for userspace */
#define XFRMGRP_ACQUIRE 1 #define XFRMGRP_ACQUIRE 1
#define XFRMGRP_EXPIRE 2 #define XFRMGRP_EXPIRE 2
#define XFRMGRP_SA 4 #define XFRMGRP_SA 4
#define XFRMGRP_POLICY 8 #define XFRMGRP_POLICY 8
#endif
enum xfrm_nlgroups {
XFRMNLGRP_NONE,
#define XFRMNLGRP_NONE XFRMNLGRP_NONE
XFRMNLGRP_ACQUIRE,
#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
XFRMNLGRP_EXPIRE,
#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
XFRMNLGRP_SA,
#define XFRMNLGRP_SA XFRMNLGRP_SA
XFRMNLGRP_POLICY,
#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
__XFRMNLGRP_MAX
};
#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
#endif /* _LINUX_XFRM_H */ #endif /* _LINUX_XFRM_H */
...@@ -93,7 +93,7 @@ static int send_uevent(const char *signal, const char *obj, ...@@ -93,7 +93,7 @@ static int send_uevent(const char *signal, const char *obj,
} }
} }
NETLINK_CB(skb).dst_groups = 1; NETLINK_CB(skb).dst_group = 1;
return netlink_broadcast(uevent_sock, skb, 0, 1, gfp_mask); return netlink_broadcast(uevent_sock, skb, 0, 1, gfp_mask);
} }
......
...@@ -78,8 +78,8 @@ static void ulog_send(unsigned int nlgroup) ...@@ -78,8 +78,8 @@ static void ulog_send(unsigned int nlgroup)
if (ub->qlen > 1) if (ub->qlen > 1)
ub->lastnlh->nlmsg_type = NLMSG_DONE; ub->lastnlh->nlmsg_type = NLMSG_DONE;
NETLINK_CB(ub->skb).dst_groups = 1 << nlgroup; NETLINK_CB(ub->skb).dst_group = nlgroup + 1;
netlink_broadcast(ebtulognl, ub->skb, 0, 1 << nlgroup, GFP_ATOMIC); netlink_broadcast(ebtulognl, ub->skb, 0, nlgroup + 1, GFP_ATOMIC);
ub->qlen = 0; ub->qlen = 0;
ub->skb = NULL; ub->skb = NULL;
......
...@@ -2343,8 +2343,8 @@ void neigh_app_ns(struct neighbour *n) ...@@ -2343,8 +2343,8 @@ void neigh_app_ns(struct neighbour *n)
} }
nlh = (struct nlmsghdr *)skb->data; nlh = (struct nlmsghdr *)skb->data;
nlh->nlmsg_flags = NLM_F_REQUEST; nlh->nlmsg_flags = NLM_F_REQUEST;
NETLINK_CB(skb).dst_groups = RTMGRP_NEIGH; NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
netlink_broadcast(rtnl, skb, 0, RTMGRP_NEIGH, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
} }
static void neigh_app_notify(struct neighbour *n) static void neigh_app_notify(struct neighbour *n)
...@@ -2361,8 +2361,8 @@ static void neigh_app_notify(struct neighbour *n) ...@@ -2361,8 +2361,8 @@ static void neigh_app_notify(struct neighbour *n)
return; return;
} }
nlh = (struct nlmsghdr *)skb->data; nlh = (struct nlmsghdr *)skb->data;
NETLINK_CB(skb).dst_groups = RTMGRP_NEIGH; NETLINK_CB(skb).dst_group = RTNLGRP_NEIGH;
netlink_broadcast(rtnl, skb, 0, RTMGRP_NEIGH, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_NEIGH, GFP_ATOMIC);
} }
#endif /* CONFIG_ARPD */ #endif /* CONFIG_ARPD */
......
...@@ -148,7 +148,7 @@ int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) ...@@ -148,7 +148,7 @@ int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
{ {
int err = 0; int err = 0;
NETLINK_CB(skb).dst_groups = group; NETLINK_CB(skb).dst_group = group;
if (echo) if (echo)
atomic_inc(&skb->users); atomic_inc(&skb->users);
netlink_broadcast(rtnl, skb, pid, group, GFP_KERNEL); netlink_broadcast(rtnl, skb, pid, group, GFP_KERNEL);
...@@ -458,8 +458,8 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) ...@@ -458,8 +458,8 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_LINK; NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
netlink_broadcast(rtnl, skb, 0, RTMGRP_LINK, GFP_KERNEL); netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_KERNEL);
} }
static int rtnetlink_done(struct netlink_callback *cb) static int rtnetlink_done(struct netlink_callback *cb)
......
...@@ -1144,8 +1144,8 @@ static inline void rtmsg_iwinfo(struct net_device * dev, ...@@ -1144,8 +1144,8 @@ static inline void rtmsg_iwinfo(struct net_device * dev,
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_LINK; NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
netlink_broadcast(rtnl, skb, 0, RTMGRP_LINK, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_ATOMIC);
} }
#endif /* WE_EVENT_NETLINK */ #endif /* WE_EVENT_NETLINK */
......
...@@ -752,16 +752,16 @@ static void rtmsg_ifa(int event, struct dn_ifaddr *ifa) ...@@ -752,16 +752,16 @@ static void rtmsg_ifa(int event, struct dn_ifaddr *ifa)
skb = alloc_skb(size, GFP_KERNEL); skb = alloc_skb(size, GFP_KERNEL);
if (!skb) { if (!skb) {
netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, ENOBUFS);
return; return;
} }
if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) { if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, EINVAL);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_DECnet_IFADDR; NETLINK_CB(skb).dst_group = RTNLGRP_DECnet_IFADDR;
netlink_broadcast(rtnl, skb, 0, RTMGRP_DECnet_IFADDR, GFP_KERNEL); netlink_broadcast(rtnl, skb, 0, RTNLGRP_DECnet_IFADDR, GFP_KERNEL);
} }
static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
......
...@@ -349,10 +349,10 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, int tb_id, ...@@ -349,10 +349,10 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, int tb_id,
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_DECnet_ROUTE; NETLINK_CB(skb).dst_group = RTNLGRP_DECnet_ROUTE;
if (nlh->nlmsg_flags & NLM_F_ECHO) if (nlh->nlmsg_flags & NLM_F_ECHO)
atomic_inc(&skb->users); atomic_inc(&skb->users);
netlink_broadcast(rtnl, skb, pid, RTMGRP_DECnet_ROUTE, GFP_KERNEL); netlink_broadcast(rtnl, skb, pid, RTNLGRP_DECnet_ROUTE, GFP_KERNEL);
if (nlh->nlmsg_flags & NLM_F_ECHO) if (nlh->nlmsg_flags & NLM_F_ECHO)
netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT); netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
} }
......
...@@ -71,10 +71,10 @@ static void dnrmg_send_peer(struct sk_buff *skb) ...@@ -71,10 +71,10 @@ static void dnrmg_send_peer(struct sk_buff *skb)
switch(flags & DN_RT_CNTL_MSK) { switch(flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_L1RT: case DN_RT_PKT_L1RT:
group = DNRMG_L1_GROUP; group = DNRMG_L1_NLGRP;
break; break;
case DN_RT_PKT_L2RT: case DN_RT_PKT_L2RT:
group = DNRMG_L2_GROUP; group = DNRMG_L2_NLGRP;
break; break;
default: default:
return; return;
...@@ -83,7 +83,7 @@ static void dnrmg_send_peer(struct sk_buff *skb) ...@@ -83,7 +83,7 @@ static void dnrmg_send_peer(struct sk_buff *skb)
skb2 = dnrmg_build_message(skb, &status); skb2 = dnrmg_build_message(skb, &status);
if (skb2 == NULL) if (skb2 == NULL)
return; return;
NETLINK_CB(skb2).dst_groups = group; NETLINK_CB(skb2).dst_group = group;
netlink_broadcast(dnrmg, skb2, 0, group, GFP_ATOMIC); netlink_broadcast(dnrmg, skb2, 0, group, GFP_ATOMIC);
} }
......
...@@ -1111,13 +1111,12 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa) ...@@ -1111,13 +1111,12 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa)
struct sk_buff *skb = alloc_skb(size, GFP_KERNEL); struct sk_buff *skb = alloc_skb(size, GFP_KERNEL);
if (!skb) if (!skb)
netlink_set_err(rtnl, 0, RTMGRP_IPV4_IFADDR, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS);
else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_IPV4_IFADDR, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL);
} else { } else {
NETLINK_CB(skb).dst_groups = RTMGRP_IPV4_IFADDR; netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV4_IFADDR, GFP_KERNEL);
netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV4_IFADDR, GFP_KERNEL);
} }
} }
......
...@@ -560,7 +560,7 @@ static void nl_fib_input(struct sock *sk, int len) ...@@ -560,7 +560,7 @@ static void nl_fib_input(struct sock *sk, int len)
pid = nlh->nlmsg_pid; /*pid of sending process */ pid = nlh->nlmsg_pid; /*pid of sending process */
NETLINK_CB(skb).pid = 0; /* from kernel */ NETLINK_CB(skb).pid = 0; /* from kernel */
NETLINK_CB(skb).dst_pid = pid; NETLINK_CB(skb).dst_pid = pid;
NETLINK_CB(skb).dst_groups = 0; /* unicast */ NETLINK_CB(skb).dst_group = 0; /* unicast */
netlink_unicast(sk, skb, pid, MSG_DONTWAIT); netlink_unicast(sk, skb, pid, MSG_DONTWAIT);
} }
......
...@@ -290,10 +290,10 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa, ...@@ -290,10 +290,10 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_IPV4_ROUTE; NETLINK_CB(skb).dst_group = RTNLGRP_IPV4_ROUTE;
if (n->nlmsg_flags&NLM_F_ECHO) if (n->nlmsg_flags&NLM_F_ECHO)
atomic_inc(&skb->users); atomic_inc(&skb->users);
netlink_broadcast(rtnl, skb, pid, RTMGRP_IPV4_ROUTE, GFP_KERNEL); netlink_broadcast(rtnl, skb, pid, RTNLGRP_IPV4_ROUTE, GFP_KERNEL);
if (n->nlmsg_flags&NLM_F_ECHO) if (n->nlmsg_flags&NLM_F_ECHO)
netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT); netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
} }
......
...@@ -297,7 +297,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -297,7 +297,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
struct sk_buff *skb; struct sk_buff *skb;
unsigned int type; unsigned int type;
unsigned char *b; unsigned char *b;
unsigned int flags = 0, groups; unsigned int flags = 0, group;
/* ignore our fake conntrack entry */ /* ignore our fake conntrack entry */
if (ct == &ip_conntrack_untracked) if (ct == &ip_conntrack_untracked)
...@@ -305,7 +305,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -305,7 +305,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
if (events & IPCT_DESTROY) { if (events & IPCT_DESTROY) {
type = IPCTNL_MSG_CT_DELETE; type = IPCTNL_MSG_CT_DELETE;
groups = NF_NETLINK_CONNTRACK_DESTROY; group = NFNLGRP_CONNTRACK_DESTROY;
goto alloc_skb; goto alloc_skb;
} }
if (events & (IPCT_NEW | IPCT_RELATED)) { if (events & (IPCT_NEW | IPCT_RELATED)) {
...@@ -313,7 +313,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -313,7 +313,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
flags = NLM_F_CREATE|NLM_F_EXCL; flags = NLM_F_CREATE|NLM_F_EXCL;
/* dump everything */ /* dump everything */
events = ~0UL; events = ~0UL;
groups = NF_NETLINK_CONNTRACK_NEW; group = NFNLGRP_CONNTRACK_NEW;
goto alloc_skb; goto alloc_skb;
} }
if (events & (IPCT_STATUS | if (events & (IPCT_STATUS |
...@@ -322,7 +322,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -322,7 +322,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
IPCT_HELPINFO | IPCT_HELPINFO |
IPCT_NATINFO)) { IPCT_NATINFO)) {
type = IPCTNL_MSG_CT_NEW; type = IPCTNL_MSG_CT_NEW;
groups = NF_NETLINK_CONNTRACK_UPDATE; group = NFNLGRP_CONNTRACK_UPDATE;
goto alloc_skb; goto alloc_skb;
} }
...@@ -375,7 +375,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -375,7 +375,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
goto nfattr_failure; goto nfattr_failure;
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
nfnetlink_send(skb, 0, groups, 0); nfnetlink_send(skb, 0, group, 0);
return NOTIFY_DONE; return NOTIFY_DONE;
nlmsg_failure: nlmsg_failure:
...@@ -1194,7 +1194,7 @@ static int ctnetlink_expect_event(struct notifier_block *this, ...@@ -1194,7 +1194,7 @@ static int ctnetlink_expect_event(struct notifier_block *this,
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
proto = exp->tuple.dst.protonum; proto = exp->tuple.dst.protonum;
nfnetlink_send(skb, 0, NF_NETLINK_CONNTRACK_EXP_NEW, 0); nfnetlink_send(skb, 0, NFNLGRP_CONNTRACK_EXP_NEW, 0);
return NOTIFY_DONE; return NOTIFY_DONE;
nlmsg_failure: nlmsg_failure:
......
...@@ -116,10 +116,10 @@ static void ulog_send(unsigned int nlgroupnum) ...@@ -116,10 +116,10 @@ static void ulog_send(unsigned int nlgroupnum)
if (ub->qlen > 1) if (ub->qlen > 1)
ub->lastnlh->nlmsg_type = NLMSG_DONE; ub->lastnlh->nlmsg_type = NLMSG_DONE;
NETLINK_CB(ub->skb).dst_groups = (1 << nlgroupnum); NETLINK_CB(ub->skb).dst_group = nlgroupnum + 1;
DEBUGP("ipt_ULOG: throwing %d packets to netlink mask %u\n", DEBUGP("ipt_ULOG: throwing %d packets to netlink group %u\n",
ub->qlen, nlgroupnum); ub->qlen, nlgroupnum + 1);
netlink_broadcast(nflognl, ub->skb, 0, (1 << nlgroupnum), GFP_ATOMIC); netlink_broadcast(nflognl, ub->skb, 0, nlgroupnum + 1, GFP_ATOMIC);
ub->qlen = 0; ub->qlen = 0;
ub->skb = NULL; ub->skb = NULL;
......
...@@ -2858,16 +2858,16 @@ static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) ...@@ -2858,16 +2858,16 @@ static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
skb = alloc_skb(size, GFP_ATOMIC); skb = alloc_skb(size, GFP_ATOMIC);
if (!skb) { if (!skb) {
netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFADDR, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFADDR, ENOBUFS);
return; return;
} }
if (inet6_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { if (inet6_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFADDR, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFADDR, EINVAL);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFADDR; NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFADDR;
netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFADDR, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFADDR, GFP_ATOMIC);
} }
static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,
...@@ -2994,16 +2994,16 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev) ...@@ -2994,16 +2994,16 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
skb = alloc_skb(size, GFP_ATOMIC); skb = alloc_skb(size, GFP_ATOMIC);
if (!skb) { if (!skb) {
netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, ENOBUFS);
return; return;
} }
if (inet6_fill_ifinfo(skb, idev, current->pid, 0, event, 0) < 0) { if (inet6_fill_ifinfo(skb, idev, current->pid, 0, event, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_IPV6_IFINFO, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, EINVAL);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_IFINFO; NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFINFO;
netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFINFO, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFINFO, GFP_ATOMIC);
} }
static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
...@@ -3054,16 +3054,16 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev, ...@@ -3054,16 +3054,16 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev,
skb = alloc_skb(size, GFP_ATOMIC); skb = alloc_skb(size, GFP_ATOMIC);
if (!skb) { if (!skb) {
netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_PREFIX, ENOBUFS);
return; return;
} }
if (inet6_fill_prefix(skb, idev, pinfo, current->pid, 0, event, 0) < 0) { if (inet6_fill_prefix(skb, idev, pinfo, current->pid, 0, event, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_IPV6_PREFIX, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_PREFIX, EINVAL);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_PREFIX; NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_PREFIX;
netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_PREFIX, GFP_ATOMIC); netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_PREFIX, GFP_ATOMIC);
} }
static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = { static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = {
......
...@@ -1850,16 +1850,16 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nlmsghdr *nlh, ...@@ -1850,16 +1850,16 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nlmsghdr *nlh,
skb = alloc_skb(size, gfp_any()); skb = alloc_skb(size, gfp_any());
if (!skb) { if (!skb) {
netlink_set_err(rtnl, 0, RTMGRP_IPV6_ROUTE, ENOBUFS); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_ROUTE, ENOBUFS);
return; return;
} }
if (rt6_fill_node(skb, rt, NULL, NULL, 0, event, pid, seq, 0, 0) < 0) { if (rt6_fill_node(skb, rt, NULL, NULL, 0, event, pid, seq, 0, 0) < 0) {
kfree_skb(skb); kfree_skb(skb);
netlink_set_err(rtnl, 0, RTMGRP_IPV6_ROUTE, EINVAL); netlink_set_err(rtnl, 0, RTNLGRP_IPV6_ROUTE, EINVAL);
return; return;
} }
NETLINK_CB(skb).dst_groups = RTMGRP_IPV6_ROUTE; NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_ROUTE;
netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_ROUTE, gfp_any()); netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_ROUTE, gfp_any());
} }
/* /*
......
...@@ -198,7 +198,7 @@ int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) ...@@ -198,7 +198,7 @@ int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
int allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; int allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
int err = 0; int err = 0;
NETLINK_CB(skb).dst_groups = group; NETLINK_CB(skb).dst_group = group;
if (echo) if (echo)
atomic_inc(&skb->users); atomic_inc(&skb->users);
netlink_broadcast(nfnl, skb, pid, group, allocation); netlink_broadcast(nfnl, skb, pid, group, allocation);
......
...@@ -593,7 +593,7 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) ...@@ -593,7 +593,7 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid)
nlh->nlmsg_flags |= NLM_F_ROOT; nlh->nlmsg_flags |= NLM_F_ROOT;
module_put(a->ops->owner); module_put(a->ops->owner);
kfree(a); kfree(a);
err = rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); err = rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
if (err > 0) if (err > 0)
return 0; return 0;
...@@ -656,7 +656,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) ...@@ -656,7 +656,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event)
/* now do the delete */ /* now do the delete */
tcf_action_destroy(head, 0); tcf_action_destroy(head, 0);
ret = rtnetlink_send(skb, pid, RTMGRP_TC, ret = rtnetlink_send(skb, pid, RTNLGRP_TC,
n->nlmsg_flags&NLM_F_ECHO); n->nlmsg_flags&NLM_F_ECHO);
if (ret > 0) if (ret > 0)
return 0; return 0;
...@@ -698,9 +698,9 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, ...@@ -698,9 +698,9 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
x->rta_len = skb->tail - (u8*)x; x->rta_len = skb->tail - (u8*)x;
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
NETLINK_CB(skb).dst_groups = RTMGRP_TC; NETLINK_CB(skb).dst_group = RTNLGRP_TC;
err = rtnetlink_send(skb, pid, RTMGRP_TC, flags&NLM_F_ECHO); err = rtnetlink_send(skb, pid, RTNLGRP_TC, flags&NLM_F_ECHO);
if (err > 0) if (err > 0)
err = 0; err = 0;
return err; return err;
......
...@@ -367,7 +367,7 @@ static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n, ...@@ -367,7 +367,7 @@ static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
return -EINVAL; return -EINVAL;
} }
return rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
} }
struct tcf_dump_args struct tcf_dump_args
......
...@@ -816,7 +816,7 @@ static int qdisc_notify(struct sk_buff *oskb, struct nlmsghdr *n, ...@@ -816,7 +816,7 @@ static int qdisc_notify(struct sk_buff *oskb, struct nlmsghdr *n,
} }
if (skb->len) if (skb->len)
return rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
err_out: err_out:
kfree_skb(skb); kfree_skb(skb);
...@@ -1040,7 +1040,7 @@ static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n, ...@@ -1040,7 +1040,7 @@ static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n,
return -EINVAL; return -EINVAL;
} }
return rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
} }
struct qdisc_dump_args struct qdisc_dump_args
......
...@@ -1125,9 +1125,8 @@ static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) ...@@ -1125,9 +1125,8 @@ static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
if (build_expire(skb, x, c->data.hard) < 0) if (build_expire(skb, x, c->data.hard) < 0)
BUG(); BUG();
NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE; NETLINK_CB(skb).dst_group = XFRMNLGRP_EXPIRE;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_EXPIRE, GFP_ATOMIC);
} }
static int xfrm_notify_sa_flush(struct km_event *c) static int xfrm_notify_sa_flush(struct km_event *c)
...@@ -1152,9 +1151,8 @@ static int xfrm_notify_sa_flush(struct km_event *c) ...@@ -1152,9 +1151,8 @@ static int xfrm_notify_sa_flush(struct km_event *c)
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
NETLINK_CB(skb).dst_groups = XFRMGRP_SA; NETLINK_CB(skb).dst_group = XFRMNLGRP_SA;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_SA, GFP_ATOMIC);
nlmsg_failure: nlmsg_failure:
kfree_skb(skb); kfree_skb(skb);
...@@ -1228,9 +1226,8 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c) ...@@ -1228,9 +1226,8 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c)
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
NETLINK_CB(skb).dst_groups = XFRMGRP_SA; NETLINK_CB(skb).dst_group = XFRMNLGRP_SA;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_SA, GFP_ATOMIC);
nlmsg_failure: nlmsg_failure:
rtattr_failure: rtattr_failure:
...@@ -1308,9 +1305,8 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, ...@@ -1308,9 +1305,8 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
if (build_acquire(skb, x, xt, xp, dir) < 0) if (build_acquire(skb, x, xt, xp, dir) < 0)
BUG(); BUG();
NETLINK_CB(skb).dst_groups = XFRMGRP_ACQUIRE; NETLINK_CB(skb).dst_group = XFRMNLGRP_ACQUIRE;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_ACQUIRE, GFP_ATOMIC);
} }
/* User gives us xfrm_user_policy_info followed by an array of 0 /* User gives us xfrm_user_policy_info followed by an array of 0
...@@ -1409,9 +1405,8 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve ...@@ -1409,9 +1405,8 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
if (build_polexpire(skb, xp, dir, c->data.hard) < 0) if (build_polexpire(skb, xp, dir, c->data.hard) < 0)
BUG(); BUG();
NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE; NETLINK_CB(skb).dst_group = XFRMNLGRP_EXPIRE;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_EXPIRE, GFP_ATOMIC);
} }
static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c) static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c)
...@@ -1459,9 +1454,8 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * ...@@ -1459,9 +1454,8 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
NETLINK_CB(skb).dst_groups = XFRMGRP_POLICY; NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_POLICY, GFP_ATOMIC);
nlmsg_failure: nlmsg_failure:
rtattr_failure: rtattr_failure:
...@@ -1486,9 +1480,8 @@ static int xfrm_notify_policy_flush(struct km_event *c) ...@@ -1486,9 +1480,8 @@ static int xfrm_notify_policy_flush(struct km_event *c)
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
NETLINK_CB(skb).dst_groups = XFRMGRP_POLICY; NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY;
return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_POLICY, GFP_ATOMIC);
nlmsg_failure: nlmsg_failure:
kfree_skb(skb); kfree_skb(skb);
......
...@@ -80,8 +80,8 @@ static void selnl_notify(int msgtype, void *data) ...@@ -80,8 +80,8 @@ static void selnl_notify(int msgtype, void *data)
nlh = NLMSG_PUT(skb, 0, 0, msgtype, len); nlh = NLMSG_PUT(skb, 0, 0, msgtype, len);
selnl_add_payload(nlh, len, msgtype, data); selnl_add_payload(nlh, len, msgtype, data);
nlh->nlmsg_len = skb->tail - tmp; nlh->nlmsg_len = skb->tail - tmp;
NETLINK_CB(skb).dst_groups = SELNL_GRP_AVC; NETLINK_CB(skb).dst_group = SELNLGRP_AVC;
netlink_broadcast(selnl, skb, 0, SELNL_GRP_AVC, GFP_USER); netlink_broadcast(selnl, skb, 0, SELNLGRP_AVC, GFP_USER);
out: out:
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment