aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-09-07 16:12:54 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-10 15:30:41 -0400
commit15e473046cb6e5d18a4d0057e61d76315230382b (patch)
tree893d2df5d46a6ce156933ac57a1398f0ad22b889 /net/unix
parent9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (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/unix')
-rw-r--r--net/unix/diag.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/unix/diag.c b/net/unix/diag.c
index 750b13408449..06748f108a57 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -110,12 +110,12 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb)
110} 110}
111 111
112static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, 112static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
113 u32 pid, u32 seq, u32 flags, int sk_ino) 113 u32 portid, u32 seq, u32 flags, int sk_ino)
114{ 114{
115 struct nlmsghdr *nlh; 115 struct nlmsghdr *nlh;
116 struct unix_diag_msg *rep; 116 struct unix_diag_msg *rep;
117 117
118 nlh = nlmsg_put(skb, pid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep), 118 nlh = nlmsg_put(skb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep),
119 flags); 119 flags);
120 if (!nlh) 120 if (!nlh)
121 return -EMSGSIZE; 121 return -EMSGSIZE;
@@ -159,7 +159,7 @@ out_nlmsg_trim:
159} 159}
160 160
161static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, 161static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
162 u32 pid, u32 seq, u32 flags) 162 u32 portid, u32 seq, u32 flags)
163{ 163{
164 int sk_ino; 164 int sk_ino;
165 165
@@ -170,7 +170,7 @@ static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_r
170 if (!sk_ino) 170 if (!sk_ino)
171 return 0; 171 return 0;
172 172
173 return sk_diag_fill(sk, skb, req, pid, seq, flags, sk_ino); 173 return sk_diag_fill(sk, skb, req, portid, seq, flags, sk_ino);
174} 174}
175 175
176static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) 176static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
@@ -200,7 +200,7 @@ static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
200 if (!(req->udiag_states & (1 << sk->sk_state))) 200 if (!(req->udiag_states & (1 << sk->sk_state)))
201 goto next; 201 goto next;
202 if (sk_diag_dump(sk, skb, req, 202 if (sk_diag_dump(sk, skb, req,
203 NETLINK_CB(cb->skb).pid, 203 NETLINK_CB(cb->skb).portid,
204 cb->nlh->nlmsg_seq, 204 cb->nlh->nlmsg_seq,
205 NLM_F_MULTI) < 0) 205 NLM_F_MULTI) < 0)
206 goto done; 206 goto done;
@@ -267,7 +267,7 @@ again:
267 if (!rep) 267 if (!rep)
268 goto out; 268 goto out;
269 269
270 err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).pid, 270 err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).portid,
271 nlh->nlmsg_seq, 0, req->udiag_ino); 271 nlh->nlmsg_seq, 0, req->udiag_ino);
272 if (err < 0) { 272 if (err < 0) {
273 nlmsg_free(rep); 273 nlmsg_free(rep);
@@ -277,7 +277,7 @@ again:
277 277
278 goto again; 278 goto again;
279 } 279 }
280 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid, 280 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid,
281 MSG_DONTWAIT); 281 MSG_DONTWAIT);
282 if (err > 0) 282 if (err > 0)
283 err = 0; 283 err = 0;