the following up of
15e473046cb6e5d18a4d0057e61d76315230382b
This patch replaces pid with portid under datapath/linux/compat
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
* nlmsg_notify - send a notification netlink message
* @sk: netlink socket to use
* @skb: notification message
* nlmsg_notify - send a notification netlink message
* @sk: netlink socket to use
* @skb: notification message
- * @pid: destination netlink pid for reports or 0
+ * @portid: destination netlink portid for reports or 0
* @group: destination multicast group or 0
* @report: 1 to report back, 0 to disable
* @flags: allocation flags
*/
* @group: destination multicast group or 0
* @report: 1 to report back, 0 to disable
* @flags: allocation flags
*/
-int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 pid,
+int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid,
unsigned int group, int report, gfp_t flags)
{
int err = 0;
if (group) {
unsigned int group, int report, gfp_t flags)
{
int err = 0;
if (group) {
+ int exclude_portid = 0;
if (report) {
atomic_inc(&skb->users);
if (report) {
atomic_inc(&skb->users);
+ exclude_portid = portid;
}
/* errors reported via destination sk->sk_err, but propagate
* delivery errors if NETLINK_BROADCAST_ERROR flag is set */
}
/* errors reported via destination sk->sk_err, but propagate
* delivery errors if NETLINK_BROADCAST_ERROR flag is set */
- err = nlmsg_multicast(sk, skb, exclude_pid, group, flags);
+ err = nlmsg_multicast(sk, skb, exclude_portid, group, flags);
}
if (report) {
int err2;
}
if (report) {
int err2;
- err2 = nlmsg_unicast(sk, skb, pid);
+ err2 = nlmsg_unicast(sk, skb, portid);
if (!err || err == -ESRCH)
err = err2;
}
if (!err || err == -ESRCH)
err = err2;
}
/* This is analogous to rtnl_notify() but uses genl_sock instead of rtnl.
*
* This is not (yet) in any upstream kernel. */
/* This is analogous to rtnl_notify() but uses genl_sock instead of rtnl.
*
* This is not (yet) in any upstream kernel. */
-void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
+void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, u32 group,
struct nlmsghdr *nlh, gfp_t flags)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
struct nlmsghdr *nlh, gfp_t flags)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
if (nlh)
report = nlmsg_report(nlh);
if (nlh)
report = nlmsg_report(nlh);
- nlmsg_notify(sk, skb, pid, group, report, flags);
+ nlmsg_notify(sk, skb, portid, group, report, flags);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
/* This function wasn't exported before 2.6.30. Lose! */
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
/* This function wasn't exported before 2.6.30. Lose! */
-void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code)
+void netlink_set_err(struct sock *ssk, u32 portid, u32 group, int code)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-static inline void rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
+static inline void rtnl_notify(struct sk_buff *skb, u32 portid, u32 group,
struct nlmsghdr *nlh, gfp_t flags)
{
BUG_ON(nlh != NULL); /* not implemented */
struct nlmsghdr *nlh, gfp_t flags)
{
BUG_ON(nlh != NULL); /* not implemented */
#endif
/* No 'net' parameter in these versions. */
#endif
/* No 'net' parameter in these versions. */
-#define rtnl_notify(skb, net, pid, group, nlh, flags) \
- ((void) rtnl_notify(skb, pid, group, nlh, flags))
+#define rtnl_notify(skb, net, portid, group, nlh, flags) \
+ ((void) rtnl_notify(skb, portid, group, nlh, flags))
#define rtnl_set_sk_err(net, group, error) \
(rtnl_set_sk_err(group, error))
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
/* Make the return type effectively 'void' to match Linux 2.6.30+. */
#define rtnl_set_sk_err(net, group, error) \
(rtnl_set_sk_err(group, error))
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
/* Make the return type effectively 'void' to match Linux 2.6.30+. */
-#define rtnl_notify(skb, net, pid, group, nlh, flags) \
- ((void) rtnl_notify(skb, net, pid, group, nlh, flags))
+#define rtnl_notify(skb, net, portid, group, nlh, flags) \
+ ((void) rtnl_notify(skb, net, portid, group, nlh, flags))
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
#define nlmsg_multicast busted_nlmsg_multicast
#define genlmsg_multicast busted_genlmsg_multicast
extern int busted_nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
#define nlmsg_multicast busted_nlmsg_multicast
#define genlmsg_multicast busted_genlmsg_multicast
extern int busted_nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
- u32 pid, unsigned int group);
+ u32 portid, unsigned int group);
#endif /* linux kernel < v2.6.19 */
#include_next <net/genetlink.h>
#endif /* linux kernel < v2.6.19 */
#include_next <net/genetlink.h>
#define genlmsg_multicast(s, p, g, f) \
genlmsg_multicast_flags((s), (p), (g), (f))
#define genlmsg_multicast(s, p, g, f) \
genlmsg_multicast_flags((s), (p), (g), (f))
-static inline int genlmsg_multicast_flags(struct sk_buff *skb, u32 pid,
+static inline int genlmsg_multicast_flags(struct sk_buff *skb, u32 portid,
unsigned int group, gfp_t flags)
{
int err;
NETLINK_CB(skb).dst_group = group;
unsigned int group, gfp_t flags)
{
int err;
NETLINK_CB(skb).dst_group = group;
- err = netlink_broadcast(genl_sock, skb, pid, group, flags);
+ err = netlink_broadcast(genl_sock, skb, portid, group, flags);
#endif /* linux kernel < 2.6.19 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#endif /* linux kernel < 2.6.19 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-#define genlmsg_multicast_netns(net, skb, pid, grp, flags) \
- genlmsg_multicast(skb, pid, grp, flags)
+#define genlmsg_multicast_netns(net, skb, portid, grp, flags) \
+ genlmsg_multicast(skb, portid, grp, flags)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
-#define genl_notify(skb, net, pid, group, nlh, flags) \
- genl_notify(skb, pid, group, nlh, flags)
+#define genl_notify(skb, net, portid, group, nlh, flags) \
+ genl_notify(skb, portid, group, nlh, flags)
-extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
+extern void genl_notify(struct sk_buff *skb, struct net *net, u32 portid,
u32 group, struct nlmsghdr *nlh, gfp_t flags);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) && \
u32 group, struct nlmsghdr *nlh, gfp_t flags);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) && \
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-#define genlmsg_unicast(ignore_net, skb, pid) genlmsg_unicast(skb, pid)
+#define genlmsg_unicast(ignore_net, skb, portid) genlmsg_unicast(skb, portid)
#endif
#endif /* genetlink.h */
#endif
#endif /* genetlink.h */
}
extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
}
extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
- u32 pid, unsigned int group, int report,
+ u32 portid, unsigned int group, int report,
gfp_t flags);
#endif /* linux kernel < 2.6.19 */
gfp_t flags);
#endif /* linux kernel < 2.6.19 */
* argument. */
#define nlmsg_multicast rpl_nlmsg_multicast
static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
* argument. */
#define nlmsg_multicast rpl_nlmsg_multicast
static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
- u32 pid, unsigned int group, gfp_t flags)
+ u32 portid, unsigned int group, gfp_t flags)
{
int err;
NETLINK_CB(skb).dst_group = group;
{
int err;
NETLINK_CB(skb).dst_group = group;
- err = netlink_broadcast(sk, skb, pid, group, flags);
+ err = netlink_broadcast(sk, skb, portid, group, flags);