mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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" <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
9f00d9776b
commit
15e473046c
75 changed files with 728 additions and 728 deletions
|
|
@ -110,12 +110,12 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb)
|
|||
}
|
||||
|
||||
static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
|
||||
u32 pid, u32 seq, u32 flags, int sk_ino)
|
||||
u32 portid, u32 seq, u32 flags, int sk_ino)
|
||||
{
|
||||
struct nlmsghdr *nlh;
|
||||
struct unix_diag_msg *rep;
|
||||
|
||||
nlh = nlmsg_put(skb, pid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep),
|
||||
nlh = nlmsg_put(skb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep),
|
||||
flags);
|
||||
if (!nlh)
|
||||
return -EMSGSIZE;
|
||||
|
|
@ -159,7 +159,7 @@ out_nlmsg_trim:
|
|||
}
|
||||
|
||||
static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
|
||||
u32 pid, u32 seq, u32 flags)
|
||||
u32 portid, u32 seq, u32 flags)
|
||||
{
|
||||
int sk_ino;
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_r
|
|||
if (!sk_ino)
|
||||
return 0;
|
||||
|
||||
return sk_diag_fill(sk, skb, req, pid, seq, flags, sk_ino);
|
||||
return sk_diag_fill(sk, skb, req, portid, seq, flags, sk_ino);
|
||||
}
|
||||
|
||||
static 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)
|
|||
if (!(req->udiag_states & (1 << sk->sk_state)))
|
||||
goto next;
|
||||
if (sk_diag_dump(sk, skb, req,
|
||||
NETLINK_CB(cb->skb).pid,
|
||||
NETLINK_CB(cb->skb).portid,
|
||||
cb->nlh->nlmsg_seq,
|
||||
NLM_F_MULTI) < 0)
|
||||
goto done;
|
||||
|
|
@ -267,7 +267,7 @@ again:
|
|||
if (!rep)
|
||||
goto out;
|
||||
|
||||
err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).pid,
|
||||
err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).portid,
|
||||
nlh->nlmsg_seq, 0, req->udiag_ino);
|
||||
if (err < 0) {
|
||||
nlmsg_free(rep);
|
||||
|
|
@ -277,7 +277,7 @@ again:
|
|||
|
||||
goto again;
|
||||
}
|
||||
err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid,
|
||||
err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid,
|
||||
MSG_DONTWAIT);
|
||||
if (err > 0)
|
||||
err = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue