aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
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/ipv6/addrconf.c
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/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 572cb660837b..1237d5d037d8 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3534,12 +3534,12 @@ static inline int inet6_ifaddr_msgsize(void)
3534} 3534}
3535 3535
3536static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa, 3536static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
3537 u32 pid, u32 seq, int event, unsigned int flags) 3537 u32 portid, u32 seq, int event, unsigned int flags)
3538{ 3538{
3539 struct nlmsghdr *nlh; 3539 struct nlmsghdr *nlh;
3540 u32 preferred, valid; 3540 u32 preferred, valid;
3541 3541
3542 nlh = nlmsg_put(skb, pid, seq, event, sizeof(struct ifaddrmsg), flags); 3542 nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct ifaddrmsg), flags);
3543 if (nlh == NULL) 3543 if (nlh == NULL)
3544 return -EMSGSIZE; 3544 return -EMSGSIZE;
3545 3545
@@ -3577,7 +3577,7 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
3577} 3577}
3578 3578
3579static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, 3579static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca,
3580 u32 pid, u32 seq, int event, u16 flags) 3580 u32 portid, u32 seq, int event, u16 flags)
3581{ 3581{
3582 struct nlmsghdr *nlh; 3582 struct nlmsghdr *nlh;
3583 u8 scope = RT_SCOPE_UNIVERSE; 3583 u8 scope = RT_SCOPE_UNIVERSE;
@@ -3586,7 +3586,7 @@ static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca,
3586 if (ipv6_addr_scope(&ifmca->mca_addr) & IFA_SITE) 3586 if (ipv6_addr_scope(&ifmca->mca_addr) & IFA_SITE)
3587 scope = RT_SCOPE_SITE; 3587 scope = RT_SCOPE_SITE;
3588 3588
3589 nlh = nlmsg_put(skb, pid, seq, event, sizeof(struct ifaddrmsg), flags); 3589 nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct ifaddrmsg), flags);
3590 if (nlh == NULL) 3590 if (nlh == NULL)
3591 return -EMSGSIZE; 3591 return -EMSGSIZE;
3592 3592
@@ -3602,7 +3602,7 @@ static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca,
3602} 3602}
3603 3603
3604static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, 3604static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca,
3605 u32 pid, u32 seq, int event, unsigned int flags) 3605 u32 portid, u32 seq, int event, unsigned int flags)
3606{ 3606{
3607 struct nlmsghdr *nlh; 3607 struct nlmsghdr *nlh;
3608 u8 scope = RT_SCOPE_UNIVERSE; 3608 u8 scope = RT_SCOPE_UNIVERSE;
@@ -3611,7 +3611,7 @@ static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca,
3611 if (ipv6_addr_scope(&ifaca->aca_addr) & IFA_SITE) 3611 if (ipv6_addr_scope(&ifaca->aca_addr) & IFA_SITE)
3612 scope = RT_SCOPE_SITE; 3612 scope = RT_SCOPE_SITE;
3613 3613
3614 nlh = nlmsg_put(skb, pid, seq, event, sizeof(struct ifaddrmsg), flags); 3614 nlh = nlmsg_put(skb, portid, seq, event, sizeof(struct ifaddrmsg), flags);
3615 if (nlh == NULL) 3615 if (nlh == NULL)
3616 return -EMSGSIZE; 3616 return -EMSGSIZE;
3617 3617
@@ -3652,7 +3652,7 @@ static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb,
3652 if (++ip_idx < s_ip_idx) 3652 if (++ip_idx < s_ip_idx)
3653 continue; 3653 continue;
3654 err = inet6_fill_ifaddr(skb, ifa, 3654 err = inet6_fill_ifaddr(skb, ifa,
3655 NETLINK_CB(cb->skb).pid, 3655 NETLINK_CB(cb->skb).portid,
3656 cb->nlh->nlmsg_seq, 3656 cb->nlh->nlmsg_seq,
3657 RTM_NEWADDR, 3657 RTM_NEWADDR,
3658 NLM_F_MULTI); 3658 NLM_F_MULTI);
@@ -3668,7 +3668,7 @@ static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb,
3668 if (ip_idx < s_ip_idx) 3668 if (ip_idx < s_ip_idx)
3669 continue; 3669 continue;
3670 err = inet6_fill_ifmcaddr(skb, ifmca, 3670 err = inet6_fill_ifmcaddr(skb, ifmca,
3671 NETLINK_CB(cb->skb).pid, 3671 NETLINK_CB(cb->skb).portid,
3672 cb->nlh->nlmsg_seq, 3672 cb->nlh->nlmsg_seq,
3673 RTM_GETMULTICAST, 3673 RTM_GETMULTICAST,
3674 NLM_F_MULTI); 3674 NLM_F_MULTI);
@@ -3683,7 +3683,7 @@ static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb,
3683 if (ip_idx < s_ip_idx) 3683 if (ip_idx < s_ip_idx)
3684 continue; 3684 continue;
3685 err = inet6_fill_ifacaddr(skb, ifaca, 3685 err = inet6_fill_ifacaddr(skb, ifaca,
3686 NETLINK_CB(cb->skb).pid, 3686 NETLINK_CB(cb->skb).portid,
3687 cb->nlh->nlmsg_seq, 3687 cb->nlh->nlmsg_seq,
3688 RTM_GETANYCAST, 3688 RTM_GETANYCAST,
3689 NLM_F_MULTI); 3689 NLM_F_MULTI);
@@ -3805,7 +3805,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh,
3805 goto errout_ifa; 3805 goto errout_ifa;
3806 } 3806 }
3807 3807
3808 err = inet6_fill_ifaddr(skb, ifa, NETLINK_CB(in_skb).pid, 3808 err = inet6_fill_ifaddr(skb, ifa, NETLINK_CB(in_skb).portid,
3809 nlh->nlmsg_seq, RTM_NEWADDR, 0); 3809 nlh->nlmsg_seq, RTM_NEWADDR, 0);
3810 if (err < 0) { 3810 if (err < 0) {
3811 /* -EMSGSIZE implies BUG in inet6_ifaddr_msgsize() */ 3811 /* -EMSGSIZE implies BUG in inet6_ifaddr_msgsize() */
@@ -3813,7 +3813,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh,
3813 kfree_skb(skb); 3813 kfree_skb(skb);
3814 goto errout_ifa; 3814 goto errout_ifa;
3815 } 3815 }
3816 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); 3816 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
3817errout_ifa: 3817errout_ifa:
3818 in6_ifa_put(ifa); 3818 in6_ifa_put(ifa);
3819errout: 3819errout:
@@ -4015,14 +4015,14 @@ static int inet6_fill_link_af(struct sk_buff *skb, const struct net_device *dev)
4015} 4015}
4016 4016
4017static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, 4017static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
4018 u32 pid, u32 seq, int event, unsigned int flags) 4018 u32 portid, u32 seq, int event, unsigned int flags)
4019{ 4019{
4020 struct net_device *dev = idev->dev; 4020 struct net_device *dev = idev->dev;
4021 struct ifinfomsg *hdr; 4021 struct ifinfomsg *hdr;
4022 struct nlmsghdr *nlh; 4022 struct nlmsghdr *nlh;
4023 void *protoinfo; 4023 void *protoinfo;
4024 4024
4025 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*hdr), flags); 4025 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*hdr), flags);
4026 if (nlh == NULL) 4026 if (nlh == NULL)
4027 return -EMSGSIZE; 4027 return -EMSGSIZE;
4028 4028
@@ -4080,7 +4080,7 @@ static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
4080 if (!idev) 4080 if (!idev)
4081 goto cont; 4081 goto cont;
4082 if (inet6_fill_ifinfo(skb, idev, 4082 if (inet6_fill_ifinfo(skb, idev,
4083 NETLINK_CB(cb->skb).pid, 4083 NETLINK_CB(cb->skb).portid,
4084 cb->nlh->nlmsg_seq, 4084 cb->nlh->nlmsg_seq,
4085 RTM_NEWLINK, NLM_F_MULTI) <= 0) 4085 RTM_NEWLINK, NLM_F_MULTI) <= 0)
4086 goto out; 4086 goto out;
@@ -4128,14 +4128,14 @@ static inline size_t inet6_prefix_nlmsg_size(void)
4128} 4128}
4129 4129
4130static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, 4130static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
4131 struct prefix_info *pinfo, u32 pid, u32 seq, 4131 struct prefix_info *pinfo, u32 portid, u32 seq,
4132 int event, unsigned int flags) 4132 int event, unsigned int flags)
4133{ 4133{
4134 struct prefixmsg *pmsg; 4134 struct prefixmsg *pmsg;
4135 struct nlmsghdr *nlh; 4135 struct nlmsghdr *nlh;
4136 struct prefix_cacheinfo ci; 4136 struct prefix_cacheinfo ci;
4137 4137
4138 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*pmsg), flags); 4138 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*pmsg), flags);
4139 if (nlh == NULL) 4139 if (nlh == NULL)
4140 return -EMSGSIZE; 4140 return -EMSGSIZE;
4141 4141