diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-07 16:12:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-10 15:30:41 -0400 |
commit | 15e473046cb6e5d18a4d0057e61d76315230382b (patch) | |
tree | 893d2df5d46a6ce156933ac57a1398f0ad22b889 /net/packet/diag.c | |
parent | 9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (diff) |
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>
Diffstat (limited to 'net/packet/diag.c')
-rw-r--r-- | net/packet/diag.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/packet/diag.c b/net/packet/diag.c index 39bce0d50df9..8db6e21c46bd 100644 --- a/net/packet/diag.c +++ b/net/packet/diag.c | |||
@@ -126,13 +126,13 @@ static int pdiag_put_fanout(struct packet_sock *po, struct sk_buff *nlskb) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct packet_diag_req *req, | 128 | static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct packet_diag_req *req, |
129 | u32 pid, u32 seq, u32 flags, int sk_ino) | 129 | u32 portid, u32 seq, u32 flags, int sk_ino) |
130 | { | 130 | { |
131 | struct nlmsghdr *nlh; | 131 | struct nlmsghdr *nlh; |
132 | struct packet_diag_msg *rp; | 132 | struct packet_diag_msg *rp; |
133 | struct packet_sock *po = pkt_sk(sk); | 133 | struct packet_sock *po = pkt_sk(sk); |
134 | 134 | ||
135 | nlh = nlmsg_put(skb, pid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rp), flags); | 135 | nlh = nlmsg_put(skb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rp), flags); |
136 | if (!nlh) | 136 | if (!nlh) |
137 | return -EMSGSIZE; | 137 | return -EMSGSIZE; |
138 | 138 | ||
@@ -184,7 +184,7 @@ static int packet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
184 | if (num < s_num) | 184 | if (num < s_num) |
185 | goto next; | 185 | goto next; |
186 | 186 | ||
187 | if (sk_diag_fill(sk, skb, req, NETLINK_CB(cb->skb).pid, | 187 | if (sk_diag_fill(sk, skb, req, NETLINK_CB(cb->skb).portid, |
188 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 188 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
189 | sock_i_ino(sk)) < 0) | 189 | sock_i_ino(sk)) < 0) |
190 | goto done; | 190 | goto done; |