aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
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/ipv4
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/ipv4')
-rw-r--r--net/ipv4/devinet.c28
-rw-r--r--net/ipv4/fib_frontend.c10
-rw-r--r--net/ipv4/fib_semantics.c8
-rw-r--r--net/ipv4/fib_trie.c2
-rw-r--r--net/ipv4/inet_diag.c32
-rw-r--r--net/ipv4/ipmr.c10
-rw-r--r--net/ipv4/route.c8
-rw-r--r--net/ipv4/tcp_metrics.c2
-rw-r--r--net/ipv4/udp_diag.c6
9 files changed, 53 insertions, 53 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f14eff506743..7b00556e184b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -311,7 +311,7 @@ int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b)
311} 311}
312 312
313static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, 313static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
314 int destroy, struct nlmsghdr *nlh, u32 pid) 314 int destroy, struct nlmsghdr *nlh, u32 portid)
315{ 315{
316 struct in_ifaddr *promote = NULL; 316 struct in_ifaddr *promote = NULL;
317 struct in_ifaddr *ifa, *ifa1 = *ifap; 317 struct in_ifaddr *ifa, *ifa1 = *ifap;
@@ -345,7 +345,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
345 inet_hash_remove(ifa); 345 inet_hash_remove(ifa);
346 *ifap1 = ifa->ifa_next; 346 *ifap1 = ifa->ifa_next;
347 347
348 rtmsg_ifa(RTM_DELADDR, ifa, nlh, pid); 348 rtmsg_ifa(RTM_DELADDR, ifa, nlh, portid);
349 blocking_notifier_call_chain(&inetaddr_chain, 349 blocking_notifier_call_chain(&inetaddr_chain,
350 NETDEV_DOWN, ifa); 350 NETDEV_DOWN, ifa);
351 inet_free_ifa(ifa); 351 inet_free_ifa(ifa);
@@ -382,7 +382,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
382 is valid, it will try to restore deleted routes... Grr. 382 is valid, it will try to restore deleted routes... Grr.
383 So that, this order is correct. 383 So that, this order is correct.
384 */ 384 */
385 rtmsg_ifa(RTM_DELADDR, ifa1, nlh, pid); 385 rtmsg_ifa(RTM_DELADDR, ifa1, nlh, portid);
386 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1); 386 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1);
387 387
388 if (promote) { 388 if (promote) {
@@ -395,7 +395,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
395 } 395 }
396 396
397 promote->ifa_flags &= ~IFA_F_SECONDARY; 397 promote->ifa_flags &= ~IFA_F_SECONDARY;
398 rtmsg_ifa(RTM_NEWADDR, promote, nlh, pid); 398 rtmsg_ifa(RTM_NEWADDR, promote, nlh, portid);
399 blocking_notifier_call_chain(&inetaddr_chain, 399 blocking_notifier_call_chain(&inetaddr_chain,
400 NETDEV_UP, promote); 400 NETDEV_UP, promote);
401 for (ifa = next_sec; ifa; ifa = ifa->ifa_next) { 401 for (ifa = next_sec; ifa; ifa = ifa->ifa_next) {
@@ -417,7 +417,7 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
417} 417}
418 418
419static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh, 419static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
420 u32 pid) 420 u32 portid)
421{ 421{
422 struct in_device *in_dev = ifa->ifa_dev; 422 struct in_device *in_dev = ifa->ifa_dev;
423 struct in_ifaddr *ifa1, **ifap, **last_primary; 423 struct in_ifaddr *ifa1, **ifap, **last_primary;
@@ -464,7 +464,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
464 /* Send message first, then call notifier. 464 /* Send message first, then call notifier.
465 Notifier will trigger FIB update, so that 465 Notifier will trigger FIB update, so that
466 listeners of netlink will know about new ifaddr */ 466 listeners of netlink will know about new ifaddr */
467 rtmsg_ifa(RTM_NEWADDR, ifa, nlh, pid); 467 rtmsg_ifa(RTM_NEWADDR, ifa, nlh, portid);
468 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa); 468 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
469 469
470 return 0; 470 return 0;
@@ -563,7 +563,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
563 !inet_ifa_match(nla_get_be32(tb[IFA_ADDRESS]), ifa))) 563 !inet_ifa_match(nla_get_be32(tb[IFA_ADDRESS]), ifa)))
564 continue; 564 continue;
565 565
566 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).pid); 566 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid);
567 return 0; 567 return 0;
568 } 568 }
569 569
@@ -649,7 +649,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
649 if (IS_ERR(ifa)) 649 if (IS_ERR(ifa))
650 return PTR_ERR(ifa); 650 return PTR_ERR(ifa);
651 651
652 return __inet_insert_ifa(ifa, nlh, NETLINK_CB(skb).pid); 652 return __inet_insert_ifa(ifa, nlh, NETLINK_CB(skb).portid);
653} 653}
654 654
655/* 655/*
@@ -1246,12 +1246,12 @@ static size_t inet_nlmsg_size(void)
1246} 1246}
1247 1247
1248static int inet_fill_ifaddr(struct sk_buff *skb, struct in_ifaddr *ifa, 1248static int inet_fill_ifaddr(struct sk_buff *skb, struct in_ifaddr *ifa,
1249 u32 pid, u32 seq, int event, unsigned int flags) 1249 u32 portid, u32 seq, int event, unsigned int flags)
1250{ 1250{
1251 struct ifaddrmsg *ifm; 1251 struct ifaddrmsg *ifm;
1252 struct nlmsghdr *nlh; 1252 struct nlmsghdr *nlh;
1253 1253
1254 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*ifm), flags); 1254 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), flags);
1255 if (nlh == NULL) 1255 if (nlh == NULL)
1256 return -EMSGSIZE; 1256 return -EMSGSIZE;
1257 1257
@@ -1313,7 +1313,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
1313 if (ip_idx < s_ip_idx) 1313 if (ip_idx < s_ip_idx)
1314 continue; 1314 continue;
1315 if (inet_fill_ifaddr(skb, ifa, 1315 if (inet_fill_ifaddr(skb, ifa,
1316 NETLINK_CB(cb->skb).pid, 1316 NETLINK_CB(cb->skb).portid,
1317 cb->nlh->nlmsg_seq, 1317 cb->nlh->nlmsg_seq,
1318 RTM_NEWADDR, NLM_F_MULTI) <= 0) { 1318 RTM_NEWADDR, NLM_F_MULTI) <= 0) {
1319 rcu_read_unlock(); 1319 rcu_read_unlock();
@@ -1335,7 +1335,7 @@ done:
1335} 1335}
1336 1336
1337static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh, 1337static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh,
1338 u32 pid) 1338 u32 portid)
1339{ 1339{
1340 struct sk_buff *skb; 1340 struct sk_buff *skb;
1341 u32 seq = nlh ? nlh->nlmsg_seq : 0; 1341 u32 seq = nlh ? nlh->nlmsg_seq : 0;
@@ -1347,14 +1347,14 @@ static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh,
1347 if (skb == NULL) 1347 if (skb == NULL)
1348 goto errout; 1348 goto errout;
1349 1349
1350 err = inet_fill_ifaddr(skb, ifa, pid, seq, event, 0); 1350 err = inet_fill_ifaddr(skb, ifa, portid, seq, event, 0);
1351 if (err < 0) { 1351 if (err < 0) {
1352 /* -EMSGSIZE implies BUG in inet_nlmsg_size() */ 1352 /* -EMSGSIZE implies BUG in inet_nlmsg_size() */
1353 WARN_ON(err == -EMSGSIZE); 1353 WARN_ON(err == -EMSGSIZE);
1354 kfree_skb(skb); 1354 kfree_skb(skb);
1355 goto errout; 1355 goto errout;
1356 } 1356 }
1357 rtnl_notify(skb, net, pid, RTNLGRP_IPV4_IFADDR, nlh, GFP_KERNEL); 1357 rtnl_notify(skb, net, portid, RTNLGRP_IPV4_IFADDR, nlh, GFP_KERNEL);
1358 return; 1358 return;
1359errout: 1359errout:
1360 if (err < 0) 1360 if (err < 0)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index dc1f10ed1872..68c93d1bb03a 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -557,7 +557,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
557 cfg->fc_flags = rtm->rtm_flags; 557 cfg->fc_flags = rtm->rtm_flags;
558 cfg->fc_nlflags = nlh->nlmsg_flags; 558 cfg->fc_nlflags = nlh->nlmsg_flags;
559 559
560 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid; 560 cfg->fc_nlinfo.portid = NETLINK_CB(skb).portid;
561 cfg->fc_nlinfo.nlh = nlh; 561 cfg->fc_nlinfo.nlh = nlh;
562 cfg->fc_nlinfo.nl_net = net; 562 cfg->fc_nlinfo.nl_net = net;
563 563
@@ -955,7 +955,7 @@ static void nl_fib_input(struct sk_buff *skb)
955 struct fib_result_nl *frn; 955 struct fib_result_nl *frn;
956 struct nlmsghdr *nlh; 956 struct nlmsghdr *nlh;
957 struct fib_table *tb; 957 struct fib_table *tb;
958 u32 pid; 958 u32 portid;
959 959
960 net = sock_net(skb->sk); 960 net = sock_net(skb->sk);
961 nlh = nlmsg_hdr(skb); 961 nlh = nlmsg_hdr(skb);
@@ -973,10 +973,10 @@ static void nl_fib_input(struct sk_buff *skb)
973 973
974 nl_fib_lookup(frn, tb); 974 nl_fib_lookup(frn, tb);
975 975
976 pid = NETLINK_CB(skb).pid; /* pid of sending process */ 976 portid = NETLINK_CB(skb).portid; /* pid of sending process */
977 NETLINK_CB(skb).pid = 0; /* from kernel */ 977 NETLINK_CB(skb).portid = 0; /* from kernel */
978 NETLINK_CB(skb).dst_group = 0; /* unicast */ 978 NETLINK_CB(skb).dst_group = 0; /* unicast */
979 netlink_unicast(net->ipv4.fibnl, skb, pid, MSG_DONTWAIT); 979 netlink_unicast(net->ipv4.fibnl, skb, portid, MSG_DONTWAIT);
980} 980}
981 981
982static int __net_init nl_fib_lookup_init(struct net *net) 982static int __net_init nl_fib_lookup_init(struct net *net)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index da80dc14cc76..3509065e409a 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -391,7 +391,7 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
391 if (skb == NULL) 391 if (skb == NULL)
392 goto errout; 392 goto errout;
393 393
394 err = fib_dump_info(skb, info->pid, seq, event, tb_id, 394 err = fib_dump_info(skb, info->portid, seq, event, tb_id,
395 fa->fa_type, key, dst_len, 395 fa->fa_type, key, dst_len,
396 fa->fa_tos, fa->fa_info, nlm_flags); 396 fa->fa_tos, fa->fa_info, nlm_flags);
397 if (err < 0) { 397 if (err < 0) {
@@ -400,7 +400,7 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
400 kfree_skb(skb); 400 kfree_skb(skb);
401 goto errout; 401 goto errout;
402 } 402 }
403 rtnl_notify(skb, info->nl_net, info->pid, RTNLGRP_IPV4_ROUTE, 403 rtnl_notify(skb, info->nl_net, info->portid, RTNLGRP_IPV4_ROUTE,
404 info->nlh, GFP_KERNEL); 404 info->nlh, GFP_KERNEL);
405 return; 405 return;
406errout: 406errout:
@@ -989,14 +989,14 @@ failure:
989 return ERR_PTR(err); 989 return ERR_PTR(err);
990} 990}
991 991
992int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 992int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
993 u32 tb_id, u8 type, __be32 dst, int dst_len, u8 tos, 993 u32 tb_id, u8 type, __be32 dst, int dst_len, u8 tos,
994 struct fib_info *fi, unsigned int flags) 994 struct fib_info *fi, unsigned int flags)
995{ 995{
996 struct nlmsghdr *nlh; 996 struct nlmsghdr *nlh;
997 struct rtmsg *rtm; 997 struct rtmsg *rtm;
998 998
999 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags); 999 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*rtm), flags);
1000 if (nlh == NULL) 1000 if (nlh == NULL)
1001 return -EMSGSIZE; 1001 return -EMSGSIZE;
1002 1002
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 8d766106b540..31d771ca9a70 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1873,7 +1873,7 @@ static int fn_trie_dump_fa(t_key key, int plen, struct list_head *fah,
1873 continue; 1873 continue;
1874 } 1874 }
1875 1875
1876 if (fib_dump_info(skb, NETLINK_CB(cb->skb).pid, 1876 if (fib_dump_info(skb, NETLINK_CB(cb->skb).portid,
1877 cb->nlh->nlmsg_seq, 1877 cb->nlh->nlmsg_seq,
1878 RTM_NEWROUTE, 1878 RTM_NEWROUTE,
1879 tb->tb_id, 1879 tb->tb_id,
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 8bc005b1435f..535584c00f91 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -70,7 +70,7 @@ static inline void inet_diag_unlock_handler(
70int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, 70int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
71 struct sk_buff *skb, struct inet_diag_req_v2 *req, 71 struct sk_buff *skb, struct inet_diag_req_v2 *req,
72 struct user_namespace *user_ns, 72 struct user_namespace *user_ns,
73 u32 pid, u32 seq, u16 nlmsg_flags, 73 u32 portid, u32 seq, u16 nlmsg_flags,
74 const struct nlmsghdr *unlh) 74 const struct nlmsghdr *unlh)
75{ 75{
76 const struct inet_sock *inet = inet_sk(sk); 76 const struct inet_sock *inet = inet_sk(sk);
@@ -84,7 +84,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
84 handler = inet_diag_table[req->sdiag_protocol]; 84 handler = inet_diag_table[req->sdiag_protocol];
85 BUG_ON(handler == NULL); 85 BUG_ON(handler == NULL);
86 86
87 nlh = nlmsg_put(skb, pid, seq, unlh->nlmsg_type, sizeof(*r), 87 nlh = nlmsg_put(skb, portid, seq, unlh->nlmsg_type, sizeof(*r),
88 nlmsg_flags); 88 nlmsg_flags);
89 if (!nlh) 89 if (!nlh)
90 return -EMSGSIZE; 90 return -EMSGSIZE;
@@ -201,23 +201,23 @@ EXPORT_SYMBOL_GPL(inet_sk_diag_fill);
201static int inet_csk_diag_fill(struct sock *sk, 201static int inet_csk_diag_fill(struct sock *sk,
202 struct sk_buff *skb, struct inet_diag_req_v2 *req, 202 struct sk_buff *skb, struct inet_diag_req_v2 *req,
203 struct user_namespace *user_ns, 203 struct user_namespace *user_ns,
204 u32 pid, u32 seq, u16 nlmsg_flags, 204 u32 portid, u32 seq, u16 nlmsg_flags,
205 const struct nlmsghdr *unlh) 205 const struct nlmsghdr *unlh)
206{ 206{
207 return inet_sk_diag_fill(sk, inet_csk(sk), 207 return inet_sk_diag_fill(sk, inet_csk(sk),
208 skb, req, user_ns, pid, seq, nlmsg_flags, unlh); 208 skb, req, user_ns, portid, seq, nlmsg_flags, unlh);
209} 209}
210 210
211static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, 211static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
212 struct sk_buff *skb, struct inet_diag_req_v2 *req, 212 struct sk_buff *skb, struct inet_diag_req_v2 *req,
213 u32 pid, u32 seq, u16 nlmsg_flags, 213 u32 portid, u32 seq, u16 nlmsg_flags,
214 const struct nlmsghdr *unlh) 214 const struct nlmsghdr *unlh)
215{ 215{
216 long tmo; 216 long tmo;
217 struct inet_diag_msg *r; 217 struct inet_diag_msg *r;
218 struct nlmsghdr *nlh; 218 struct nlmsghdr *nlh;
219 219
220 nlh = nlmsg_put(skb, pid, seq, unlh->nlmsg_type, sizeof(*r), 220 nlh = nlmsg_put(skb, portid, seq, unlh->nlmsg_type, sizeof(*r),
221 nlmsg_flags); 221 nlmsg_flags);
222 if (!nlh) 222 if (!nlh)
223 return -EMSGSIZE; 223 return -EMSGSIZE;
@@ -260,14 +260,14 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
260static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, 260static int sk_diag_fill(struct sock *sk, struct sk_buff *skb,
261 struct inet_diag_req_v2 *r, 261 struct inet_diag_req_v2 *r,
262 struct user_namespace *user_ns, 262 struct user_namespace *user_ns,
263 u32 pid, u32 seq, u16 nlmsg_flags, 263 u32 portid, u32 seq, u16 nlmsg_flags,
264 const struct nlmsghdr *unlh) 264 const struct nlmsghdr *unlh)
265{ 265{
266 if (sk->sk_state == TCP_TIME_WAIT) 266 if (sk->sk_state == TCP_TIME_WAIT)
267 return inet_twsk_diag_fill((struct inet_timewait_sock *)sk, 267 return inet_twsk_diag_fill((struct inet_timewait_sock *)sk,
268 skb, r, pid, seq, nlmsg_flags, 268 skb, r, portid, seq, nlmsg_flags,
269 unlh); 269 unlh);
270 return inet_csk_diag_fill(sk, skb, r, user_ns, pid, seq, nlmsg_flags, unlh); 270 return inet_csk_diag_fill(sk, skb, r, user_ns, portid, seq, nlmsg_flags, unlh);
271} 271}
272 272
273int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_skb, 273int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_skb,
@@ -316,14 +316,14 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_s
316 316
317 err = sk_diag_fill(sk, rep, req, 317 err = sk_diag_fill(sk, rep, req,
318 sk_user_ns(NETLINK_CB(in_skb).ssk), 318 sk_user_ns(NETLINK_CB(in_skb).ssk),
319 NETLINK_CB(in_skb).pid, 319 NETLINK_CB(in_skb).portid,
320 nlh->nlmsg_seq, 0, nlh); 320 nlh->nlmsg_seq, 0, nlh);
321 if (err < 0) { 321 if (err < 0) {
322 WARN_ON(err == -EMSGSIZE); 322 WARN_ON(err == -EMSGSIZE);
323 nlmsg_free(rep); 323 nlmsg_free(rep);
324 goto out; 324 goto out;
325 } 325 }
326 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid, 326 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid,
327 MSG_DONTWAIT); 327 MSG_DONTWAIT);
328 if (err > 0) 328 if (err > 0)
329 err = 0; 329 err = 0;
@@ -557,7 +557,7 @@ static int inet_csk_diag_dump(struct sock *sk,
557 557
558 return inet_csk_diag_fill(sk, skb, r, 558 return inet_csk_diag_fill(sk, skb, r,
559 sk_user_ns(NETLINK_CB(cb->skb).ssk), 559 sk_user_ns(NETLINK_CB(cb->skb).ssk),
560 NETLINK_CB(cb->skb).pid, 560 NETLINK_CB(cb->skb).portid,
561 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh); 561 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
562} 562}
563 563
@@ -592,14 +592,14 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw,
592 } 592 }
593 593
594 return inet_twsk_diag_fill(tw, skb, r, 594 return inet_twsk_diag_fill(tw, skb, r,
595 NETLINK_CB(cb->skb).pid, 595 NETLINK_CB(cb->skb).portid,
596 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh); 596 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
597} 597}
598 598
599static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, 599static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
600 struct request_sock *req, 600 struct request_sock *req,
601 struct user_namespace *user_ns, 601 struct user_namespace *user_ns,
602 u32 pid, u32 seq, 602 u32 portid, u32 seq,
603 const struct nlmsghdr *unlh) 603 const struct nlmsghdr *unlh)
604{ 604{
605 const struct inet_request_sock *ireq = inet_rsk(req); 605 const struct inet_request_sock *ireq = inet_rsk(req);
@@ -608,7 +608,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
608 struct nlmsghdr *nlh; 608 struct nlmsghdr *nlh;
609 long tmo; 609 long tmo;
610 610
611 nlh = nlmsg_put(skb, pid, seq, unlh->nlmsg_type, sizeof(*r), 611 nlh = nlmsg_put(skb, portid, seq, unlh->nlmsg_type, sizeof(*r),
612 NLM_F_MULTI); 612 NLM_F_MULTI);
613 if (!nlh) 613 if (!nlh)
614 return -EMSGSIZE; 614 return -EMSGSIZE;
@@ -711,7 +711,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
711 711
712 err = inet_diag_fill_req(skb, sk, req, 712 err = inet_diag_fill_req(skb, sk, req,
713 sk_user_ns(NETLINK_CB(cb->skb).ssk), 713 sk_user_ns(NETLINK_CB(cb->skb).ssk),
714 NETLINK_CB(cb->skb).pid, 714 NETLINK_CB(cb->skb).portid,
715 cb->nlh->nlmsg_seq, cb->nlh); 715 cb->nlh->nlmsg_seq, cb->nlh);
716 if (err < 0) { 716 if (err < 0) {
717 cb->args[3] = j + 1; 717 cb->args[3] = j + 1;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 8aa7a4cf9139..1daa95c2a0ba 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -626,7 +626,7 @@ static void ipmr_destroy_unres(struct mr_table *mrt, struct mfc_cache *c)
626 e->error = -ETIMEDOUT; 626 e->error = -ETIMEDOUT;
627 memset(&e->msg, 0, sizeof(e->msg)); 627 memset(&e->msg, 0, sizeof(e->msg));
628 628
629 rtnl_unicast(skb, net, NETLINK_CB(skb).pid); 629 rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
630 } else { 630 } else {
631 kfree_skb(skb); 631 kfree_skb(skb);
632 } 632 }
@@ -870,7 +870,7 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
870 memset(&e->msg, 0, sizeof(e->msg)); 870 memset(&e->msg, 0, sizeof(e->msg));
871 } 871 }
872 872
873 rtnl_unicast(skb, net, NETLINK_CB(skb).pid); 873 rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
874 } else { 874 } else {
875 ip_mr_forward(net, mrt, skb, c, 0); 875 ip_mr_forward(net, mrt, skb, c, 0);
876 } 876 }
@@ -2117,12 +2117,12 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb,
2117} 2117}
2118 2118
2119static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, 2119static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
2120 u32 pid, u32 seq, struct mfc_cache *c) 2120 u32 portid, u32 seq, struct mfc_cache *c)
2121{ 2121{
2122 struct nlmsghdr *nlh; 2122 struct nlmsghdr *nlh;
2123 struct rtmsg *rtm; 2123 struct rtmsg *rtm;
2124 2124
2125 nlh = nlmsg_put(skb, pid, seq, RTM_NEWROUTE, sizeof(*rtm), NLM_F_MULTI); 2125 nlh = nlmsg_put(skb, portid, seq, RTM_NEWROUTE, sizeof(*rtm), NLM_F_MULTI);
2126 if (nlh == NULL) 2126 if (nlh == NULL)
2127 return -EMSGSIZE; 2127 return -EMSGSIZE;
2128 2128
@@ -2176,7 +2176,7 @@ static int ipmr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
2176 if (e < s_e) 2176 if (e < s_e)
2177 goto next_entry; 2177 goto next_entry;
2178 if (ipmr_fill_mroute(mrt, skb, 2178 if (ipmr_fill_mroute(mrt, skb,
2179 NETLINK_CB(cb->skb).pid, 2179 NETLINK_CB(cb->skb).portid,
2180 cb->nlh->nlmsg_seq, 2180 cb->nlh->nlmsg_seq,
2181 mfc) < 0) 2181 mfc) < 0)
2182 goto done; 2182 goto done;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d39edf16d607..940f4f4cb201 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2136,7 +2136,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
2136EXPORT_SYMBOL_GPL(ip_route_output_flow); 2136EXPORT_SYMBOL_GPL(ip_route_output_flow);
2137 2137
2138static int rt_fill_info(struct net *net, __be32 dst, __be32 src, 2138static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
2139 struct flowi4 *fl4, struct sk_buff *skb, u32 pid, 2139 struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
2140 u32 seq, int event, int nowait, unsigned int flags) 2140 u32 seq, int event, int nowait, unsigned int flags)
2141{ 2141{
2142 struct rtable *rt = skb_rtable(skb); 2142 struct rtable *rt = skb_rtable(skb);
@@ -2146,7 +2146,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
2146 u32 error; 2146 u32 error;
2147 u32 metrics[RTAX_MAX]; 2147 u32 metrics[RTAX_MAX];
2148 2148
2149 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags); 2149 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags);
2150 if (nlh == NULL) 2150 if (nlh == NULL)
2151 return -EMSGSIZE; 2151 return -EMSGSIZE;
2152 2152
@@ -2306,12 +2306,12 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
2306 rt->rt_flags |= RTCF_NOTIFY; 2306 rt->rt_flags |= RTCF_NOTIFY;
2307 2307
2308 err = rt_fill_info(net, dst, src, &fl4, skb, 2308 err = rt_fill_info(net, dst, src, &fl4, skb,
2309 NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, 2309 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
2310 RTM_NEWROUTE, 0, 0); 2310 RTM_NEWROUTE, 0, 0);
2311 if (err <= 0) 2311 if (err <= 0)
2312 goto errout_free; 2312 goto errout_free;
2313 2313
2314 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); 2314 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
2315errout: 2315errout:
2316 return err; 2316 return err;
2317 2317
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 988edb63ee73..4c752a6e0bcd 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -803,7 +803,7 @@ static int tcp_metrics_dump_info(struct sk_buff *skb,
803{ 803{
804 void *hdr; 804 void *hdr;
805 805
806 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 806 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
807 &tcp_metrics_nl_family, NLM_F_MULTI, 807 &tcp_metrics_nl_family, NLM_F_MULTI,
808 TCP_METRICS_CMD_GET); 808 TCP_METRICS_CMD_GET);
809 if (!hdr) 809 if (!hdr)
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index d2f336ea82ca..505b30ad9182 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -26,7 +26,7 @@ static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
26 26
27 return inet_sk_diag_fill(sk, NULL, skb, req, 27 return inet_sk_diag_fill(sk, NULL, skb, req,
28 sk_user_ns(NETLINK_CB(cb->skb).ssk), 28 sk_user_ns(NETLINK_CB(cb->skb).ssk),
29 NETLINK_CB(cb->skb).pid, 29 NETLINK_CB(cb->skb).portid,
30 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh); 30 cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
31} 31}
32 32
@@ -72,14 +72,14 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
72 72
73 err = inet_sk_diag_fill(sk, NULL, rep, req, 73 err = inet_sk_diag_fill(sk, NULL, rep, req,
74 sk_user_ns(NETLINK_CB(in_skb).ssk), 74 sk_user_ns(NETLINK_CB(in_skb).ssk),
75 NETLINK_CB(in_skb).pid, 75 NETLINK_CB(in_skb).portid,
76 nlh->nlmsg_seq, 0, nlh); 76 nlh->nlmsg_seq, 0, nlh);
77 if (err < 0) { 77 if (err < 0) {
78 WARN_ON(err == -EMSGSIZE); 78 WARN_ON(err == -EMSGSIZE);
79 kfree_skb(rep); 79 kfree_skb(rep);
80 goto out; 80 goto out;
81 } 81 }
82 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid, 82 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid,
83 MSG_DONTWAIT); 83 MSG_DONTWAIT);
84 if (err > 0) 84 if (err > 0)
85 err = 0; 85 err = 0;