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
@@ -1319,7 +1319,7 @@ nla_put_failure:
|
||||
}
|
||||
|
||||
static int dcbnl_notify(struct net_device *dev, int event, int cmd,
|
||||
u32 seq, u32 pid, int dcbx_ver)
|
||||
u32 seq, u32 portid, int dcbx_ver)
|
||||
{
|
||||
struct net *net = dev_net(dev);
|
||||
struct sk_buff *skb;
|
||||
@@ -1330,7 +1330,7 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd,
|
||||
if (!ops)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
skb = dcbnl_newmsg(event, cmd, pid, seq, 0, &nlh);
|
||||
skb = dcbnl_newmsg(event, cmd, portid, seq, 0, &nlh);
|
||||
if (!skb)
|
||||
return -ENOBUFS;
|
||||
|
||||
@@ -1353,16 +1353,16 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd,
|
||||
}
|
||||
|
||||
int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
|
||||
u32 seq, u32 pid)
|
||||
u32 seq, u32 portid)
|
||||
{
|
||||
return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_IEEE);
|
||||
return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_IEEE);
|
||||
}
|
||||
EXPORT_SYMBOL(dcbnl_ieee_notify);
|
||||
|
||||
int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
|
||||
u32 seq, u32 pid)
|
||||
u32 seq, u32 portid)
|
||||
{
|
||||
return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_CEE);
|
||||
return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_CEE);
|
||||
}
|
||||
EXPORT_SYMBOL(dcbnl_cee_notify);
|
||||
|
||||
@@ -1656,7 +1656,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
|
||||
struct net_device *netdev;
|
||||
struct dcbmsg *dcb = nlmsg_data(nlh);
|
||||
struct nlattr *tb[DCB_ATTR_MAX + 1];
|
||||
u32 pid = skb ? NETLINK_CB(skb).pid : 0;
|
||||
u32 portid = skb ? NETLINK_CB(skb).portid : 0;
|
||||
int ret = -EINVAL;
|
||||
struct sk_buff *reply_skb;
|
||||
struct nlmsghdr *reply_nlh = NULL;
|
||||
@@ -1690,7 +1690,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
|
||||
goto out;
|
||||
}
|
||||
|
||||
reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, pid, nlh->nlmsg_seq,
|
||||
reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, portid, nlh->nlmsg_seq,
|
||||
nlh->nlmsg_flags, &reply_nlh);
|
||||
if (!reply_skb) {
|
||||
ret = -ENOBUFS;
|
||||
@@ -1705,7 +1705,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
|
||||
|
||||
nlmsg_end(reply_skb, reply_nlh);
|
||||
|
||||
ret = rtnl_unicast(reply_skb, &init_net, pid);
|
||||
ret = rtnl_unicast(reply_skb, &init_net, portid);
|
||||
out:
|
||||
dev_put(netdev);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user