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/decnet | |
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/decnet')
-rw-r--r-- | net/decnet/dn_dev.c | 6 | ||||
-rw-r--r-- | net/decnet/dn_route.c | 10 | ||||
-rw-r--r-- | net/decnet/dn_table.c | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index f3924ab1e019..7b7e561412d3 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -667,12 +667,12 @@ static inline size_t dn_ifaddr_nlmsg_size(void) | |||
667 | } | 667 | } |
668 | 668 | ||
669 | static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, | 669 | static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, |
670 | u32 pid, u32 seq, int event, unsigned int flags) | 670 | u32 portid, u32 seq, int event, unsigned int flags) |
671 | { | 671 | { |
672 | struct ifaddrmsg *ifm; | 672 | struct ifaddrmsg *ifm; |
673 | struct nlmsghdr *nlh; | 673 | struct nlmsghdr *nlh; |
674 | 674 | ||
675 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*ifm), flags); | 675 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), flags); |
676 | if (nlh == NULL) | 676 | if (nlh == NULL) |
677 | return -EMSGSIZE; | 677 | return -EMSGSIZE; |
678 | 678 | ||
@@ -753,7 +753,7 @@ static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | |||
753 | if (dn_idx < skip_naddr) | 753 | if (dn_idx < skip_naddr) |
754 | continue; | 754 | continue; |
755 | 755 | ||
756 | if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, | 756 | if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).portid, |
757 | cb->nlh->nlmsg_seq, RTM_NEWADDR, | 757 | cb->nlh->nlmsg_seq, RTM_NEWADDR, |
758 | NLM_F_MULTI) < 0) | 758 | NLM_F_MULTI) < 0) |
759 | goto done; | 759 | goto done; |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index c855e8d0738f..b57419cc41a4 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1543,7 +1543,7 @@ static int dn_route_input(struct sk_buff *skb) | |||
1543 | return dn_route_input_slow(skb); | 1543 | return dn_route_input_slow(skb); |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, | 1546 | static int dn_rt_fill_info(struct sk_buff *skb, u32 portid, u32 seq, |
1547 | int event, int nowait, unsigned int flags) | 1547 | int event, int nowait, unsigned int flags) |
1548 | { | 1548 | { |
1549 | struct dn_route *rt = (struct dn_route *)skb_dst(skb); | 1549 | struct dn_route *rt = (struct dn_route *)skb_dst(skb); |
@@ -1551,7 +1551,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, | |||
1551 | struct nlmsghdr *nlh; | 1551 | struct nlmsghdr *nlh; |
1552 | long expires; | 1552 | long expires; |
1553 | 1553 | ||
1554 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags); | 1554 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags); |
1555 | if (!nlh) | 1555 | if (!nlh) |
1556 | return -EMSGSIZE; | 1556 | return -EMSGSIZE; |
1557 | 1557 | ||
@@ -1685,7 +1685,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void | |||
1685 | if (rtm->rtm_flags & RTM_F_NOTIFY) | 1685 | if (rtm->rtm_flags & RTM_F_NOTIFY) |
1686 | rt->rt_flags |= RTCF_NOTIFY; | 1686 | rt->rt_flags |= RTCF_NOTIFY; |
1687 | 1687 | ||
1688 | err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0); | 1688 | err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).portid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0); |
1689 | 1689 | ||
1690 | if (err == 0) | 1690 | if (err == 0) |
1691 | goto out_free; | 1691 | goto out_free; |
@@ -1694,7 +1694,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void | |||
1694 | goto out_free; | 1694 | goto out_free; |
1695 | } | 1695 | } |
1696 | 1696 | ||
1697 | return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid); | 1697 | return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).portid); |
1698 | 1698 | ||
1699 | out_free: | 1699 | out_free: |
1700 | kfree_skb(skb); | 1700 | kfree_skb(skb); |
@@ -1737,7 +1737,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1737 | if (idx < s_idx) | 1737 | if (idx < s_idx) |
1738 | continue; | 1738 | continue; |
1739 | skb_dst_set(skb, dst_clone(&rt->dst)); | 1739 | skb_dst_set(skb, dst_clone(&rt->dst)); |
1740 | if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).pid, | 1740 | if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).portid, |
1741 | cb->nlh->nlmsg_seq, RTM_NEWROUTE, | 1741 | cb->nlh->nlmsg_seq, RTM_NEWROUTE, |
1742 | 1, NLM_F_MULTI) <= 0) { | 1742 | 1, NLM_F_MULTI) <= 0) { |
1743 | skb_dst_drop(skb); | 1743 | skb_dst_drop(skb); |
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 16c986ab1228..f968c1b58f47 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -291,14 +291,14 @@ static inline size_t dn_fib_nlmsg_size(struct dn_fib_info *fi) | |||
291 | return payload; | 291 | return payload; |
292 | } | 292 | } |
293 | 293 | ||
294 | static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 294 | static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, |
295 | u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, | 295 | u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, |
296 | struct dn_fib_info *fi, unsigned int flags) | 296 | struct dn_fib_info *fi, unsigned int flags) |
297 | { | 297 | { |
298 | struct rtmsg *rtm; | 298 | struct rtmsg *rtm; |
299 | struct nlmsghdr *nlh; | 299 | struct nlmsghdr *nlh; |
300 | 300 | ||
301 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags); | 301 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*rtm), flags); |
302 | if (!nlh) | 302 | if (!nlh) |
303 | return -EMSGSIZE; | 303 | return -EMSGSIZE; |
304 | 304 | ||
@@ -374,14 +374,14 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, | |||
374 | struct nlmsghdr *nlh, struct netlink_skb_parms *req) | 374 | struct nlmsghdr *nlh, struct netlink_skb_parms *req) |
375 | { | 375 | { |
376 | struct sk_buff *skb; | 376 | struct sk_buff *skb; |
377 | u32 pid = req ? req->pid : 0; | 377 | u32 portid = req ? req->portid : 0; |
378 | int err = -ENOBUFS; | 378 | int err = -ENOBUFS; |
379 | 379 | ||
380 | skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL); | 380 | skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL); |
381 | if (skb == NULL) | 381 | if (skb == NULL) |
382 | goto errout; | 382 | goto errout; |
383 | 383 | ||
384 | err = dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id, | 384 | err = dn_fib_dump_info(skb, portid, nlh->nlmsg_seq, event, tb_id, |
385 | f->fn_type, f->fn_scope, &f->fn_key, z, | 385 | f->fn_type, f->fn_scope, &f->fn_key, z, |
386 | DN_FIB_INFO(f), 0); | 386 | DN_FIB_INFO(f), 0); |
387 | if (err < 0) { | 387 | if (err < 0) { |
@@ -390,7 +390,7 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, | |||
390 | kfree_skb(skb); | 390 | kfree_skb(skb); |
391 | goto errout; | 391 | goto errout; |
392 | } | 392 | } |
393 | rtnl_notify(skb, &init_net, pid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL); | 393 | rtnl_notify(skb, &init_net, portid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL); |
394 | return; | 394 | return; |
395 | errout: | 395 | errout: |
396 | if (err < 0) | 396 | if (err < 0) |
@@ -411,7 +411,7 @@ static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, | |||
411 | continue; | 411 | continue; |
412 | if (f->fn_state & DN_S_ZOMBIE) | 412 | if (f->fn_state & DN_S_ZOMBIE) |
413 | continue; | 413 | continue; |
414 | if (dn_fib_dump_info(skb, NETLINK_CB(cb->skb).pid, | 414 | if (dn_fib_dump_info(skb, NETLINK_CB(cb->skb).portid, |
415 | cb->nlh->nlmsg_seq, | 415 | cb->nlh->nlmsg_seq, |
416 | RTM_NEWROUTE, | 416 | RTM_NEWROUTE, |
417 | tb->n, | 417 | tb->n, |