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/dcb | |
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/dcb')
-rw-r--r-- | net/dcb/dcbnl.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 81f2bb62dea3..70989e672304 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
@@ -1319,7 +1319,7 @@ nla_put_failure: | |||
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | static int dcbnl_notify(struct net_device *dev, int event, int cmd, | 1321 | static int dcbnl_notify(struct net_device *dev, int event, int cmd, |
1322 | u32 seq, u32 pid, int dcbx_ver) | 1322 | u32 seq, u32 portid, int dcbx_ver) |
1323 | { | 1323 | { |
1324 | struct net *net = dev_net(dev); | 1324 | struct net *net = dev_net(dev); |
1325 | struct sk_buff *skb; | 1325 | struct sk_buff *skb; |
@@ -1330,7 +1330,7 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd, | |||
1330 | if (!ops) | 1330 | if (!ops) |
1331 | return -EOPNOTSUPP; | 1331 | return -EOPNOTSUPP; |
1332 | 1332 | ||
1333 | skb = dcbnl_newmsg(event, cmd, pid, seq, 0, &nlh); | 1333 | skb = dcbnl_newmsg(event, cmd, portid, seq, 0, &nlh); |
1334 | if (!skb) | 1334 | if (!skb) |
1335 | return -ENOBUFS; | 1335 | return -ENOBUFS; |
1336 | 1336 | ||
@@ -1353,16 +1353,16 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd, | |||
1353 | } | 1353 | } |
1354 | 1354 | ||
1355 | int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd, | 1355 | int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd, |
1356 | u32 seq, u32 pid) | 1356 | u32 seq, u32 portid) |
1357 | { | 1357 | { |
1358 | return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_IEEE); | 1358 | return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_IEEE); |
1359 | } | 1359 | } |
1360 | EXPORT_SYMBOL(dcbnl_ieee_notify); | 1360 | EXPORT_SYMBOL(dcbnl_ieee_notify); |
1361 | 1361 | ||
1362 | int dcbnl_cee_notify(struct net_device *dev, int event, int cmd, | 1362 | int dcbnl_cee_notify(struct net_device *dev, int event, int cmd, |
1363 | u32 seq, u32 pid) | 1363 | u32 seq, u32 portid) |
1364 | { | 1364 | { |
1365 | return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_CEE); | 1365 | return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_CEE); |
1366 | } | 1366 | } |
1367 | EXPORT_SYMBOL(dcbnl_cee_notify); | 1367 | EXPORT_SYMBOL(dcbnl_cee_notify); |
1368 | 1368 | ||
@@ -1656,7 +1656,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
1656 | struct net_device *netdev; | 1656 | struct net_device *netdev; |
1657 | struct dcbmsg *dcb = nlmsg_data(nlh); | 1657 | struct dcbmsg *dcb = nlmsg_data(nlh); |
1658 | struct nlattr *tb[DCB_ATTR_MAX + 1]; | 1658 | struct nlattr *tb[DCB_ATTR_MAX + 1]; |
1659 | u32 pid = skb ? NETLINK_CB(skb).pid : 0; | 1659 | u32 portid = skb ? NETLINK_CB(skb).portid : 0; |
1660 | int ret = -EINVAL; | 1660 | int ret = -EINVAL; |
1661 | struct sk_buff *reply_skb; | 1661 | struct sk_buff *reply_skb; |
1662 | struct nlmsghdr *reply_nlh = NULL; | 1662 | struct nlmsghdr *reply_nlh = NULL; |
@@ -1690,7 +1690,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
1690 | goto out; | 1690 | goto out; |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, pid, nlh->nlmsg_seq, | 1693 | reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, portid, nlh->nlmsg_seq, |
1694 | nlh->nlmsg_flags, &reply_nlh); | 1694 | nlh->nlmsg_flags, &reply_nlh); |
1695 | if (!reply_skb) { | 1695 | if (!reply_skb) { |
1696 | ret = -ENOBUFS; | 1696 | ret = -ENOBUFS; |
@@ -1705,7 +1705,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
1705 | 1705 | ||
1706 | nlmsg_end(reply_skb, reply_nlh); | 1706 | nlmsg_end(reply_skb, reply_nlh); |
1707 | 1707 | ||
1708 | ret = rtnl_unicast(reply_skb, &init_net, pid); | 1708 | ret = rtnl_unicast(reply_skb, &init_net, portid); |
1709 | out: | 1709 | out: |
1710 | dev_put(netdev); | 1710 | dev_put(netdev); |
1711 | return ret; | 1711 | return ret; |