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/key | |
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/key')
-rw-r--r-- | net/key/af_key.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 334f93b8cfcb..2ca7d7f6861c 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -54,7 +54,7 @@ struct pfkey_sock { | |||
54 | 54 | ||
55 | struct { | 55 | struct { |
56 | uint8_t msg_version; | 56 | uint8_t msg_version; |
57 | uint32_t msg_pid; | 57 | uint32_t msg_portid; |
58 | int (*dump)(struct pfkey_sock *sk); | 58 | int (*dump)(struct pfkey_sock *sk); |
59 | void (*done)(struct pfkey_sock *sk); | 59 | void (*done)(struct pfkey_sock *sk); |
60 | union { | 60 | union { |
@@ -1447,7 +1447,7 @@ static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) | |||
1447 | hdr->sadb_msg_errno = 0; | 1447 | hdr->sadb_msg_errno = 0; |
1448 | hdr->sadb_msg_reserved = 0; | 1448 | hdr->sadb_msg_reserved = 0; |
1449 | hdr->sadb_msg_seq = c->seq; | 1449 | hdr->sadb_msg_seq = c->seq; |
1450 | hdr->sadb_msg_pid = c->pid; | 1450 | hdr->sadb_msg_pid = c->portid; |
1451 | 1451 | ||
1452 | pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x)); | 1452 | pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x)); |
1453 | 1453 | ||
@@ -1486,7 +1486,7 @@ static int pfkey_add(struct sock *sk, struct sk_buff *skb, const struct sadb_msg | |||
1486 | else | 1486 | else |
1487 | c.event = XFRM_MSG_UPDSA; | 1487 | c.event = XFRM_MSG_UPDSA; |
1488 | c.seq = hdr->sadb_msg_seq; | 1488 | c.seq = hdr->sadb_msg_seq; |
1489 | c.pid = hdr->sadb_msg_pid; | 1489 | c.portid = hdr->sadb_msg_pid; |
1490 | km_state_notify(x, &c); | 1490 | km_state_notify(x, &c); |
1491 | out: | 1491 | out: |
1492 | xfrm_state_put(x); | 1492 | xfrm_state_put(x); |
@@ -1523,7 +1523,7 @@ static int pfkey_delete(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
1523 | goto out; | 1523 | goto out; |
1524 | 1524 | ||
1525 | c.seq = hdr->sadb_msg_seq; | 1525 | c.seq = hdr->sadb_msg_seq; |
1526 | c.pid = hdr->sadb_msg_pid; | 1526 | c.portid = hdr->sadb_msg_pid; |
1527 | c.event = XFRM_MSG_DELSA; | 1527 | c.event = XFRM_MSG_DELSA; |
1528 | km_state_notify(x, &c); | 1528 | km_state_notify(x, &c); |
1529 | out: | 1529 | out: |
@@ -1701,7 +1701,7 @@ static int key_notify_sa_flush(const struct km_event *c) | |||
1701 | hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); | 1701 | hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); |
1702 | hdr->sadb_msg_type = SADB_FLUSH; | 1702 | hdr->sadb_msg_type = SADB_FLUSH; |
1703 | hdr->sadb_msg_seq = c->seq; | 1703 | hdr->sadb_msg_seq = c->seq; |
1704 | hdr->sadb_msg_pid = c->pid; | 1704 | hdr->sadb_msg_pid = c->portid; |
1705 | hdr->sadb_msg_version = PF_KEY_V2; | 1705 | hdr->sadb_msg_version = PF_KEY_V2; |
1706 | hdr->sadb_msg_errno = (uint8_t) 0; | 1706 | hdr->sadb_msg_errno = (uint8_t) 0; |
1707 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); | 1707 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
@@ -1736,7 +1736,7 @@ static int pfkey_flush(struct sock *sk, struct sk_buff *skb, const struct sadb_m | |||
1736 | 1736 | ||
1737 | c.data.proto = proto; | 1737 | c.data.proto = proto; |
1738 | c.seq = hdr->sadb_msg_seq; | 1738 | c.seq = hdr->sadb_msg_seq; |
1739 | c.pid = hdr->sadb_msg_pid; | 1739 | c.portid = hdr->sadb_msg_pid; |
1740 | c.event = XFRM_MSG_FLUSHSA; | 1740 | c.event = XFRM_MSG_FLUSHSA; |
1741 | c.net = net; | 1741 | c.net = net; |
1742 | km_state_notify(NULL, &c); | 1742 | km_state_notify(NULL, &c); |
@@ -1764,7 +1764,7 @@ static int dump_sa(struct xfrm_state *x, int count, void *ptr) | |||
1764 | out_hdr->sadb_msg_errno = 0; | 1764 | out_hdr->sadb_msg_errno = 0; |
1765 | out_hdr->sadb_msg_reserved = 0; | 1765 | out_hdr->sadb_msg_reserved = 0; |
1766 | out_hdr->sadb_msg_seq = count + 1; | 1766 | out_hdr->sadb_msg_seq = count + 1; |
1767 | out_hdr->sadb_msg_pid = pfk->dump.msg_pid; | 1767 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
1768 | 1768 | ||
1769 | if (pfk->dump.skb) | 1769 | if (pfk->dump.skb) |
1770 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | 1770 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, |
@@ -1798,7 +1798,7 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, const struct sadb_ms | |||
1798 | return -EINVAL; | 1798 | return -EINVAL; |
1799 | 1799 | ||
1800 | pfk->dump.msg_version = hdr->sadb_msg_version; | 1800 | pfk->dump.msg_version = hdr->sadb_msg_version; |
1801 | pfk->dump.msg_pid = hdr->sadb_msg_pid; | 1801 | pfk->dump.msg_portid = hdr->sadb_msg_pid; |
1802 | pfk->dump.dump = pfkey_dump_sa; | 1802 | pfk->dump.dump = pfkey_dump_sa; |
1803 | pfk->dump.done = pfkey_dump_sa_done; | 1803 | pfk->dump.done = pfkey_dump_sa_done; |
1804 | xfrm_state_walk_init(&pfk->dump.u.state, proto); | 1804 | xfrm_state_walk_init(&pfk->dump.u.state, proto); |
@@ -2157,7 +2157,7 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_ev | |||
2157 | out_hdr->sadb_msg_type = event2poltype(c->event); | 2157 | out_hdr->sadb_msg_type = event2poltype(c->event); |
2158 | out_hdr->sadb_msg_errno = 0; | 2158 | out_hdr->sadb_msg_errno = 0; |
2159 | out_hdr->sadb_msg_seq = c->seq; | 2159 | out_hdr->sadb_msg_seq = c->seq; |
2160 | out_hdr->sadb_msg_pid = c->pid; | 2160 | out_hdr->sadb_msg_pid = c->portid; |
2161 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); | 2161 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); |
2162 | return 0; | 2162 | return 0; |
2163 | 2163 | ||
@@ -2272,7 +2272,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2272 | c.event = XFRM_MSG_NEWPOLICY; | 2272 | c.event = XFRM_MSG_NEWPOLICY; |
2273 | 2273 | ||
2274 | c.seq = hdr->sadb_msg_seq; | 2274 | c.seq = hdr->sadb_msg_seq; |
2275 | c.pid = hdr->sadb_msg_pid; | 2275 | c.portid = hdr->sadb_msg_pid; |
2276 | 2276 | ||
2277 | km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); | 2277 | km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); |
2278 | xfrm_pol_put(xp); | 2278 | xfrm_pol_put(xp); |
@@ -2351,7 +2351,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa | |||
2351 | goto out; | 2351 | goto out; |
2352 | 2352 | ||
2353 | c.seq = hdr->sadb_msg_seq; | 2353 | c.seq = hdr->sadb_msg_seq; |
2354 | c.pid = hdr->sadb_msg_pid; | 2354 | c.portid = hdr->sadb_msg_pid; |
2355 | c.data.byid = 0; | 2355 | c.data.byid = 0; |
2356 | c.event = XFRM_MSG_DELPOLICY; | 2356 | c.event = XFRM_MSG_DELPOLICY; |
2357 | km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); | 2357 | km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); |
@@ -2597,7 +2597,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2597 | if (err) | 2597 | if (err) |
2598 | goto out; | 2598 | goto out; |
2599 | c.seq = hdr->sadb_msg_seq; | 2599 | c.seq = hdr->sadb_msg_seq; |
2600 | c.pid = hdr->sadb_msg_pid; | 2600 | c.portid = hdr->sadb_msg_pid; |
2601 | c.data.byid = 1; | 2601 | c.data.byid = 1; |
2602 | c.event = XFRM_MSG_DELPOLICY; | 2602 | c.event = XFRM_MSG_DELPOLICY; |
2603 | km_policy_notify(xp, dir, &c); | 2603 | km_policy_notify(xp, dir, &c); |
@@ -2634,7 +2634,7 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr) | |||
2634 | out_hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC; | 2634 | out_hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC; |
2635 | out_hdr->sadb_msg_errno = 0; | 2635 | out_hdr->sadb_msg_errno = 0; |
2636 | out_hdr->sadb_msg_seq = count + 1; | 2636 | out_hdr->sadb_msg_seq = count + 1; |
2637 | out_hdr->sadb_msg_pid = pfk->dump.msg_pid; | 2637 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
2638 | 2638 | ||
2639 | if (pfk->dump.skb) | 2639 | if (pfk->dump.skb) |
2640 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | 2640 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, |
@@ -2663,7 +2663,7 @@ static int pfkey_spddump(struct sock *sk, struct sk_buff *skb, const struct sadb | |||
2663 | return -EBUSY; | 2663 | return -EBUSY; |
2664 | 2664 | ||
2665 | pfk->dump.msg_version = hdr->sadb_msg_version; | 2665 | pfk->dump.msg_version = hdr->sadb_msg_version; |
2666 | pfk->dump.msg_pid = hdr->sadb_msg_pid; | 2666 | pfk->dump.msg_portid = hdr->sadb_msg_pid; |
2667 | pfk->dump.dump = pfkey_dump_sp; | 2667 | pfk->dump.dump = pfkey_dump_sp; |
2668 | pfk->dump.done = pfkey_dump_sp_done; | 2668 | pfk->dump.done = pfkey_dump_sp_done; |
2669 | xfrm_policy_walk_init(&pfk->dump.u.policy, XFRM_POLICY_TYPE_MAIN); | 2669 | xfrm_policy_walk_init(&pfk->dump.u.policy, XFRM_POLICY_TYPE_MAIN); |
@@ -2682,7 +2682,7 @@ static int key_notify_policy_flush(const struct km_event *c) | |||
2682 | hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); | 2682 | hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); |
2683 | hdr->sadb_msg_type = SADB_X_SPDFLUSH; | 2683 | hdr->sadb_msg_type = SADB_X_SPDFLUSH; |
2684 | hdr->sadb_msg_seq = c->seq; | 2684 | hdr->sadb_msg_seq = c->seq; |
2685 | hdr->sadb_msg_pid = c->pid; | 2685 | hdr->sadb_msg_pid = c->portid; |
2686 | hdr->sadb_msg_version = PF_KEY_V2; | 2686 | hdr->sadb_msg_version = PF_KEY_V2; |
2687 | hdr->sadb_msg_errno = (uint8_t) 0; | 2687 | hdr->sadb_msg_errno = (uint8_t) 0; |
2688 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); | 2688 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
@@ -2711,7 +2711,7 @@ static int pfkey_spdflush(struct sock *sk, struct sk_buff *skb, const struct sad | |||
2711 | 2711 | ||
2712 | c.data.type = XFRM_POLICY_TYPE_MAIN; | 2712 | c.data.type = XFRM_POLICY_TYPE_MAIN; |
2713 | c.event = XFRM_MSG_FLUSHPOLICY; | 2713 | c.event = XFRM_MSG_FLUSHPOLICY; |
2714 | c.pid = hdr->sadb_msg_pid; | 2714 | c.portid = hdr->sadb_msg_pid; |
2715 | c.seq = hdr->sadb_msg_seq; | 2715 | c.seq = hdr->sadb_msg_seq; |
2716 | c.net = net; | 2716 | c.net = net; |
2717 | km_policy_notify(NULL, 0, &c); | 2717 | km_policy_notify(NULL, 0, &c); |