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/sched/cls_api.c | |
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/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index dc3ef5aef355..7ae02892437c 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -343,13 +343,13 @@ errout: | |||
343 | } | 343 | } |
344 | 344 | ||
345 | static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | 345 | static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, |
346 | unsigned long fh, u32 pid, u32 seq, u16 flags, int event) | 346 | unsigned long fh, u32 portid, u32 seq, u16 flags, int event) |
347 | { | 347 | { |
348 | struct tcmsg *tcm; | 348 | struct tcmsg *tcm; |
349 | struct nlmsghdr *nlh; | 349 | struct nlmsghdr *nlh; |
350 | unsigned char *b = skb_tail_pointer(skb); | 350 | unsigned char *b = skb_tail_pointer(skb); |
351 | 351 | ||
352 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*tcm), flags); | 352 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); |
353 | if (!nlh) | 353 | if (!nlh) |
354 | goto out_nlmsg_trim; | 354 | goto out_nlmsg_trim; |
355 | tcm = nlmsg_data(nlh); | 355 | tcm = nlmsg_data(nlh); |
@@ -381,18 +381,18 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, | |||
381 | unsigned long fh, int event) | 381 | unsigned long fh, int event) |
382 | { | 382 | { |
383 | struct sk_buff *skb; | 383 | struct sk_buff *skb; |
384 | u32 pid = oskb ? NETLINK_CB(oskb).pid : 0; | 384 | u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; |
385 | 385 | ||
386 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 386 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
387 | if (!skb) | 387 | if (!skb) |
388 | return -ENOBUFS; | 388 | return -ENOBUFS; |
389 | 389 | ||
390 | if (tcf_fill_node(skb, tp, fh, pid, n->nlmsg_seq, 0, event) <= 0) { | 390 | if (tcf_fill_node(skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { |
391 | kfree_skb(skb); | 391 | kfree_skb(skb); |
392 | return -EINVAL; | 392 | return -EINVAL; |
393 | } | 393 | } |
394 | 394 | ||
395 | return rtnetlink_send(skb, net, pid, RTNLGRP_TC, | 395 | return rtnetlink_send(skb, net, portid, RTNLGRP_TC, |
396 | n->nlmsg_flags & NLM_F_ECHO); | 396 | n->nlmsg_flags & NLM_F_ECHO); |
397 | } | 397 | } |
398 | 398 | ||
@@ -407,7 +407,7 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, | |||
407 | { | 407 | { |
408 | struct tcf_dump_args *a = (void *)arg; | 408 | struct tcf_dump_args *a = (void *)arg; |
409 | 409 | ||
410 | return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).pid, | 410 | return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, |
411 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); | 411 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); |
412 | } | 412 | } |
413 | 413 | ||
@@ -465,7 +465,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
465 | if (t > s_t) | 465 | if (t > s_t) |
466 | memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); | 466 | memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); |
467 | if (cb->args[1] == 0) { | 467 | if (cb->args[1] == 0) { |
468 | if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).pid, | 468 | if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).portid, |
469 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 469 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
470 | RTM_NEWTFILTER) <= 0) | 470 | RTM_NEWTFILTER) <= 0) |
471 | break; | 471 | break; |