netlink: Rename pid to portid to avoid confusion
It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9f00d9776b
commit
15e473046c
@@ -165,7 +165,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
|
||||
|
||||
struct netlink_skb_parms {
|
||||
struct scm_creds creds; /* Skb credentials */
|
||||
__u32 pid;
|
||||
__u32 portid;
|
||||
__u32 dst_group;
|
||||
struct sock *ssk;
|
||||
};
|
||||
@@ -205,14 +205,14 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group)
|
||||
extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
|
||||
extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
|
||||
extern int netlink_has_listeners(struct sock *sk, unsigned int group);
|
||||
extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
|
||||
extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
|
||||
extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
|
||||
extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
|
||||
__u32 group, gfp_t allocation);
|
||||
extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
|
||||
__u32 pid, __u32 group, gfp_t allocation,
|
||||
__u32 portid, __u32 group, gfp_t allocation,
|
||||
int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
|
||||
void *filter_data);
|
||||
extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code);
|
||||
extern int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code);
|
||||
extern int netlink_register_notifier(struct notifier_block *nb);
|
||||
extern int netlink_unregister_notifier(struct notifier_block *nb);
|
||||
|
||||
@@ -253,12 +253,12 @@ struct netlink_callback {
|
||||
|
||||
struct netlink_notify {
|
||||
struct net *net;
|
||||
int pid;
|
||||
int portid;
|
||||
int protocol;
|
||||
};
|
||||
|
||||
struct nlmsghdr *
|
||||
__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags);
|
||||
__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags);
|
||||
|
||||
struct netlink_dump_control {
|
||||
int (*dump)(struct sk_buff *skb, struct netlink_callback *);
|
||||
|
Reference in New Issue
Block a user