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
@@ -2136,7 +2136,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
|
||||
EXPORT_SYMBOL_GPL(ip_route_output_flow);
|
||||
|
||||
static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
|
||||
struct flowi4 *fl4, struct sk_buff *skb, u32 pid,
|
||||
struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
|
||||
u32 seq, int event, int nowait, unsigned int flags)
|
||||
{
|
||||
struct rtable *rt = skb_rtable(skb);
|
||||
@@ -2146,7 +2146,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
|
||||
u32 error;
|
||||
u32 metrics[RTAX_MAX];
|
||||
|
||||
nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags);
|
||||
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags);
|
||||
if (nlh == NULL)
|
||||
return -EMSGSIZE;
|
||||
|
||||
@@ -2306,12 +2306,12 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
|
||||
rt->rt_flags |= RTCF_NOTIFY;
|
||||
|
||||
err = rt_fill_info(net, dst, src, &fl4, skb,
|
||||
NETLINK_CB(in_skb).pid, nlh->nlmsg_seq,
|
||||
NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
|
||||
RTM_NEWROUTE, 0, 0);
|
||||
if (err <= 0)
|
||||
goto errout_free;
|
||||
|
||||
err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid);
|
||||
err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
|
||||
errout:
|
||||
return err;
|
||||
|
||||
|
Reference in New Issue
Block a user