aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
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')
-rw-r--r--net/bridge/br_fdb.c6
-rw-r--r--net/bridge/br_netlink.c2
-rw-r--r--net/can/gw.c2
-rw-r--r--net/core/fib_rules.c6
-rw-r--r--net/core/neighbour.c8
-rw-r--r--net/core/rtnetlink.c12
-rw-r--r--net/dcb/dcbnl.c18
-rw-r--r--net/decnet/dn_dev.c6
-rw-r--r--net/decnet/dn_route.c10
-rw-r--r--net/decnet/dn_table.c12
-rw-r--r--net/ieee802154/nl-mac.c6
-rw-r--r--net/ieee802154/nl-phy.c6
-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
-rw-r--r--net/ipv6/addrconf.c32
-rw-r--r--net/ipv6/addrlabel.c10
-rw-r--r--net/ipv6/ip6mr.c10
-rw-r--r--net/ipv6/route.c20
-rw-r--r--net/irda/irnetlink.c2
-rw-r--r--net/key/af_key.c32
-rw-r--r--net/l2tp/l2tp_netlink.c24
-rw-r--r--net/netfilter/ipset/ip_set_core.c24
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c6
-rw-r--r--net/netfilter/nf_conntrack_ecache.c2
-rw-r--r--net/netfilter/nf_conntrack_netlink.c78
-rw-r--r--net/netfilter/nfnetlink_acct.c12
-rw-r--r--net/netfilter/nfnetlink_cthelper.c12
-rw-r--r--net/netfilter/nfnetlink_cttimeout.c12
-rw-r--r--net/netfilter/nfnetlink_log.c18
-rw-r--r--net/netfilter/nfnetlink_queue_core.c28
-rw-r--r--net/netlabel/netlabel_cipso_v4.c2
-rw-r--r--net/netlabel/netlabel_mgmt.c4
-rw-r--r--net/netlabel/netlabel_unlabeled.c2
-rw-r--r--net/netlink/af_netlink.c172
-rw-r--r--net/netlink/genetlink.c42
-rw-r--r--net/nfc/netlink.c26
-rw-r--r--net/openvswitch/actions.c4
-rw-r--r--net/openvswitch/datapath.c84
-rw-r--r--net/openvswitch/datapath.h2
-rw-r--r--net/openvswitch/vport.c2
-rw-r--r--net/openvswitch/vport.h6
-rw-r--r--net/packet/diag.c6
-rw-r--r--net/phonet/pn_netlink.c14
-rw-r--r--net/sched/act_api.c52
-rw-r--r--net/sched/cls_api.c14
-rw-r--r--net/sched/sch_api.c44
-rw-r--r--net/tipc/netlink.c2
-rw-r--r--net/unix/diag.c14
-rw-r--r--net/wireless/core.h2
-rw-r--r--net/wireless/mlme.c16
-rw-r--r--net/wireless/nl80211.c110
-rw-r--r--net/xfrm/xfrm_state.c10
-rw-r--r--net/xfrm/xfrm_user.c62
60 files changed, 607 insertions, 607 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 9ce430b4657c..ddf93efc133c 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -467,14 +467,14 @@ static int fdb_to_nud(const struct net_bridge_fdb_entry *fdb)
467 467
468static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br, 468static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,
469 const struct net_bridge_fdb_entry *fdb, 469 const struct net_bridge_fdb_entry *fdb,
470 u32 pid, u32 seq, int type, unsigned int flags) 470 u32 portid, u32 seq, int type, unsigned int flags)
471{ 471{
472 unsigned long now = jiffies; 472 unsigned long now = jiffies;
473 struct nda_cacheinfo ci; 473 struct nda_cacheinfo ci;
474 struct nlmsghdr *nlh; 474 struct nlmsghdr *nlh;
475 struct ndmsg *ndm; 475 struct ndmsg *ndm;
476 476
477 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), flags); 477 nlh = nlmsg_put(skb, portid, seq, type, sizeof(*ndm), flags);
478 if (nlh == NULL) 478 if (nlh == NULL)
479 return -EMSGSIZE; 479 return -EMSGSIZE;
480 480
@@ -555,7 +555,7 @@ int br_fdb_dump(struct sk_buff *skb,
555 goto skip; 555 goto skip;
556 556
557 if (fdb_fill_info(skb, br, f, 557 if (fdb_fill_info(skb, br, f,
558 NETLINK_CB(cb->skb).pid, 558 NETLINK_CB(cb->skb).portid,
559 cb->nlh->nlmsg_seq, 559 cb->nlh->nlmsg_seq,
560 RTM_NEWNEIGH, 560 RTM_NEWNEIGH,
561 NLM_F_MULTI) < 0) 561 NLM_F_MULTI) < 0)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index fe41260fbf38..093f527276a3 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -127,7 +127,7 @@ static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
127 goto skip; 127 goto skip;
128 128
129 if (br_fill_ifinfo(skb, port, 129 if (br_fill_ifinfo(skb, port,
130 NETLINK_CB(cb->skb).pid, 130 NETLINK_CB(cb->skb).portid,
131 cb->nlh->nlmsg_seq, RTM_NEWLINK, 131 cb->nlh->nlmsg_seq, RTM_NEWLINK,
132 NLM_F_MULTI) < 0) 132 NLM_F_MULTI) < 0)
133 break; 133 break;
diff --git a/net/can/gw.c b/net/can/gw.c
index b54d5e695b03..127879c55fb6 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -549,7 +549,7 @@ static int cgw_dump_jobs(struct sk_buff *skb, struct netlink_callback *cb)
549 if (idx < s_idx) 549 if (idx < s_idx)
550 goto cont; 550 goto cont;
551 551
552 if (cgw_put_job(skb, gwj, RTM_NEWROUTE, NETLINK_CB(cb->skb).pid, 552 if (cgw_put_job(skb, gwj, RTM_NEWROUTE, NETLINK_CB(cb->skb).portid,
553 cb->nlh->nlmsg_seq, NLM_F_MULTI) < 0) 553 cb->nlh->nlmsg_seq, NLM_F_MULTI) < 0)
554 break; 554 break;
555cont: 555cont:
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index ab7db83236c9..58a4ba27dfe3 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -402,7 +402,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
402 if (unresolved) 402 if (unresolved)
403 ops->unresolved_rules++; 403 ops->unresolved_rules++;
404 404
405 notify_rule_change(RTM_NEWRULE, rule, ops, nlh, NETLINK_CB(skb).pid); 405 notify_rule_change(RTM_NEWRULE, rule, ops, nlh, NETLINK_CB(skb).portid);
406 flush_route_cache(ops); 406 flush_route_cache(ops);
407 rules_ops_put(ops); 407 rules_ops_put(ops);
408 return 0; 408 return 0;
@@ -500,7 +500,7 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
500 } 500 }
501 501
502 notify_rule_change(RTM_DELRULE, rule, ops, nlh, 502 notify_rule_change(RTM_DELRULE, rule, ops, nlh,
503 NETLINK_CB(skb).pid); 503 NETLINK_CB(skb).portid);
504 if (ops->delete) 504 if (ops->delete)
505 ops->delete(rule); 505 ops->delete(rule);
506 fib_rule_put(rule); 506 fib_rule_put(rule);
@@ -601,7 +601,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
601 if (idx < cb->args[1]) 601 if (idx < cb->args[1])
602 goto skip; 602 goto skip;
603 603
604 if (fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).pid, 604 if (fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
605 cb->nlh->nlmsg_seq, RTM_NEWRULE, 605 cb->nlh->nlmsg_seq, RTM_NEWRULE,
606 NLM_F_MULTI, ops) < 0) 606 NLM_F_MULTI, ops) < 0)
607 break; 607 break;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 117afaf51268..c160adb38e5a 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2102,7 +2102,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
2102 if (tidx < tbl_skip || (family && tbl->family != family)) 2102 if (tidx < tbl_skip || (family && tbl->family != family))
2103 continue; 2103 continue;
2104 2104
2105 if (neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).pid, 2105 if (neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).portid,
2106 cb->nlh->nlmsg_seq, RTM_NEWNEIGHTBL, 2106 cb->nlh->nlmsg_seq, RTM_NEWNEIGHTBL,
2107 NLM_F_MULTI) <= 0) 2107 NLM_F_MULTI) <= 0)
2108 break; 2108 break;
@@ -2115,7 +2115,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
2115 goto next; 2115 goto next;
2116 2116
2117 if (neightbl_fill_param_info(skb, tbl, p, 2117 if (neightbl_fill_param_info(skb, tbl, p,
2118 NETLINK_CB(cb->skb).pid, 2118 NETLINK_CB(cb->skb).portid,
2119 cb->nlh->nlmsg_seq, 2119 cb->nlh->nlmsg_seq,
2120 RTM_NEWNEIGHTBL, 2120 RTM_NEWNEIGHTBL,
2121 NLM_F_MULTI) <= 0) 2121 NLM_F_MULTI) <= 0)
@@ -2244,7 +2244,7 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
2244 continue; 2244 continue;
2245 if (idx < s_idx) 2245 if (idx < s_idx)
2246 goto next; 2246 goto next;
2247 if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid, 2247 if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).portid,
2248 cb->nlh->nlmsg_seq, 2248 cb->nlh->nlmsg_seq,
2249 RTM_NEWNEIGH, 2249 RTM_NEWNEIGH,
2250 NLM_F_MULTI) <= 0) { 2250 NLM_F_MULTI) <= 0) {
@@ -2281,7 +2281,7 @@ static int pneigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
2281 continue; 2281 continue;
2282 if (idx < s_idx) 2282 if (idx < s_idx)
2283 goto next; 2283 goto next;
2284 if (pneigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid, 2284 if (pneigh_fill_info(skb, n, NETLINK_CB(cb->skb).portid,
2285 cb->nlh->nlmsg_seq, 2285 cb->nlh->nlmsg_seq,
2286 RTM_NEWNEIGH, 2286 RTM_NEWNEIGH,
2287 NLM_F_MULTI, tbl) <= 0) { 2287 NLM_F_MULTI, tbl) <= 0) {
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 508c5df4a09c..92575370d9f0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1081,7 +1081,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
1081 if (idx < s_idx) 1081 if (idx < s_idx)
1082 goto cont; 1082 goto cont;
1083 if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK, 1083 if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
1084 NETLINK_CB(cb->skb).pid, 1084 NETLINK_CB(cb->skb).portid,
1085 cb->nlh->nlmsg_seq, 0, 1085 cb->nlh->nlmsg_seq, 0,
1086 NLM_F_MULTI, 1086 NLM_F_MULTI,
1087 ext_filter_mask) <= 0) 1087 ext_filter_mask) <= 0)
@@ -1899,14 +1899,14 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
1899 if (nskb == NULL) 1899 if (nskb == NULL)
1900 return -ENOBUFS; 1900 return -ENOBUFS;
1901 1901
1902 err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid, 1902 err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).portid,
1903 nlh->nlmsg_seq, 0, 0, ext_filter_mask); 1903 nlh->nlmsg_seq, 0, 0, ext_filter_mask);
1904 if (err < 0) { 1904 if (err < 0) {
1905 /* -EMSGSIZE implies BUG in if_nlmsg_size */ 1905 /* -EMSGSIZE implies BUG in if_nlmsg_size */
1906 WARN_ON(err == -EMSGSIZE); 1906 WARN_ON(err == -EMSGSIZE);
1907 kfree_skb(nskb); 1907 kfree_skb(nskb);
1908 } else 1908 } else
1909 err = rtnl_unicast(nskb, net, NETLINK_CB(skb).pid); 1909 err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid);
1910 1910
1911 return err; 1911 return err;
1912} 1912}
@@ -2180,9 +2180,9 @@ static int nlmsg_populate_fdb(struct sk_buff *skb,
2180{ 2180{
2181 struct netdev_hw_addr *ha; 2181 struct netdev_hw_addr *ha;
2182 int err; 2182 int err;
2183 u32 pid, seq; 2183 u32 portid, seq;
2184 2184
2185 pid = NETLINK_CB(cb->skb).pid; 2185 portid = NETLINK_CB(cb->skb).portid;
2186 seq = cb->nlh->nlmsg_seq; 2186 seq = cb->nlh->nlmsg_seq;
2187 2187
2188 list_for_each_entry(ha, &list->list, list) { 2188 list_for_each_entry(ha, &list->list, list) {
@@ -2190,7 +2190,7 @@ static int nlmsg_populate_fdb(struct sk_buff *skb,
2190 goto skip; 2190 goto skip;
2191 2191
2192 err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, 2192 err = nlmsg_populate_fdb_fill(skb, dev, ha->addr,
2193 pid, seq, 0, NTF_SELF); 2193 portid, seq, 0, NTF_SELF);
2194 if (err < 0) 2194 if (err < 0)
2195 return err; 2195 return err;
2196skip: 2196skip:
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 81f2bb62dea3..70989e672304 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1319,7 +1319,7 @@ nla_put_failure:
1319} 1319}
1320 1320
1321static int dcbnl_notify(struct net_device *dev, int event, int cmd, 1321static int dcbnl_notify(struct net_device *dev, int event, int cmd,
1322 u32 seq, u32 pid, int dcbx_ver) 1322 u32 seq, u32 portid, int dcbx_ver)
1323{ 1323{
1324 struct net *net = dev_net(dev); 1324 struct net *net = dev_net(dev);
1325 struct sk_buff *skb; 1325 struct sk_buff *skb;
@@ -1330,7 +1330,7 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd,
1330 if (!ops) 1330 if (!ops)
1331 return -EOPNOTSUPP; 1331 return -EOPNOTSUPP;
1332 1332
1333 skb = dcbnl_newmsg(event, cmd, pid, seq, 0, &nlh); 1333 skb = dcbnl_newmsg(event, cmd, portid, seq, 0, &nlh);
1334 if (!skb) 1334 if (!skb)
1335 return -ENOBUFS; 1335 return -ENOBUFS;
1336 1336
@@ -1353,16 +1353,16 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd,
1353} 1353}
1354 1354
1355int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd, 1355int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
1356 u32 seq, u32 pid) 1356 u32 seq, u32 portid)
1357{ 1357{
1358 return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_IEEE); 1358 return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_IEEE);
1359} 1359}
1360EXPORT_SYMBOL(dcbnl_ieee_notify); 1360EXPORT_SYMBOL(dcbnl_ieee_notify);
1361 1361
1362int dcbnl_cee_notify(struct net_device *dev, int event, int cmd, 1362int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
1363 u32 seq, u32 pid) 1363 u32 seq, u32 portid)
1364{ 1364{
1365 return dcbnl_notify(dev, event, cmd, seq, pid, DCB_CAP_DCBX_VER_CEE); 1365 return dcbnl_notify(dev, event, cmd, seq, portid, DCB_CAP_DCBX_VER_CEE);
1366} 1366}
1367EXPORT_SYMBOL(dcbnl_cee_notify); 1367EXPORT_SYMBOL(dcbnl_cee_notify);
1368 1368
@@ -1656,7 +1656,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
1656 struct net_device *netdev; 1656 struct net_device *netdev;
1657 struct dcbmsg *dcb = nlmsg_data(nlh); 1657 struct dcbmsg *dcb = nlmsg_data(nlh);
1658 struct nlattr *tb[DCB_ATTR_MAX + 1]; 1658 struct nlattr *tb[DCB_ATTR_MAX + 1];
1659 u32 pid = skb ? NETLINK_CB(skb).pid : 0; 1659 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
1660 int ret = -EINVAL; 1660 int ret = -EINVAL;
1661 struct sk_buff *reply_skb; 1661 struct sk_buff *reply_skb;
1662 struct nlmsghdr *reply_nlh = NULL; 1662 struct nlmsghdr *reply_nlh = NULL;
@@ -1690,7 +1690,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
1690 goto out; 1690 goto out;
1691 } 1691 }
1692 1692
1693 reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, pid, nlh->nlmsg_seq, 1693 reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, portid, nlh->nlmsg_seq,
1694 nlh->nlmsg_flags, &reply_nlh); 1694 nlh->nlmsg_flags, &reply_nlh);
1695 if (!reply_skb) { 1695 if (!reply_skb) {
1696 ret = -ENOBUFS; 1696 ret = -ENOBUFS;
@@ -1705,7 +1705,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
1705 1705
1706 nlmsg_end(reply_skb, reply_nlh); 1706 nlmsg_end(reply_skb, reply_nlh);
1707 1707
1708 ret = rtnl_unicast(reply_skb, &init_net, pid); 1708 ret = rtnl_unicast(reply_skb, &init_net, portid);
1709out: 1709out:
1710 dev_put(netdev); 1710 dev_put(netdev);
1711 return ret; 1711 return ret;
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index f3924ab1e019..7b7e561412d3 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -667,12 +667,12 @@ static inline size_t dn_ifaddr_nlmsg_size(void)
667} 667}
668 668
669static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, 669static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa,
670 u32 pid, u32 seq, int event, unsigned int flags) 670 u32 portid, u32 seq, int event, unsigned int flags)
671{ 671{
672 struct ifaddrmsg *ifm; 672 struct ifaddrmsg *ifm;
673 struct nlmsghdr *nlh; 673 struct nlmsghdr *nlh;
674 674
675 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*ifm), flags); 675 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), flags);
676 if (nlh == NULL) 676 if (nlh == NULL)
677 return -EMSGSIZE; 677 return -EMSGSIZE;
678 678
@@ -753,7 +753,7 @@ static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
753 if (dn_idx < skip_naddr) 753 if (dn_idx < skip_naddr)
754 continue; 754 continue;
755 755
756 if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, 756 if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).portid,
757 cb->nlh->nlmsg_seq, RTM_NEWADDR, 757 cb->nlh->nlmsg_seq, RTM_NEWADDR,
758 NLM_F_MULTI) < 0) 758 NLM_F_MULTI) < 0)
759 goto done; 759 goto done;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index c855e8d0738f..b57419cc41a4 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1543,7 +1543,7 @@ static int dn_route_input(struct sk_buff *skb)
1543 return dn_route_input_slow(skb); 1543 return dn_route_input_slow(skb);
1544} 1544}
1545 1545
1546static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, 1546static int dn_rt_fill_info(struct sk_buff *skb, u32 portid, u32 seq,
1547 int event, int nowait, unsigned int flags) 1547 int event, int nowait, unsigned int flags)
1548{ 1548{
1549 struct dn_route *rt = (struct dn_route *)skb_dst(skb); 1549 struct dn_route *rt = (struct dn_route *)skb_dst(skb);
@@ -1551,7 +1551,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
1551 struct nlmsghdr *nlh; 1551 struct nlmsghdr *nlh;
1552 long expires; 1552 long expires;
1553 1553
1554 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags); 1554 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags);
1555 if (!nlh) 1555 if (!nlh)
1556 return -EMSGSIZE; 1556 return -EMSGSIZE;
1557 1557
@@ -1685,7 +1685,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1685 if (rtm->rtm_flags & RTM_F_NOTIFY) 1685 if (rtm->rtm_flags & RTM_F_NOTIFY)
1686 rt->rt_flags |= RTCF_NOTIFY; 1686 rt->rt_flags |= RTCF_NOTIFY;
1687 1687
1688 err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0); 1688 err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).portid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0);
1689 1689
1690 if (err == 0) 1690 if (err == 0)
1691 goto out_free; 1691 goto out_free;
@@ -1694,7 +1694,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1694 goto out_free; 1694 goto out_free;
1695 } 1695 }
1696 1696
1697 return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid); 1697 return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).portid);
1698 1698
1699out_free: 1699out_free:
1700 kfree_skb(skb); 1700 kfree_skb(skb);
@@ -1737,7 +1737,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
1737 if (idx < s_idx) 1737 if (idx < s_idx)
1738 continue; 1738 continue;
1739 skb_dst_set(skb, dst_clone(&rt->dst)); 1739 skb_dst_set(skb, dst_clone(&rt->dst));
1740 if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).pid, 1740 if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).portid,
1741 cb->nlh->nlmsg_seq, RTM_NEWROUTE, 1741 cb->nlh->nlmsg_seq, RTM_NEWROUTE,
1742 1, NLM_F_MULTI) <= 0) { 1742 1, NLM_F_MULTI) <= 0) {
1743 skb_dst_drop(skb); 1743 skb_dst_drop(skb);
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 16c986ab1228..f968c1b58f47 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -291,14 +291,14 @@ static inline size_t dn_fib_nlmsg_size(struct dn_fib_info *fi)
291 return payload; 291 return payload;
292} 292}
293 293
294static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 294static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
295 u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, 295 u32 tb_id, u8 type, u8 scope, void *dst, int dst_len,
296 struct dn_fib_info *fi, unsigned int flags) 296 struct dn_fib_info *fi, unsigned int flags)
297{ 297{
298 struct rtmsg *rtm; 298 struct rtmsg *rtm;
299 struct nlmsghdr *nlh; 299 struct nlmsghdr *nlh;
300 300
301 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags); 301 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*rtm), flags);
302 if (!nlh) 302 if (!nlh)
303 return -EMSGSIZE; 303 return -EMSGSIZE;
304 304
@@ -374,14 +374,14 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id,
374 struct nlmsghdr *nlh, struct netlink_skb_parms *req) 374 struct nlmsghdr *nlh, struct netlink_skb_parms *req)
375{ 375{
376 struct sk_buff *skb; 376 struct sk_buff *skb;
377 u32 pid = req ? req->pid : 0; 377 u32 portid = req ? req->portid : 0;
378 int err = -ENOBUFS; 378 int err = -ENOBUFS;
379 379
380 skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL); 380 skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL);
381 if (skb == NULL) 381 if (skb == NULL)
382 goto errout; 382 goto errout;
383 383
384 err = dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id, 384 err = dn_fib_dump_info(skb, portid, nlh->nlmsg_seq, event, tb_id,
385 f->fn_type, f->fn_scope, &f->fn_key, z, 385 f->fn_type, f->fn_scope, &f->fn_key, z,
386 DN_FIB_INFO(f), 0); 386 DN_FIB_INFO(f), 0);
387 if (err < 0) { 387 if (err < 0) {
@@ -390,7 +390,7 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id,
390 kfree_skb(skb); 390 kfree_skb(skb);
391 goto errout; 391 goto errout;
392 } 392 }
393 rtnl_notify(skb, &init_net, pid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL); 393 rtnl_notify(skb, &init_net, portid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL);
394 return; 394 return;
395errout: 395errout:
396 if (err < 0) 396 if (err < 0)
@@ -411,7 +411,7 @@ static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb,
411 continue; 411 continue;
412 if (f->fn_state & DN_S_ZOMBIE) 412 if (f->fn_state & DN_S_ZOMBIE)
413 continue; 413 continue;
414 if (dn_fib_dump_info(skb, NETLINK_CB(cb->skb).pid, 414 if (dn_fib_dump_info(skb, NETLINK_CB(cb->skb).portid,
415 cb->nlh->nlmsg_seq, 415 cb->nlh->nlmsg_seq,
416 RTM_NEWROUTE, 416 RTM_NEWROUTE,
417 tb->n, 417 tb->n,
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index 1e9917124e75..96bb08abece2 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -246,7 +246,7 @@ nla_put_failure:
246} 246}
247EXPORT_SYMBOL(ieee802154_nl_start_confirm); 247EXPORT_SYMBOL(ieee802154_nl_start_confirm);
248 248
249static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 pid, 249static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 portid,
250 u32 seq, int flags, struct net_device *dev) 250 u32 seq, int flags, struct net_device *dev)
251{ 251{
252 void *hdr; 252 void *hdr;
@@ -534,7 +534,7 @@ static int ieee802154_list_iface(struct sk_buff *skb,
534 if (!msg) 534 if (!msg)
535 goto out_dev; 535 goto out_dev;
536 536
537 rc = ieee802154_nl_fill_iface(msg, info->snd_pid, info->snd_seq, 537 rc = ieee802154_nl_fill_iface(msg, info->snd_portid, info->snd_seq,
538 0, dev); 538 0, dev);
539 if (rc < 0) 539 if (rc < 0)
540 goto out_free; 540 goto out_free;
@@ -565,7 +565,7 @@ static int ieee802154_dump_iface(struct sk_buff *skb,
565 if (idx < s_idx || (dev->type != ARPHRD_IEEE802154)) 565 if (idx < s_idx || (dev->type != ARPHRD_IEEE802154))
566 goto cont; 566 goto cont;
567 567
568 if (ieee802154_nl_fill_iface(skb, NETLINK_CB(cb->skb).pid, 568 if (ieee802154_nl_fill_iface(skb, NETLINK_CB(cb->skb).portid,
569 cb->nlh->nlmsg_seq, NLM_F_MULTI, dev) < 0) 569 cb->nlh->nlmsg_seq, NLM_F_MULTI, dev) < 0)
570 break; 570 break;
571cont: 571cont:
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index d54be34cca94..22b1a7058fd3 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -35,7 +35,7 @@
35 35
36#include "ieee802154.h" 36#include "ieee802154.h"
37 37
38static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 pid, 38static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 portid,
39 u32 seq, int flags, struct wpan_phy *phy) 39 u32 seq, int flags, struct wpan_phy *phy)
40{ 40{
41 void *hdr; 41 void *hdr;
@@ -105,7 +105,7 @@ static int ieee802154_list_phy(struct sk_buff *skb,
105 if (!msg) 105 if (!msg)
106 goto out_dev; 106 goto out_dev;
107 107
108 rc = ieee802154_nl_fill_phy(msg, info->snd_pid, info->snd_seq, 108 rc = ieee802154_nl_fill_phy(msg, info->snd_portid, info->snd_seq,
109 0, phy); 109 0, phy);
110 if (rc < 0) 110 if (rc < 0)
111 goto out_free; 111 goto out_free;
@@ -138,7 +138,7 @@ static int ieee802154_dump_phy_iter(struct wpan_phy *phy, void *_data)
138 return 0; 138 return 0;
139 139
140 rc = ieee802154_nl_fill_phy(data->skb, 140 rc = ieee802154_nl_fill_phy(data->skb,
141 NETLINK_CB(data->cb->skb).pid, 141 NETLINK_CB(data->cb->skb).portid,
142 data->cb->nlh->nlmsg_seq, 142 data->cb->nlh->nlmsg_seq,
143 NLM_F_MULTI, 143 NLM_F_MULTI,
144 phy); 144 phy);
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;
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
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index eb6a63632d3c..0b0171570d17 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -470,10 +470,10 @@ static void ip6addrlbl_putmsg(struct nlmsghdr *nlh,
470static int ip6addrlbl_fill(struct sk_buff *skb, 470static int ip6addrlbl_fill(struct sk_buff *skb,
471 struct ip6addrlbl_entry *p, 471 struct ip6addrlbl_entry *p,
472 u32 lseq, 472 u32 lseq,
473 u32 pid, u32 seq, int event, 473 u32 portid, u32 seq, int event,
474 unsigned int flags) 474 unsigned int flags)
475{ 475{
476 struct nlmsghdr *nlh = nlmsg_put(skb, pid, seq, event, 476 struct nlmsghdr *nlh = nlmsg_put(skb, portid, seq, event,
477 sizeof(struct ifaddrlblmsg), flags); 477 sizeof(struct ifaddrlblmsg), flags);
478 if (!nlh) 478 if (!nlh)
479 return -EMSGSIZE; 479 return -EMSGSIZE;
@@ -503,7 +503,7 @@ static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb)
503 net_eq(ip6addrlbl_net(p), net)) { 503 net_eq(ip6addrlbl_net(p), net)) {
504 if ((err = ip6addrlbl_fill(skb, p, 504 if ((err = ip6addrlbl_fill(skb, p,
505 ip6addrlbl_table.seq, 505 ip6addrlbl_table.seq,
506 NETLINK_CB(cb->skb).pid, 506 NETLINK_CB(cb->skb).portid,
507 cb->nlh->nlmsg_seq, 507 cb->nlh->nlmsg_seq,
508 RTM_NEWADDRLABEL, 508 RTM_NEWADDRLABEL,
509 NLM_F_MULTI)) <= 0) 509 NLM_F_MULTI)) <= 0)
@@ -574,7 +574,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
574 } 574 }
575 575
576 err = ip6addrlbl_fill(skb, p, lseq, 576 err = ip6addrlbl_fill(skb, p, lseq,
577 NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, 577 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
578 RTM_NEWADDRLABEL, 0); 578 RTM_NEWADDRLABEL, 0);
579 579
580 ip6addrlbl_put(p); 580 ip6addrlbl_put(p);
@@ -585,7 +585,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
585 goto out; 585 goto out;
586 } 586 }
587 587
588 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); 588 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
589out: 589out:
590 return err; 590 return err;
591} 591}
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 4532973f0dd4..08ea3f0b6e55 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -838,7 +838,7 @@ static void ip6mr_destroy_unres(struct mr6_table *mrt, struct mfc6_cache *c)
838 nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr)); 838 nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr));
839 skb_trim(skb, nlh->nlmsg_len); 839 skb_trim(skb, nlh->nlmsg_len);
840 ((struct nlmsgerr *)NLMSG_DATA(nlh))->error = -ETIMEDOUT; 840 ((struct nlmsgerr *)NLMSG_DATA(nlh))->error = -ETIMEDOUT;
841 rtnl_unicast(skb, net, NETLINK_CB(skb).pid); 841 rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
842 } else 842 } else
843 kfree_skb(skb); 843 kfree_skb(skb);
844 } 844 }
@@ -1052,7 +1052,7 @@ static void ip6mr_cache_resolve(struct net *net, struct mr6_table *mrt,
1052 skb_trim(skb, nlh->nlmsg_len); 1052 skb_trim(skb, nlh->nlmsg_len);
1053 ((struct nlmsgerr *)NLMSG_DATA(nlh))->error = -EMSGSIZE; 1053 ((struct nlmsgerr *)NLMSG_DATA(nlh))->error = -EMSGSIZE;
1054 } 1054 }
1055 rtnl_unicast(skb, net, NETLINK_CB(skb).pid); 1055 rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
1056 } else 1056 } else
1057 ip6_mr_forward(net, mrt, skb, c); 1057 ip6_mr_forward(net, mrt, skb, c);
1058 } 1058 }
@@ -2202,12 +2202,12 @@ int ip6mr_get_route(struct net *net,
2202} 2202}
2203 2203
2204static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, 2204static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
2205 u32 pid, u32 seq, struct mfc6_cache *c) 2205 u32 portid, u32 seq, struct mfc6_cache *c)
2206{ 2206{
2207 struct nlmsghdr *nlh; 2207 struct nlmsghdr *nlh;
2208 struct rtmsg *rtm; 2208 struct rtmsg *rtm;
2209 2209
2210 nlh = nlmsg_put(skb, pid, seq, RTM_NEWROUTE, sizeof(*rtm), NLM_F_MULTI); 2210 nlh = nlmsg_put(skb, portid, seq, RTM_NEWROUTE, sizeof(*rtm), NLM_F_MULTI);
2211 if (nlh == NULL) 2211 if (nlh == NULL)
2212 return -EMSGSIZE; 2212 return -EMSGSIZE;
2213 2213
@@ -2260,7 +2260,7 @@ static int ip6mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
2260 if (e < s_e) 2260 if (e < s_e)
2261 goto next_entry; 2261 goto next_entry;
2262 if (ip6mr_fill_mroute(mrt, skb, 2262 if (ip6mr_fill_mroute(mrt, skb,
2263 NETLINK_CB(cb->skb).pid, 2263 NETLINK_CB(cb->skb).portid,
2264 cb->nlh->nlmsg_seq, 2264 cb->nlh->nlmsg_seq,
2265 mfc) < 0) 2265 mfc) < 0)
2266 goto done; 2266 goto done;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 339d921cf3b6..a81c6790a648 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1874,7 +1874,7 @@ static struct rt6_info *rt6_add_route_info(struct net *net,
1874 .fc_dst_len = prefixlen, 1874 .fc_dst_len = prefixlen,
1875 .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO | 1875 .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO |
1876 RTF_UP | RTF_PREF(pref), 1876 RTF_UP | RTF_PREF(pref),
1877 .fc_nlinfo.pid = 0, 1877 .fc_nlinfo.portid = 0,
1878 .fc_nlinfo.nlh = NULL, 1878 .fc_nlinfo.nlh = NULL,
1879 .fc_nlinfo.nl_net = net, 1879 .fc_nlinfo.nl_net = net,
1880 }; 1880 };
@@ -1924,7 +1924,7 @@ struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr,
1924 .fc_ifindex = dev->ifindex, 1924 .fc_ifindex = dev->ifindex,
1925 .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT | 1925 .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT |
1926 RTF_UP | RTF_EXPIRES | RTF_PREF(pref), 1926 RTF_UP | RTF_EXPIRES | RTF_PREF(pref),
1927 .fc_nlinfo.pid = 0, 1927 .fc_nlinfo.portid = 0,
1928 .fc_nlinfo.nlh = NULL, 1928 .fc_nlinfo.nlh = NULL,
1929 .fc_nlinfo.nl_net = dev_net(dev), 1929 .fc_nlinfo.nl_net = dev_net(dev),
1930 }; 1930 };
@@ -2285,7 +2285,7 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
2285 if (rtm->rtm_type == RTN_LOCAL) 2285 if (rtm->rtm_type == RTN_LOCAL)
2286 cfg->fc_flags |= RTF_LOCAL; 2286 cfg->fc_flags |= RTF_LOCAL;
2287 2287
2288 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid; 2288 cfg->fc_nlinfo.portid = NETLINK_CB(skb).portid;
2289 cfg->fc_nlinfo.nlh = nlh; 2289 cfg->fc_nlinfo.nlh = nlh;
2290 cfg->fc_nlinfo.nl_net = sock_net(skb->sk); 2290 cfg->fc_nlinfo.nl_net = sock_net(skb->sk);
2291 2291
@@ -2376,7 +2376,7 @@ static inline size_t rt6_nlmsg_size(void)
2376static int rt6_fill_node(struct net *net, 2376static int rt6_fill_node(struct net *net,
2377 struct sk_buff *skb, struct rt6_info *rt, 2377 struct sk_buff *skb, struct rt6_info *rt,
2378 struct in6_addr *dst, struct in6_addr *src, 2378 struct in6_addr *dst, struct in6_addr *src,
2379 int iif, int type, u32 pid, u32 seq, 2379 int iif, int type, u32 portid, u32 seq,
2380 int prefix, int nowait, unsigned int flags) 2380 int prefix, int nowait, unsigned int flags)
2381{ 2381{
2382 struct rtmsg *rtm; 2382 struct rtmsg *rtm;
@@ -2392,7 +2392,7 @@ static int rt6_fill_node(struct net *net,
2392 } 2392 }
2393 } 2393 }
2394 2394
2395 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*rtm), flags); 2395 nlh = nlmsg_put(skb, portid, seq, type, sizeof(*rtm), flags);
2396 if (!nlh) 2396 if (!nlh)
2397 return -EMSGSIZE; 2397 return -EMSGSIZE;
2398 2398
@@ -2537,7 +2537,7 @@ int rt6_dump_route(struct rt6_info *rt, void *p_arg)
2537 2537
2538 return rt6_fill_node(arg->net, 2538 return rt6_fill_node(arg->net,
2539 arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE, 2539 arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE,
2540 NETLINK_CB(arg->cb->skb).pid, arg->cb->nlh->nlmsg_seq, 2540 NETLINK_CB(arg->cb->skb).portid, arg->cb->nlh->nlmsg_seq,
2541 prefix, 0, NLM_F_MULTI); 2541 prefix, 0, NLM_F_MULTI);
2542} 2542}
2543 2543
@@ -2617,14 +2617,14 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2617 skb_dst_set(skb, &rt->dst); 2617 skb_dst_set(skb, &rt->dst);
2618 2618
2619 err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif, 2619 err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif,
2620 RTM_NEWROUTE, NETLINK_CB(in_skb).pid, 2620 RTM_NEWROUTE, NETLINK_CB(in_skb).portid,
2621 nlh->nlmsg_seq, 0, 0, 0); 2621 nlh->nlmsg_seq, 0, 0, 0);
2622 if (err < 0) { 2622 if (err < 0) {
2623 kfree_skb(skb); 2623 kfree_skb(skb);
2624 goto errout; 2624 goto errout;
2625 } 2625 }
2626 2626
2627 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).pid); 2627 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
2628errout: 2628errout:
2629 return err; 2629 return err;
2630} 2630}
@@ -2644,14 +2644,14 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info)
2644 goto errout; 2644 goto errout;
2645 2645
2646 err = rt6_fill_node(net, skb, rt, NULL, NULL, 0, 2646 err = rt6_fill_node(net, skb, rt, NULL, NULL, 0,
2647 event, info->pid, seq, 0, 0, 0); 2647 event, info->portid, seq, 0, 0, 0);
2648 if (err < 0) { 2648 if (err < 0) {
2649 /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */ 2649 /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
2650 WARN_ON(err == -EMSGSIZE); 2650 WARN_ON(err == -EMSGSIZE);
2651 kfree_skb(skb); 2651 kfree_skb(skb);
2652 goto errout; 2652 goto errout;
2653 } 2653 }
2654 rtnl_notify(skb, net, info->pid, RTNLGRP_IPV6_ROUTE, 2654 rtnl_notify(skb, net, info->portid, RTNLGRP_IPV6_ROUTE,
2655 info->nlh, gfp_any()); 2655 info->nlh, gfp_any());
2656 return; 2656 return;
2657errout: 2657errout:
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c
index 6c7c4b92e4f8..c32971269280 100644
--- a/net/irda/irnetlink.c
+++ b/net/irda/irnetlink.c
@@ -100,7 +100,7 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info)
100 goto err_out; 100 goto err_out;
101 } 101 }
102 102
103 hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, 103 hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
104 &irda_nl_family, 0, IRDA_NL_CMD_GET_MODE); 104 &irda_nl_family, 0, IRDA_NL_CMD_GET_MODE);
105 if (hdr == NULL) { 105 if (hdr == NULL) {
106 ret = -EMSGSIZE; 106 ret = -EMSGSIZE;
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);
1491out: 1491out:
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);
1529out: 1529out:
@@ -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);
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index d71cd9229a47..6ec3f67ad3f1 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -78,7 +78,7 @@ static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
78 goto out; 78 goto out;
79 } 79 }
80 80
81 hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, 81 hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
82 &l2tp_nl_family, 0, L2TP_CMD_NOOP); 82 &l2tp_nl_family, 0, L2TP_CMD_NOOP);
83 if (IS_ERR(hdr)) { 83 if (IS_ERR(hdr)) {
84 ret = PTR_ERR(hdr); 84 ret = PTR_ERR(hdr);
@@ -87,7 +87,7 @@ static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
87 87
88 genlmsg_end(msg, hdr); 88 genlmsg_end(msg, hdr);
89 89
90 return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid); 90 return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
91 91
92err_out: 92err_out:
93 nlmsg_free(msg); 93 nlmsg_free(msg);
@@ -235,7 +235,7 @@ out:
235 return ret; 235 return ret;
236} 236}
237 237
238static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 pid, u32 seq, int flags, 238static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int flags,
239 struct l2tp_tunnel *tunnel) 239 struct l2tp_tunnel *tunnel)
240{ 240{
241 void *hdr; 241 void *hdr;
@@ -248,7 +248,7 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 pid, u32 seq, int flags,
248 struct l2tp_stats stats; 248 struct l2tp_stats stats;
249 unsigned int start; 249 unsigned int start;
250 250
251 hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, 251 hdr = genlmsg_put(skb, portid, seq, &l2tp_nl_family, flags,
252 L2TP_CMD_TUNNEL_GET); 252 L2TP_CMD_TUNNEL_GET);
253 if (IS_ERR(hdr)) 253 if (IS_ERR(hdr))
254 return PTR_ERR(hdr); 254 return PTR_ERR(hdr);
@@ -359,12 +359,12 @@ static int l2tp_nl_cmd_tunnel_get(struct sk_buff *skb, struct genl_info *info)
359 goto out; 359 goto out;
360 } 360 }
361 361
362 ret = l2tp_nl_tunnel_send(msg, info->snd_pid, info->snd_seq, 362 ret = l2tp_nl_tunnel_send(msg, info->snd_portid, info->snd_seq,
363 NLM_F_ACK, tunnel); 363 NLM_F_ACK, tunnel);
364 if (ret < 0) 364 if (ret < 0)
365 goto err_out; 365 goto err_out;
366 366
367 return genlmsg_unicast(net, msg, info->snd_pid); 367 return genlmsg_unicast(net, msg, info->snd_portid);
368 368
369err_out: 369err_out:
370 nlmsg_free(msg); 370 nlmsg_free(msg);
@@ -384,7 +384,7 @@ static int l2tp_nl_cmd_tunnel_dump(struct sk_buff *skb, struct netlink_callback
384 if (tunnel == NULL) 384 if (tunnel == NULL)
385 goto out; 385 goto out;
386 386
387 if (l2tp_nl_tunnel_send(skb, NETLINK_CB(cb->skb).pid, 387 if (l2tp_nl_tunnel_send(skb, NETLINK_CB(cb->skb).portid,
388 cb->nlh->nlmsg_seq, NLM_F_MULTI, 388 cb->nlh->nlmsg_seq, NLM_F_MULTI,
389 tunnel) <= 0) 389 tunnel) <= 0)
390 goto out; 390 goto out;
@@ -604,7 +604,7 @@ out:
604 return ret; 604 return ret;
605} 605}
606 606
607static int l2tp_nl_session_send(struct sk_buff *skb, u32 pid, u32 seq, int flags, 607static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int flags,
608 struct l2tp_session *session) 608 struct l2tp_session *session)
609{ 609{
610 void *hdr; 610 void *hdr;
@@ -616,7 +616,7 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 pid, u32 seq, int flags
616 616
617 sk = tunnel->sock; 617 sk = tunnel->sock;
618 618
619 hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, L2TP_CMD_SESSION_GET); 619 hdr = genlmsg_put(skb, portid, seq, &l2tp_nl_family, flags, L2TP_CMD_SESSION_GET);
620 if (IS_ERR(hdr)) 620 if (IS_ERR(hdr))
621 return PTR_ERR(hdr); 621 return PTR_ERR(hdr);
622 622
@@ -705,12 +705,12 @@ static int l2tp_nl_cmd_session_get(struct sk_buff *skb, struct genl_info *info)
705 goto out; 705 goto out;
706 } 706 }
707 707
708 ret = l2tp_nl_session_send(msg, info->snd_pid, info->snd_seq, 708 ret = l2tp_nl_session_send(msg, info->snd_portid, info->snd_seq,
709 0, session); 709 0, session);
710 if (ret < 0) 710 if (ret < 0)
711 goto err_out; 711 goto err_out;
712 712
713 return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid); 713 return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
714 714
715err_out: 715err_out:
716 nlmsg_free(msg); 716 nlmsg_free(msg);
@@ -742,7 +742,7 @@ static int l2tp_nl_cmd_session_dump(struct sk_buff *skb, struct netlink_callback
742 continue; 742 continue;
743 } 743 }
744 744
745 if (l2tp_nl_session_send(skb, NETLINK_CB(cb->skb).pid, 745 if (l2tp_nl_session_send(skb, NETLINK_CB(cb->skb).portid,
746 cb->nlh->nlmsg_seq, NLM_F_MULTI, 746 cb->nlh->nlmsg_seq, NLM_F_MULTI,
747 session) <= 0) 747 session) <= 0)
748 break; 748 break;
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 9730882697aa..ad39ef406851 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -563,13 +563,13 @@ flag_exist(const struct nlmsghdr *nlh)
563} 563}
564 564
565static struct nlmsghdr * 565static struct nlmsghdr *
566start_msg(struct sk_buff *skb, u32 pid, u32 seq, unsigned int flags, 566start_msg(struct sk_buff *skb, u32 portid, u32 seq, unsigned int flags,
567 enum ipset_cmd cmd) 567 enum ipset_cmd cmd)
568{ 568{
569 struct nlmsghdr *nlh; 569 struct nlmsghdr *nlh;
570 struct nfgenmsg *nfmsg; 570 struct nfgenmsg *nfmsg;
571 571
572 nlh = nlmsg_put(skb, pid, seq, cmd | (NFNL_SUBSYS_IPSET << 8), 572 nlh = nlmsg_put(skb, portid, seq, cmd | (NFNL_SUBSYS_IPSET << 8),
573 sizeof(*nfmsg), flags); 573 sizeof(*nfmsg), flags);
574 if (nlh == NULL) 574 if (nlh == NULL)
575 return NULL; 575 return NULL;
@@ -1045,7 +1045,7 @@ ip_set_dump_start(struct sk_buff *skb, struct netlink_callback *cb)
1045 ip_set_id_t index = IPSET_INVALID_ID, max; 1045 ip_set_id_t index = IPSET_INVALID_ID, max;
1046 struct ip_set *set = NULL; 1046 struct ip_set *set = NULL;
1047 struct nlmsghdr *nlh = NULL; 1047 struct nlmsghdr *nlh = NULL;
1048 unsigned int flags = NETLINK_CB(cb->skb).pid ? NLM_F_MULTI : 0; 1048 unsigned int flags = NETLINK_CB(cb->skb).portid ? NLM_F_MULTI : 0;
1049 u32 dump_type, dump_flags; 1049 u32 dump_type, dump_flags;
1050 int ret = 0; 1050 int ret = 0;
1051 1051
@@ -1093,7 +1093,7 @@ dump_last:
1093 pr_debug("reference set\n"); 1093 pr_debug("reference set\n");
1094 __ip_set_get(index); 1094 __ip_set_get(index);
1095 } 1095 }
1096 nlh = start_msg(skb, NETLINK_CB(cb->skb).pid, 1096 nlh = start_msg(skb, NETLINK_CB(cb->skb).portid,
1097 cb->nlh->nlmsg_seq, flags, 1097 cb->nlh->nlmsg_seq, flags,
1098 IPSET_CMD_LIST); 1098 IPSET_CMD_LIST);
1099 if (!nlh) { 1099 if (!nlh) {
@@ -1226,7 +1226,7 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set,
1226 skb2 = nlmsg_new(payload, GFP_KERNEL); 1226 skb2 = nlmsg_new(payload, GFP_KERNEL);
1227 if (skb2 == NULL) 1227 if (skb2 == NULL)
1228 return -ENOMEM; 1228 return -ENOMEM;
1229 rep = __nlmsg_put(skb2, NETLINK_CB(skb).pid, 1229 rep = __nlmsg_put(skb2, NETLINK_CB(skb).portid,
1230 nlh->nlmsg_seq, NLMSG_ERROR, payload, 0); 1230 nlh->nlmsg_seq, NLMSG_ERROR, payload, 0);
1231 errmsg = nlmsg_data(rep); 1231 errmsg = nlmsg_data(rep);
1232 errmsg->error = ret; 1232 errmsg->error = ret;
@@ -1241,7 +1241,7 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set,
1241 1241
1242 *errline = lineno; 1242 *errline = lineno;
1243 1243
1244 netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1244 netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1245 /* Signal netlink not to send its ACK/errmsg. */ 1245 /* Signal netlink not to send its ACK/errmsg. */
1246 return -EINTR; 1246 return -EINTR;
1247 } 1247 }
@@ -1416,7 +1416,7 @@ ip_set_header(struct sock *ctnl, struct sk_buff *skb,
1416 if (skb2 == NULL) 1416 if (skb2 == NULL)
1417 return -ENOMEM; 1417 return -ENOMEM;
1418 1418
1419 nlh2 = start_msg(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 1419 nlh2 = start_msg(skb2, NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
1420 IPSET_CMD_HEADER); 1420 IPSET_CMD_HEADER);
1421 if (!nlh2) 1421 if (!nlh2)
1422 goto nlmsg_failure; 1422 goto nlmsg_failure;
@@ -1428,7 +1428,7 @@ ip_set_header(struct sock *ctnl, struct sk_buff *skb,
1428 goto nla_put_failure; 1428 goto nla_put_failure;
1429 nlmsg_end(skb2, nlh2); 1429 nlmsg_end(skb2, nlh2);
1430 1430
1431 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1431 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1432 if (ret < 0) 1432 if (ret < 0)
1433 return ret; 1433 return ret;
1434 1434
@@ -1476,7 +1476,7 @@ ip_set_type(struct sock *ctnl, struct sk_buff *skb,
1476 if (skb2 == NULL) 1476 if (skb2 == NULL)
1477 return -ENOMEM; 1477 return -ENOMEM;
1478 1478
1479 nlh2 = start_msg(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 1479 nlh2 = start_msg(skb2, NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
1480 IPSET_CMD_TYPE); 1480 IPSET_CMD_TYPE);
1481 if (!nlh2) 1481 if (!nlh2)
1482 goto nlmsg_failure; 1482 goto nlmsg_failure;
@@ -1489,7 +1489,7 @@ ip_set_type(struct sock *ctnl, struct sk_buff *skb,
1489 nlmsg_end(skb2, nlh2); 1489 nlmsg_end(skb2, nlh2);
1490 1490
1491 pr_debug("Send TYPE, nlmsg_len: %u\n", nlh2->nlmsg_len); 1491 pr_debug("Send TYPE, nlmsg_len: %u\n", nlh2->nlmsg_len);
1492 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1492 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1493 if (ret < 0) 1493 if (ret < 0)
1494 return ret; 1494 return ret;
1495 1495
@@ -1525,7 +1525,7 @@ ip_set_protocol(struct sock *ctnl, struct sk_buff *skb,
1525 if (skb2 == NULL) 1525 if (skb2 == NULL)
1526 return -ENOMEM; 1526 return -ENOMEM;
1527 1527
1528 nlh2 = start_msg(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 1528 nlh2 = start_msg(skb2, NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
1529 IPSET_CMD_PROTOCOL); 1529 IPSET_CMD_PROTOCOL);
1530 if (!nlh2) 1530 if (!nlh2)
1531 goto nlmsg_failure; 1531 goto nlmsg_failure;
@@ -1533,7 +1533,7 @@ ip_set_protocol(struct sock *ctnl, struct sk_buff *skb,
1533 goto nla_put_failure; 1533 goto nla_put_failure;
1534 nlmsg_end(skb2, nlh2); 1534 nlmsg_end(skb2, nlh2);
1535 1535
1536 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1536 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1537 if (ret < 0) 1537 if (ret < 0)
1538 return ret; 1538 return ret;
1539 1539
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 767cc12da0fe..0f924bf19c2b 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2939,7 +2939,7 @@ static int ip_vs_genl_dump_service(struct sk_buff *skb,
2939{ 2939{
2940 void *hdr; 2940 void *hdr;
2941 2941
2942 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 2942 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
2943 &ip_vs_genl_family, NLM_F_MULTI, 2943 &ip_vs_genl_family, NLM_F_MULTI,
2944 IPVS_CMD_NEW_SERVICE); 2944 IPVS_CMD_NEW_SERVICE);
2945 if (!hdr) 2945 if (!hdr)
@@ -3128,7 +3128,7 @@ static int ip_vs_genl_dump_dest(struct sk_buff *skb, struct ip_vs_dest *dest,
3128{ 3128{
3129 void *hdr; 3129 void *hdr;
3130 3130
3131 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 3131 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
3132 &ip_vs_genl_family, NLM_F_MULTI, 3132 &ip_vs_genl_family, NLM_F_MULTI,
3133 IPVS_CMD_NEW_DEST); 3133 IPVS_CMD_NEW_DEST);
3134 if (!hdr) 3134 if (!hdr)
@@ -3257,7 +3257,7 @@ static int ip_vs_genl_dump_daemon(struct sk_buff *skb, __be32 state,
3257 struct netlink_callback *cb) 3257 struct netlink_callback *cb)
3258{ 3258{
3259 void *hdr; 3259 void *hdr;
3260 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 3260 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
3261 &ip_vs_genl_family, NLM_F_MULTI, 3261 &ip_vs_genl_family, NLM_F_MULTI,
3262 IPVS_CMD_NEW_DAEMON); 3262 IPVS_CMD_NEW_DAEMON);
3263 if (!hdr) 3263 if (!hdr)
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c
index e7be79e640de..de9781b6464f 100644
--- a/net/netfilter/nf_conntrack_ecache.c
+++ b/net/netfilter/nf_conntrack_ecache.c
@@ -61,7 +61,7 @@ void nf_ct_deliver_cached_events(struct nf_conn *ct)
61 goto out_unlock; 61 goto out_unlock;
62 62
63 item.ct = ct; 63 item.ct = ct;
64 item.pid = 0; 64 item.portid = 0;
65 item.report = 0; 65 item.report = 0;
66 66
67 ret = notify->fcn(events | missed, &item); 67 ret = notify->fcn(events | missed, &item);
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index a205bd6ce294..59770039b825 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -418,16 +418,16 @@ nla_put_failure:
418} 418}
419 419
420static int 420static int
421ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq, u32 type, 421ctnetlink_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
422 struct nf_conn *ct) 422 struct nf_conn *ct)
423{ 423{
424 struct nlmsghdr *nlh; 424 struct nlmsghdr *nlh;
425 struct nfgenmsg *nfmsg; 425 struct nfgenmsg *nfmsg;
426 struct nlattr *nest_parms; 426 struct nlattr *nest_parms;
427 unsigned int flags = pid ? NLM_F_MULTI : 0, event; 427 unsigned int flags = portid ? NLM_F_MULTI : 0, event;
428 428
429 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW); 429 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW);
430 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 430 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
431 if (nlh == NULL) 431 if (nlh == NULL)
432 goto nlmsg_failure; 432 goto nlmsg_failure;
433 433
@@ -604,7 +604,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
604 goto errout; 604 goto errout;
605 605
606 type |= NFNL_SUBSYS_CTNETLINK << 8; 606 type |= NFNL_SUBSYS_CTNETLINK << 8;
607 nlh = nlmsg_put(skb, item->pid, 0, type, sizeof(*nfmsg), flags); 607 nlh = nlmsg_put(skb, item->portid, 0, type, sizeof(*nfmsg), flags);
608 if (nlh == NULL) 608 if (nlh == NULL)
609 goto nlmsg_failure; 609 goto nlmsg_failure;
610 610
@@ -680,7 +680,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
680 rcu_read_unlock(); 680 rcu_read_unlock();
681 681
682 nlmsg_end(skb, nlh); 682 nlmsg_end(skb, nlh);
683 err = nfnetlink_send(skb, net, item->pid, group, item->report, 683 err = nfnetlink_send(skb, net, item->portid, group, item->report,
684 GFP_ATOMIC); 684 GFP_ATOMIC);
685 if (err == -ENOBUFS || err == -EAGAIN) 685 if (err == -ENOBUFS || err == -EAGAIN)
686 return -ENOBUFS; 686 return -ENOBUFS;
@@ -757,7 +757,7 @@ restart:
757#endif 757#endif
758 rcu_read_lock(); 758 rcu_read_lock();
759 res = 759 res =
760 ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid, 760 ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).portid,
761 cb->nlh->nlmsg_seq, 761 cb->nlh->nlmsg_seq,
762 NFNL_MSG_TYPE(cb->nlh->nlmsg_type), 762 NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
763 ct); 763 ct);
@@ -961,7 +961,7 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
961 else { 961 else {
962 /* Flush the whole table */ 962 /* Flush the whole table */
963 nf_conntrack_flush_report(net, 963 nf_conntrack_flush_report(net,
964 NETLINK_CB(skb).pid, 964 NETLINK_CB(skb).portid,
965 nlmsg_report(nlh)); 965 nlmsg_report(nlh));
966 return 0; 966 return 0;
967 } 967 }
@@ -985,7 +985,7 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
985 985
986 if (del_timer(&ct->timeout)) { 986 if (del_timer(&ct->timeout)) {
987 if (nf_conntrack_event_report(IPCT_DESTROY, ct, 987 if (nf_conntrack_event_report(IPCT_DESTROY, ct,
988 NETLINK_CB(skb).pid, 988 NETLINK_CB(skb).portid,
989 nlmsg_report(nlh)) < 0) { 989 nlmsg_report(nlh)) < 0) {
990 nf_ct_delete_from_lists(ct); 990 nf_ct_delete_from_lists(ct);
991 /* we failed to report the event, try later */ 991 /* we failed to report the event, try later */
@@ -1069,14 +1069,14 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
1069 } 1069 }
1070 1070
1071 rcu_read_lock(); 1071 rcu_read_lock();
1072 err = ctnetlink_fill_info(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, 1072 err = ctnetlink_fill_info(skb2, NETLINK_CB(skb).portid, nlh->nlmsg_seq,
1073 NFNL_MSG_TYPE(nlh->nlmsg_type), ct); 1073 NFNL_MSG_TYPE(nlh->nlmsg_type), ct);
1074 rcu_read_unlock(); 1074 rcu_read_unlock();
1075 nf_ct_put(ct); 1075 nf_ct_put(ct);
1076 if (err <= 0) 1076 if (err <= 0)
1077 goto free; 1077 goto free;
1078 1078
1079 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1079 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1080 if (err < 0) 1080 if (err < 0)
1081 goto out; 1081 goto out;
1082 1082
@@ -1616,7 +1616,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
1616 (1 << IPCT_PROTOINFO) | 1616 (1 << IPCT_PROTOINFO) |
1617 (1 << IPCT_NATSEQADJ) | 1617 (1 << IPCT_NATSEQADJ) |
1618 (1 << IPCT_MARK) | events, 1618 (1 << IPCT_MARK) | events,
1619 ct, NETLINK_CB(skb).pid, 1619 ct, NETLINK_CB(skb).portid,
1620 nlmsg_report(nlh)); 1620 nlmsg_report(nlh));
1621 nf_ct_put(ct); 1621 nf_ct_put(ct);
1622 } 1622 }
@@ -1638,7 +1638,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
1638 (1 << IPCT_PROTOINFO) | 1638 (1 << IPCT_PROTOINFO) |
1639 (1 << IPCT_NATSEQADJ) | 1639 (1 << IPCT_NATSEQADJ) |
1640 (1 << IPCT_MARK), 1640 (1 << IPCT_MARK),
1641 ct, NETLINK_CB(skb).pid, 1641 ct, NETLINK_CB(skb).portid,
1642 nlmsg_report(nlh)); 1642 nlmsg_report(nlh));
1643 } 1643 }
1644 } 1644 }
@@ -1648,15 +1648,15 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
1648} 1648}
1649 1649
1650static int 1650static int
1651ctnetlink_ct_stat_cpu_fill_info(struct sk_buff *skb, u32 pid, u32 seq, 1651ctnetlink_ct_stat_cpu_fill_info(struct sk_buff *skb, u32 portid, u32 seq,
1652 __u16 cpu, const struct ip_conntrack_stat *st) 1652 __u16 cpu, const struct ip_conntrack_stat *st)
1653{ 1653{
1654 struct nlmsghdr *nlh; 1654 struct nlmsghdr *nlh;
1655 struct nfgenmsg *nfmsg; 1655 struct nfgenmsg *nfmsg;
1656 unsigned int flags = pid ? NLM_F_MULTI : 0, event; 1656 unsigned int flags = portid ? NLM_F_MULTI : 0, event;
1657 1657
1658 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET_STATS_CPU); 1658 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET_STATS_CPU);
1659 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 1659 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
1660 if (nlh == NULL) 1660 if (nlh == NULL)
1661 goto nlmsg_failure; 1661 goto nlmsg_failure;
1662 1662
@@ -1708,7 +1708,7 @@ ctnetlink_ct_stat_cpu_dump(struct sk_buff *skb, struct netlink_callback *cb)
1708 1708
1709 st = per_cpu_ptr(net->ct.stat, cpu); 1709 st = per_cpu_ptr(net->ct.stat, cpu);
1710 if (ctnetlink_ct_stat_cpu_fill_info(skb, 1710 if (ctnetlink_ct_stat_cpu_fill_info(skb,
1711 NETLINK_CB(cb->skb).pid, 1711 NETLINK_CB(cb->skb).portid,
1712 cb->nlh->nlmsg_seq, 1712 cb->nlh->nlmsg_seq,
1713 cpu, st) < 0) 1713 cpu, st) < 0)
1714 break; 1714 break;
@@ -1734,16 +1734,16 @@ ctnetlink_stat_ct_cpu(struct sock *ctnl, struct sk_buff *skb,
1734} 1734}
1735 1735
1736static int 1736static int
1737ctnetlink_stat_ct_fill_info(struct sk_buff *skb, u32 pid, u32 seq, u32 type, 1737ctnetlink_stat_ct_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
1738 struct net *net) 1738 struct net *net)
1739{ 1739{
1740 struct nlmsghdr *nlh; 1740 struct nlmsghdr *nlh;
1741 struct nfgenmsg *nfmsg; 1741 struct nfgenmsg *nfmsg;
1742 unsigned int flags = pid ? NLM_F_MULTI : 0, event; 1742 unsigned int flags = portid ? NLM_F_MULTI : 0, event;
1743 unsigned int nr_conntracks = atomic_read(&net->ct.count); 1743 unsigned int nr_conntracks = atomic_read(&net->ct.count);
1744 1744
1745 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET_STATS); 1745 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET_STATS);
1746 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 1746 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
1747 if (nlh == NULL) 1747 if (nlh == NULL)
1748 goto nlmsg_failure; 1748 goto nlmsg_failure;
1749 1749
@@ -1776,14 +1776,14 @@ ctnetlink_stat_ct(struct sock *ctnl, struct sk_buff *skb,
1776 if (skb2 == NULL) 1776 if (skb2 == NULL)
1777 return -ENOMEM; 1777 return -ENOMEM;
1778 1778
1779 err = ctnetlink_stat_ct_fill_info(skb2, NETLINK_CB(skb).pid, 1779 err = ctnetlink_stat_ct_fill_info(skb2, NETLINK_CB(skb).portid,
1780 nlh->nlmsg_seq, 1780 nlh->nlmsg_seq,
1781 NFNL_MSG_TYPE(nlh->nlmsg_type), 1781 NFNL_MSG_TYPE(nlh->nlmsg_type),
1782 sock_net(skb->sk)); 1782 sock_net(skb->sk));
1783 if (err <= 0) 1783 if (err <= 0)
1784 goto free; 1784 goto free;
1785 1785
1786 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 1786 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
1787 if (err < 0) 1787 if (err < 0)
1788 goto out; 1788 goto out;
1789 1789
@@ -2073,15 +2073,15 @@ nla_put_failure:
2073} 2073}
2074 2074
2075static int 2075static int
2076ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq, 2076ctnetlink_exp_fill_info(struct sk_buff *skb, u32 portid, u32 seq,
2077 int event, const struct nf_conntrack_expect *exp) 2077 int event, const struct nf_conntrack_expect *exp)
2078{ 2078{
2079 struct nlmsghdr *nlh; 2079 struct nlmsghdr *nlh;
2080 struct nfgenmsg *nfmsg; 2080 struct nfgenmsg *nfmsg;
2081 unsigned int flags = pid ? NLM_F_MULTI : 0; 2081 unsigned int flags = portid ? NLM_F_MULTI : 0;
2082 2082
2083 event |= NFNL_SUBSYS_CTNETLINK_EXP << 8; 2083 event |= NFNL_SUBSYS_CTNETLINK_EXP << 8;
2084 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 2084 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
2085 if (nlh == NULL) 2085 if (nlh == NULL)
2086 goto nlmsg_failure; 2086 goto nlmsg_failure;
2087 2087
@@ -2132,7 +2132,7 @@ ctnetlink_expect_event(unsigned int events, struct nf_exp_event *item)
2132 goto errout; 2132 goto errout;
2133 2133
2134 type |= NFNL_SUBSYS_CTNETLINK_EXP << 8; 2134 type |= NFNL_SUBSYS_CTNETLINK_EXP << 8;
2135 nlh = nlmsg_put(skb, item->pid, 0, type, sizeof(*nfmsg), flags); 2135 nlh = nlmsg_put(skb, item->portid, 0, type, sizeof(*nfmsg), flags);
2136 if (nlh == NULL) 2136 if (nlh == NULL)
2137 goto nlmsg_failure; 2137 goto nlmsg_failure;
2138 2138
@@ -2147,7 +2147,7 @@ ctnetlink_expect_event(unsigned int events, struct nf_exp_event *item)
2147 rcu_read_unlock(); 2147 rcu_read_unlock();
2148 2148
2149 nlmsg_end(skb, nlh); 2149 nlmsg_end(skb, nlh);
2150 nfnetlink_send(skb, net, item->pid, group, item->report, GFP_ATOMIC); 2150 nfnetlink_send(skb, net, item->portid, group, item->report, GFP_ATOMIC);
2151 return 0; 2151 return 0;
2152 2152
2153nla_put_failure: 2153nla_put_failure:
@@ -2190,7 +2190,7 @@ restart:
2190 cb->args[1] = 0; 2190 cb->args[1] = 0;
2191 } 2191 }
2192 if (ctnetlink_exp_fill_info(skb, 2192 if (ctnetlink_exp_fill_info(skb,
2193 NETLINK_CB(cb->skb).pid, 2193 NETLINK_CB(cb->skb).portid,
2194 cb->nlh->nlmsg_seq, 2194 cb->nlh->nlmsg_seq,
2195 IPCTNL_MSG_EXP_NEW, 2195 IPCTNL_MSG_EXP_NEW,
2196 exp) < 0) { 2196 exp) < 0) {
@@ -2283,14 +2283,14 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
2283 } 2283 }
2284 2284
2285 rcu_read_lock(); 2285 rcu_read_lock();
2286 err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).pid, 2286 err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).portid,
2287 nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, exp); 2287 nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, exp);
2288 rcu_read_unlock(); 2288 rcu_read_unlock();
2289 nf_ct_expect_put(exp); 2289 nf_ct_expect_put(exp);
2290 if (err <= 0) 2290 if (err <= 0)
2291 goto free; 2291 goto free;
2292 2292
2293 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); 2293 err = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid, MSG_DONTWAIT);
2294 if (err < 0) 2294 if (err < 0)
2295 goto out; 2295 goto out;
2296 2296
@@ -2344,7 +2344,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
2344 /* after list removal, usage count == 1 */ 2344 /* after list removal, usage count == 1 */
2345 spin_lock_bh(&nf_conntrack_lock); 2345 spin_lock_bh(&nf_conntrack_lock);
2346 if (del_timer(&exp->timeout)) { 2346 if (del_timer(&exp->timeout)) {
2347 nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).pid, 2347 nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).portid,
2348 nlmsg_report(nlh)); 2348 nlmsg_report(nlh));
2349 nf_ct_expect_put(exp); 2349 nf_ct_expect_put(exp);
2350 } 2350 }
@@ -2366,7 +2366,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
2366 if (!strcmp(m_help->helper->name, name) && 2366 if (!strcmp(m_help->helper->name, name) &&
2367 del_timer(&exp->timeout)) { 2367 del_timer(&exp->timeout)) {
2368 nf_ct_unlink_expect_report(exp, 2368 nf_ct_unlink_expect_report(exp,
2369 NETLINK_CB(skb).pid, 2369 NETLINK_CB(skb).portid,
2370 nlmsg_report(nlh)); 2370 nlmsg_report(nlh));
2371 nf_ct_expect_put(exp); 2371 nf_ct_expect_put(exp);
2372 } 2372 }
@@ -2382,7 +2382,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
2382 hnode) { 2382 hnode) {
2383 if (del_timer(&exp->timeout)) { 2383 if (del_timer(&exp->timeout)) {
2384 nf_ct_unlink_expect_report(exp, 2384 nf_ct_unlink_expect_report(exp,
2385 NETLINK_CB(skb).pid, 2385 NETLINK_CB(skb).portid,
2386 nlmsg_report(nlh)); 2386 nlmsg_report(nlh));
2387 nf_ct_expect_put(exp); 2387 nf_ct_expect_put(exp);
2388 } 2388 }
@@ -2447,7 +2447,7 @@ static int
2447ctnetlink_create_expect(struct net *net, u16 zone, 2447ctnetlink_create_expect(struct net *net, u16 zone,
2448 const struct nlattr * const cda[], 2448 const struct nlattr * const cda[],
2449 u_int8_t u3, 2449 u_int8_t u3,
2450 u32 pid, int report) 2450 u32 portid, int report)
2451{ 2451{
2452 struct nf_conntrack_tuple tuple, mask, master_tuple; 2452 struct nf_conntrack_tuple tuple, mask, master_tuple;
2453 struct nf_conntrack_tuple_hash *h = NULL; 2453 struct nf_conntrack_tuple_hash *h = NULL;
@@ -2560,7 +2560,7 @@ ctnetlink_create_expect(struct net *net, u16 zone,
2560 if (err < 0) 2560 if (err < 0)
2561 goto err_out; 2561 goto err_out;
2562 } 2562 }
2563 err = nf_ct_expect_related_report(exp, pid, report); 2563 err = nf_ct_expect_related_report(exp, portid, report);
2564err_out: 2564err_out:
2565 nf_ct_expect_put(exp); 2565 nf_ct_expect_put(exp);
2566out: 2566out:
@@ -2603,7 +2603,7 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
2603 if (nlh->nlmsg_flags & NLM_F_CREATE) { 2603 if (nlh->nlmsg_flags & NLM_F_CREATE) {
2604 err = ctnetlink_create_expect(net, zone, cda, 2604 err = ctnetlink_create_expect(net, zone, cda,
2605 u3, 2605 u3,
2606 NETLINK_CB(skb).pid, 2606 NETLINK_CB(skb).portid,
2607 nlmsg_report(nlh)); 2607 nlmsg_report(nlh));
2608 } 2608 }
2609 return err; 2609 return err;
@@ -2618,15 +2618,15 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
2618} 2618}
2619 2619
2620static int 2620static int
2621ctnetlink_exp_stat_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int cpu, 2621ctnetlink_exp_stat_fill_info(struct sk_buff *skb, u32 portid, u32 seq, int cpu,
2622 const struct ip_conntrack_stat *st) 2622 const struct ip_conntrack_stat *st)
2623{ 2623{
2624 struct nlmsghdr *nlh; 2624 struct nlmsghdr *nlh;
2625 struct nfgenmsg *nfmsg; 2625 struct nfgenmsg *nfmsg;
2626 unsigned int flags = pid ? NLM_F_MULTI : 0, event; 2626 unsigned int flags = portid ? NLM_F_MULTI : 0, event;
2627 2627
2628 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_EXP_GET_STATS_CPU); 2628 event = (NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_EXP_GET_STATS_CPU);
2629 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 2629 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
2630 if (nlh == NULL) 2630 if (nlh == NULL)
2631 goto nlmsg_failure; 2631 goto nlmsg_failure;
2632 2632
@@ -2665,7 +2665,7 @@ ctnetlink_exp_stat_cpu_dump(struct sk_buff *skb, struct netlink_callback *cb)
2665 continue; 2665 continue;
2666 2666
2667 st = per_cpu_ptr(net->ct.stat, cpu); 2667 st = per_cpu_ptr(net->ct.stat, cpu);
2668 if (ctnetlink_exp_stat_fill_info(skb, NETLINK_CB(cb->skb).pid, 2668 if (ctnetlink_exp_stat_fill_info(skb, NETLINK_CB(cb->skb).portid,
2669 cb->nlh->nlmsg_seq, 2669 cb->nlh->nlmsg_seq,
2670 cpu, st) < 0) 2670 cpu, st) < 0)
2671 break; 2671 break;
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index d7ec92879071..589d686f0b4c 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -91,16 +91,16 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
91} 91}
92 92
93static int 93static int
94nfnl_acct_fill_info(struct sk_buff *skb, u32 pid, u32 seq, u32 type, 94nfnl_acct_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
95 int event, struct nf_acct *acct) 95 int event, struct nf_acct *acct)
96{ 96{
97 struct nlmsghdr *nlh; 97 struct nlmsghdr *nlh;
98 struct nfgenmsg *nfmsg; 98 struct nfgenmsg *nfmsg;
99 unsigned int flags = pid ? NLM_F_MULTI : 0; 99 unsigned int flags = portid ? NLM_F_MULTI : 0;
100 u64 pkts, bytes; 100 u64 pkts, bytes;
101 101
102 event |= NFNL_SUBSYS_ACCT << 8; 102 event |= NFNL_SUBSYS_ACCT << 8;
103 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 103 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
104 if (nlh == NULL) 104 if (nlh == NULL)
105 goto nlmsg_failure; 105 goto nlmsg_failure;
106 106
@@ -150,7 +150,7 @@ nfnl_acct_dump(struct sk_buff *skb, struct netlink_callback *cb)
150 if (last && cur != last) 150 if (last && cur != last)
151 continue; 151 continue;
152 152
153 if (nfnl_acct_fill_info(skb, NETLINK_CB(cb->skb).pid, 153 if (nfnl_acct_fill_info(skb, NETLINK_CB(cb->skb).portid,
154 cb->nlh->nlmsg_seq, 154 cb->nlh->nlmsg_seq,
155 NFNL_MSG_TYPE(cb->nlh->nlmsg_type), 155 NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
156 NFNL_MSG_ACCT_NEW, cur) < 0) { 156 NFNL_MSG_ACCT_NEW, cur) < 0) {
@@ -195,7 +195,7 @@ nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb,
195 break; 195 break;
196 } 196 }
197 197
198 ret = nfnl_acct_fill_info(skb2, NETLINK_CB(skb).pid, 198 ret = nfnl_acct_fill_info(skb2, NETLINK_CB(skb).portid,
199 nlh->nlmsg_seq, 199 nlh->nlmsg_seq,
200 NFNL_MSG_TYPE(nlh->nlmsg_type), 200 NFNL_MSG_TYPE(nlh->nlmsg_type),
201 NFNL_MSG_ACCT_NEW, cur); 201 NFNL_MSG_ACCT_NEW, cur);
@@ -203,7 +203,7 @@ nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb,
203 kfree_skb(skb2); 203 kfree_skb(skb2);
204 break; 204 break;
205 } 205 }
206 ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).pid, 206 ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).portid,
207 MSG_DONTWAIT); 207 MSG_DONTWAIT);
208 if (ret > 0) 208 if (ret > 0)
209 ret = 0; 209 ret = 0;
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 32a1ba3f3e27..3678073360a3 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -395,16 +395,16 @@ nla_put_failure:
395} 395}
396 396
397static int 397static int
398nfnl_cthelper_fill_info(struct sk_buff *skb, u32 pid, u32 seq, u32 type, 398nfnl_cthelper_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
399 int event, struct nf_conntrack_helper *helper) 399 int event, struct nf_conntrack_helper *helper)
400{ 400{
401 struct nlmsghdr *nlh; 401 struct nlmsghdr *nlh;
402 struct nfgenmsg *nfmsg; 402 struct nfgenmsg *nfmsg;
403 unsigned int flags = pid ? NLM_F_MULTI : 0; 403 unsigned int flags = portid ? NLM_F_MULTI : 0;
404 int status; 404 int status;
405 405
406 event |= NFNL_SUBSYS_CTHELPER << 8; 406 event |= NFNL_SUBSYS_CTHELPER << 8;
407 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 407 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
408 if (nlh == NULL) 408 if (nlh == NULL)
409 goto nlmsg_failure; 409 goto nlmsg_failure;
410 410
@@ -468,7 +468,7 @@ restart:
468 cb->args[1] = 0; 468 cb->args[1] = 0;
469 } 469 }
470 if (nfnl_cthelper_fill_info(skb, 470 if (nfnl_cthelper_fill_info(skb,
471 NETLINK_CB(cb->skb).pid, 471 NETLINK_CB(cb->skb).portid,
472 cb->nlh->nlmsg_seq, 472 cb->nlh->nlmsg_seq,
473 NFNL_MSG_TYPE(cb->nlh->nlmsg_type), 473 NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
474 NFNL_MSG_CTHELPER_NEW, cur) < 0) { 474 NFNL_MSG_CTHELPER_NEW, cur) < 0) {
@@ -538,7 +538,7 @@ nfnl_cthelper_get(struct sock *nfnl, struct sk_buff *skb,
538 break; 538 break;
539 } 539 }
540 540
541 ret = nfnl_cthelper_fill_info(skb2, NETLINK_CB(skb).pid, 541 ret = nfnl_cthelper_fill_info(skb2, NETLINK_CB(skb).portid,
542 nlh->nlmsg_seq, 542 nlh->nlmsg_seq,
543 NFNL_MSG_TYPE(nlh->nlmsg_type), 543 NFNL_MSG_TYPE(nlh->nlmsg_type),
544 NFNL_MSG_CTHELPER_NEW, cur); 544 NFNL_MSG_CTHELPER_NEW, cur);
@@ -547,7 +547,7 @@ nfnl_cthelper_get(struct sock *nfnl, struct sk_buff *skb,
547 break; 547 break;
548 } 548 }
549 549
550 ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).pid, 550 ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).portid,
551 MSG_DONTWAIT); 551 MSG_DONTWAIT);
552 if (ret > 0) 552 if (ret > 0)
553 ret = 0; 553 ret = 0;
diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index cdecbc8fe965..8847b4d8be06 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -155,16 +155,16 @@ err_proto_put:
155} 155}
156 156
157static int 157static int
158ctnl_timeout_fill_info(struct sk_buff *skb, u32 pid, u32 seq, u32 type, 158ctnl_timeout_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type,
159 int event, struct ctnl_timeout *timeout) 159 int event, struct ctnl_timeout *timeout)
160{ 160{
161 struct nlmsghdr *nlh; 161 struct nlmsghdr *nlh;
162 struct nfgenmsg *nfmsg; 162 struct nfgenmsg *nfmsg;
163 unsigned int flags = pid ? NLM_F_MULTI : 0; 163 unsigned int flags = portid ? NLM_F_MULTI : 0;
164 struct nf_conntrack_l4proto *l4proto = timeout->l4proto; 164 struct nf_conntrack_l4proto *l4proto = timeout->l4proto;
165 165
166 event |= NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8; 166 event |= NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8;
167 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); 167 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*nfmsg), flags);
168 if (nlh == NULL) 168 if (nlh == NULL)
169 goto nlmsg_failure; 169 goto nlmsg_failure;
170 170
@@ -222,7 +222,7 @@ ctnl_timeout_dump(struct sk_buff *skb, struct netlink_callback *cb)
222 if (last && cur != last) 222 if (last && cur != last)
223 continue; 223 continue;
224 224
225 if (ctnl_timeout_fill_info(skb, NETLINK_CB(cb->skb).pid, 225 if (ctnl_timeout_fill_info(skb, NETLINK_CB(cb->skb).portid,
226 cb->nlh->nlmsg_seq, 226 cb->nlh->nlmsg_seq,
227 NFNL_MSG_TYPE(cb->nlh->nlmsg_type), 227 NFNL_MSG_TYPE(cb->nlh->nlmsg_type),
228 IPCTNL_MSG_TIMEOUT_NEW, cur) < 0) { 228 IPCTNL_MSG_TIMEOUT_NEW, cur) < 0) {
@@ -268,7 +268,7 @@ cttimeout_get_timeout(struct sock *ctnl, struct sk_buff *skb,
268 break; 268 break;
269 } 269 }
270 270
271 ret = ctnl_timeout_fill_info(skb2, NETLINK_CB(skb).pid, 271 ret = ctnl_timeout_fill_info(skb2, NETLINK_CB(skb).portid,
272 nlh->nlmsg_seq, 272 nlh->nlmsg_seq,
273 NFNL_MSG_TYPE(nlh->nlmsg_type), 273 NFNL_MSG_TYPE(nlh->nlmsg_type),
274 IPCTNL_MSG_TIMEOUT_NEW, cur); 274 IPCTNL_MSG_TIMEOUT_NEW, cur);
@@ -276,7 +276,7 @@ cttimeout_get_timeout(struct sock *ctnl, struct sk_buff *skb,
276 kfree_skb(skb2); 276 kfree_skb(skb2);
277 break; 277 break;
278 } 278 }
279 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, 279 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).portid,
280 MSG_DONTWAIT); 280 MSG_DONTWAIT);
281 if (ret > 0) 281 if (ret > 0)
282 ret = 0; 282 ret = 0;
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index be194b144297..8cb67c4dbd62 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -56,7 +56,7 @@ struct nfulnl_instance {
56 struct sk_buff *skb; /* pre-allocatd skb */ 56 struct sk_buff *skb; /* pre-allocatd skb */
57 struct timer_list timer; 57 struct timer_list timer;
58 struct user_namespace *peer_user_ns; /* User namespace of the peer process */ 58 struct user_namespace *peer_user_ns; /* User namespace of the peer process */
59 int peer_pid; /* PID of the peer process */ 59 int peer_portid; /* PORTID of the peer process */
60 60
61 /* configurable parameters */ 61 /* configurable parameters */
62 unsigned int flushtimeout; /* timeout until queue flush */ 62 unsigned int flushtimeout; /* timeout until queue flush */
@@ -133,7 +133,7 @@ instance_put(struct nfulnl_instance *inst)
133static void nfulnl_timer(unsigned long data); 133static void nfulnl_timer(unsigned long data);
134 134
135static struct nfulnl_instance * 135static struct nfulnl_instance *
136instance_create(u_int16_t group_num, int pid, struct user_namespace *user_ns) 136instance_create(u_int16_t group_num, int portid, struct user_namespace *user_ns)
137{ 137{
138 struct nfulnl_instance *inst; 138 struct nfulnl_instance *inst;
139 int err; 139 int err;
@@ -164,7 +164,7 @@ instance_create(u_int16_t group_num, int pid, struct user_namespace *user_ns)
164 setup_timer(&inst->timer, nfulnl_timer, (unsigned long)inst); 164 setup_timer(&inst->timer, nfulnl_timer, (unsigned long)inst);
165 165
166 inst->peer_user_ns = user_ns; 166 inst->peer_user_ns = user_ns;
167 inst->peer_pid = pid; 167 inst->peer_portid = portid;
168 inst->group_num = group_num; 168 inst->group_num = group_num;
169 169
170 inst->qthreshold = NFULNL_QTHRESH_DEFAULT; 170 inst->qthreshold = NFULNL_QTHRESH_DEFAULT;
@@ -336,7 +336,7 @@ __nfulnl_send(struct nfulnl_instance *inst)
336 if (!nlh) 336 if (!nlh)
337 goto out; 337 goto out;
338 } 338 }
339 status = nfnetlink_unicast(inst->skb, &init_net, inst->peer_pid, 339 status = nfnetlink_unicast(inst->skb, &init_net, inst->peer_portid,
340 MSG_DONTWAIT); 340 MSG_DONTWAIT);
341 341
342 inst->qlen = 0; 342 inst->qlen = 0;
@@ -703,7 +703,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this,
703 if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) { 703 if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
704 int i; 704 int i;
705 705
706 /* destroy all instances for this pid */ 706 /* destroy all instances for this portid */
707 spin_lock_bh(&instances_lock); 707 spin_lock_bh(&instances_lock);
708 for (i = 0; i < INSTANCE_BUCKETS; i++) { 708 for (i = 0; i < INSTANCE_BUCKETS; i++) {
709 struct hlist_node *tmp, *t2; 709 struct hlist_node *tmp, *t2;
@@ -712,7 +712,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this,
712 712
713 hlist_for_each_entry_safe(inst, tmp, t2, head, hlist) { 713 hlist_for_each_entry_safe(inst, tmp, t2, head, hlist) {
714 if ((net_eq(n->net, &init_net)) && 714 if ((net_eq(n->net, &init_net)) &&
715 (n->pid == inst->peer_pid)) 715 (n->portid == inst->peer_portid))
716 __instance_destroy(inst); 716 __instance_destroy(inst);
717 } 717 }
718 } 718 }
@@ -774,7 +774,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
774 } 774 }
775 775
776 inst = instance_lookup_get(group_num); 776 inst = instance_lookup_get(group_num);
777 if (inst && inst->peer_pid != NETLINK_CB(skb).pid) { 777 if (inst && inst->peer_portid != NETLINK_CB(skb).portid) {
778 ret = -EPERM; 778 ret = -EPERM;
779 goto out_put; 779 goto out_put;
780 } 780 }
@@ -788,7 +788,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
788 } 788 }
789 789
790 inst = instance_create(group_num, 790 inst = instance_create(group_num,
791 NETLINK_CB(skb).pid, 791 NETLINK_CB(skb).portid,
792 sk_user_ns(NETLINK_CB(skb).ssk)); 792 sk_user_ns(NETLINK_CB(skb).ssk));
793 if (IS_ERR(inst)) { 793 if (IS_ERR(inst)) {
794 ret = PTR_ERR(inst); 794 ret = PTR_ERR(inst);
@@ -947,7 +947,7 @@ static int seq_show(struct seq_file *s, void *v)
947 947
948 return seq_printf(s, "%5d %6d %5d %1d %5d %6d %2d\n", 948 return seq_printf(s, "%5d %6d %5d %1d %5d %6d %2d\n",
949 inst->group_num, 949 inst->group_num,
950 inst->peer_pid, inst->qlen, 950 inst->peer_portid, inst->qlen,
951 inst->copy_mode, inst->copy_range, 951 inst->copy_mode, inst->copy_range,
952 inst->flushtimeout, atomic_read(&inst->use)); 952 inst->flushtimeout, atomic_read(&inst->use));
953} 953}
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index c0496a55ad0c..b8d9995b76a8 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -44,7 +44,7 @@ struct nfqnl_instance {
44 struct hlist_node hlist; /* global list of queues */ 44 struct hlist_node hlist; /* global list of queues */
45 struct rcu_head rcu; 45 struct rcu_head rcu;
46 46
47 int peer_pid; 47 int peer_portid;
48 unsigned int queue_maxlen; 48 unsigned int queue_maxlen;
49 unsigned int copy_range; 49 unsigned int copy_range;
50 unsigned int queue_dropped; 50 unsigned int queue_dropped;
@@ -92,7 +92,7 @@ instance_lookup(u_int16_t queue_num)
92} 92}
93 93
94static struct nfqnl_instance * 94static struct nfqnl_instance *
95instance_create(u_int16_t queue_num, int pid) 95instance_create(u_int16_t queue_num, int portid)
96{ 96{
97 struct nfqnl_instance *inst; 97 struct nfqnl_instance *inst;
98 unsigned int h; 98 unsigned int h;
@@ -111,7 +111,7 @@ instance_create(u_int16_t queue_num, int pid)
111 } 111 }
112 112
113 inst->queue_num = queue_num; 113 inst->queue_num = queue_num;
114 inst->peer_pid = pid; 114 inst->peer_portid = portid;
115 inst->queue_maxlen = NFQNL_QMAX_DEFAULT; 115 inst->queue_maxlen = NFQNL_QMAX_DEFAULT;
116 inst->copy_range = 0xfffff; 116 inst->copy_range = 0xfffff;
117 inst->copy_mode = NFQNL_COPY_NONE; 117 inst->copy_mode = NFQNL_COPY_NONE;
@@ -440,7 +440,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
440 } 440 }
441 spin_lock_bh(&queue->lock); 441 spin_lock_bh(&queue->lock);
442 442
443 if (!queue->peer_pid) { 443 if (!queue->peer_portid) {
444 err = -EINVAL; 444 err = -EINVAL;
445 goto err_out_free_nskb; 445 goto err_out_free_nskb;
446 } 446 }
@@ -459,7 +459,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
459 *packet_id_ptr = htonl(entry->id); 459 *packet_id_ptr = htonl(entry->id);
460 460
461 /* nfnetlink_unicast will either free the nskb or add it to a socket */ 461 /* nfnetlink_unicast will either free the nskb or add it to a socket */
462 err = nfnetlink_unicast(nskb, &init_net, queue->peer_pid, MSG_DONTWAIT); 462 err = nfnetlink_unicast(nskb, &init_net, queue->peer_portid, MSG_DONTWAIT);
463 if (err < 0) { 463 if (err < 0) {
464 queue->queue_user_dropped++; 464 queue->queue_user_dropped++;
465 goto err_out_unlock; 465 goto err_out_unlock;
@@ -616,7 +616,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this,
616 if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) { 616 if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
617 int i; 617 int i;
618 618
619 /* destroy all instances for this pid */ 619 /* destroy all instances for this portid */
620 spin_lock(&instances_lock); 620 spin_lock(&instances_lock);
621 for (i = 0; i < INSTANCE_BUCKETS; i++) { 621 for (i = 0; i < INSTANCE_BUCKETS; i++) {
622 struct hlist_node *tmp, *t2; 622 struct hlist_node *tmp, *t2;
@@ -625,7 +625,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this,
625 625
626 hlist_for_each_entry_safe(inst, tmp, t2, head, hlist) { 626 hlist_for_each_entry_safe(inst, tmp, t2, head, hlist) {
627 if ((n->net == &init_net) && 627 if ((n->net == &init_net) &&
628 (n->pid == inst->peer_pid)) 628 (n->portid == inst->peer_portid))
629 __instance_destroy(inst); 629 __instance_destroy(inst);
630 } 630 }
631 } 631 }
@@ -650,7 +650,7 @@ static const struct nla_policy nfqa_verdict_batch_policy[NFQA_MAX+1] = {
650 [NFQA_MARK] = { .type = NLA_U32 }, 650 [NFQA_MARK] = { .type = NLA_U32 },
651}; 651};
652 652
653static struct nfqnl_instance *verdict_instance_lookup(u16 queue_num, int nlpid) 653static struct nfqnl_instance *verdict_instance_lookup(u16 queue_num, int nlportid)
654{ 654{
655 struct nfqnl_instance *queue; 655 struct nfqnl_instance *queue;
656 656
@@ -658,7 +658,7 @@ static struct nfqnl_instance *verdict_instance_lookup(u16 queue_num, int nlpid)
658 if (!queue) 658 if (!queue)
659 return ERR_PTR(-ENODEV); 659 return ERR_PTR(-ENODEV);
660 660
661 if (queue->peer_pid != nlpid) 661 if (queue->peer_portid != nlportid)
662 return ERR_PTR(-EPERM); 662 return ERR_PTR(-EPERM);
663 663
664 return queue; 664 return queue;
@@ -698,7 +698,7 @@ nfqnl_recv_verdict_batch(struct sock *ctnl, struct sk_buff *skb,
698 LIST_HEAD(batch_list); 698 LIST_HEAD(batch_list);
699 u16 queue_num = ntohs(nfmsg->res_id); 699 u16 queue_num = ntohs(nfmsg->res_id);
700 700
701 queue = verdict_instance_lookup(queue_num, NETLINK_CB(skb).pid); 701 queue = verdict_instance_lookup(queue_num, NETLINK_CB(skb).portid);
702 if (IS_ERR(queue)) 702 if (IS_ERR(queue))
703 return PTR_ERR(queue); 703 return PTR_ERR(queue);
704 704
@@ -749,7 +749,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
749 queue = instance_lookup(queue_num); 749 queue = instance_lookup(queue_num);
750 if (!queue) 750 if (!queue)
751 751
752 queue = verdict_instance_lookup(queue_num, NETLINK_CB(skb).pid); 752 queue = verdict_instance_lookup(queue_num, NETLINK_CB(skb).portid);
753 if (IS_ERR(queue)) 753 if (IS_ERR(queue))
754 return PTR_ERR(queue); 754 return PTR_ERR(queue);
755 755
@@ -832,7 +832,7 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
832 832
833 rcu_read_lock(); 833 rcu_read_lock();
834 queue = instance_lookup(queue_num); 834 queue = instance_lookup(queue_num);
835 if (queue && queue->peer_pid != NETLINK_CB(skb).pid) { 835 if (queue && queue->peer_portid != NETLINK_CB(skb).portid) {
836 ret = -EPERM; 836 ret = -EPERM;
837 goto err_out_unlock; 837 goto err_out_unlock;
838 } 838 }
@@ -844,7 +844,7 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
844 ret = -EBUSY; 844 ret = -EBUSY;
845 goto err_out_unlock; 845 goto err_out_unlock;
846 } 846 }
847 queue = instance_create(queue_num, NETLINK_CB(skb).pid); 847 queue = instance_create(queue_num, NETLINK_CB(skb).portid);
848 if (IS_ERR(queue)) { 848 if (IS_ERR(queue)) {
849 ret = PTR_ERR(queue); 849 ret = PTR_ERR(queue);
850 goto err_out_unlock; 850 goto err_out_unlock;
@@ -1016,7 +1016,7 @@ static int seq_show(struct seq_file *s, void *v)
1016 1016
1017 return seq_printf(s, "%5d %6d %5d %1d %5d %5d %5d %8d %2d\n", 1017 return seq_printf(s, "%5d %6d %5d %1d %5d %5d %5d %8d %2d\n",
1018 inst->queue_num, 1018 inst->queue_num,
1019 inst->peer_pid, inst->queue_total, 1019 inst->peer_portid, inst->queue_total,
1020 inst->copy_mode, inst->copy_range, 1020 inst->copy_mode, inst->copy_range,
1021 inst->queue_dropped, inst->queue_user_dropped, 1021 inst->queue_dropped, inst->queue_user_dropped,
1022 inst->id_sequence, 1); 1022 inst->id_sequence, 1);
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 6bf878335d94..c15042f987bd 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -627,7 +627,7 @@ static int netlbl_cipsov4_listall_cb(struct cipso_v4_doi *doi_def, void *arg)
627 struct netlbl_cipsov4_doiwalk_arg *cb_arg = arg; 627 struct netlbl_cipsov4_doiwalk_arg *cb_arg = arg;
628 void *data; 628 void *data;
629 629
630 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).pid, 630 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).portid,
631 cb_arg->seq, &netlbl_cipsov4_gnl_family, 631 cb_arg->seq, &netlbl_cipsov4_gnl_family,
632 NLM_F_MULTI, NLBL_CIPSOV4_C_LISTALL); 632 NLM_F_MULTI, NLBL_CIPSOV4_C_LISTALL);
633 if (data == NULL) 633 if (data == NULL)
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index 4809e2e48b02..c5384ffc6146 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -448,7 +448,7 @@ static int netlbl_mgmt_listall_cb(struct netlbl_dom_map *entry, void *arg)
448 struct netlbl_domhsh_walk_arg *cb_arg = arg; 448 struct netlbl_domhsh_walk_arg *cb_arg = arg;
449 void *data; 449 void *data;
450 450
451 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).pid, 451 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).portid,
452 cb_arg->seq, &netlbl_mgmt_gnl_family, 452 cb_arg->seq, &netlbl_mgmt_gnl_family,
453 NLM_F_MULTI, NLBL_MGMT_C_LISTALL); 453 NLM_F_MULTI, NLBL_MGMT_C_LISTALL);
454 if (data == NULL) 454 if (data == NULL)
@@ -613,7 +613,7 @@ static int netlbl_mgmt_protocols_cb(struct sk_buff *skb,
613 int ret_val = -ENOMEM; 613 int ret_val = -ENOMEM;
614 void *data; 614 void *data;
615 615
616 data = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 616 data = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
617 &netlbl_mgmt_gnl_family, NLM_F_MULTI, 617 &netlbl_mgmt_gnl_family, NLM_F_MULTI,
618 NLBL_MGMT_C_PROTOCOLS); 618 NLBL_MGMT_C_PROTOCOLS);
619 if (data == NULL) 619 if (data == NULL)
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index e7ff694f1049..b7944413b404 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -1096,7 +1096,7 @@ static int netlbl_unlabel_staticlist_gen(u32 cmd,
1096 char *secctx; 1096 char *secctx;
1097 u32 secctx_len; 1097 u32 secctx_len;
1098 1098
1099 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).pid, 1099 data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).portid,
1100 cb_arg->seq, &netlbl_unlabel_gnl_family, 1100 cb_arg->seq, &netlbl_unlabel_gnl_family,
1101 NLM_F_MULTI, cmd); 1101 NLM_F_MULTI, cmd);
1102 if (data == NULL) 1102 if (data == NULL)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 4d348e97e131..0f2e3ad69c47 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -67,8 +67,8 @@
67struct netlink_sock { 67struct netlink_sock {
68 /* struct sock has to be the first member of netlink_sock */ 68 /* struct sock has to be the first member of netlink_sock */
69 struct sock sk; 69 struct sock sk;
70 u32 pid; 70 u32 portid;
71 u32 dst_pid; 71 u32 dst_portid;
72 u32 dst_group; 72 u32 dst_group;
73 u32 flags; 73 u32 flags;
74 u32 subscriptions; 74 u32 subscriptions;
@@ -104,7 +104,7 @@ static inline int netlink_is_kernel(struct sock *sk)
104 return nlk_sk(sk)->flags & NETLINK_KERNEL_SOCKET; 104 return nlk_sk(sk)->flags & NETLINK_KERNEL_SOCKET;
105} 105}
106 106
107struct nl_pid_hash { 107struct nl_portid_hash {
108 struct hlist_head *table; 108 struct hlist_head *table;
109 unsigned long rehash_time; 109 unsigned long rehash_time;
110 110
@@ -118,7 +118,7 @@ struct nl_pid_hash {
118}; 118};
119 119
120struct netlink_table { 120struct netlink_table {
121 struct nl_pid_hash hash; 121 struct nl_portid_hash hash;
122 struct hlist_head mc_list; 122 struct hlist_head mc_list;
123 struct listeners __rcu *listeners; 123 struct listeners __rcu *listeners;
124 unsigned int flags; 124 unsigned int flags;
@@ -145,9 +145,9 @@ static inline u32 netlink_group_mask(u32 group)
145 return group ? 1 << (group - 1) : 0; 145 return group ? 1 << (group - 1) : 0;
146} 146}
147 147
148static inline struct hlist_head *nl_pid_hashfn(struct nl_pid_hash *hash, u32 pid) 148static inline struct hlist_head *nl_portid_hashfn(struct nl_portid_hash *hash, u32 portid)
149{ 149{
150 return &hash->table[jhash_1word(pid, hash->rnd) & hash->mask]; 150 return &hash->table[jhash_1word(portid, hash->rnd) & hash->mask];
151} 151}
152 152
153static void netlink_destroy_callback(struct netlink_callback *cb) 153static void netlink_destroy_callback(struct netlink_callback *cb)
@@ -239,17 +239,17 @@ netlink_unlock_table(void)
239 wake_up(&nl_table_wait); 239 wake_up(&nl_table_wait);
240} 240}
241 241
242static struct sock *netlink_lookup(struct net *net, int protocol, u32 pid) 242static struct sock *netlink_lookup(struct net *net, int protocol, u32 portid)
243{ 243{
244 struct nl_pid_hash *hash = &nl_table[protocol].hash; 244 struct nl_portid_hash *hash = &nl_table[protocol].hash;
245 struct hlist_head *head; 245 struct hlist_head *head;
246 struct sock *sk; 246 struct sock *sk;
247 struct hlist_node *node; 247 struct hlist_node *node;
248 248
249 read_lock(&nl_table_lock); 249 read_lock(&nl_table_lock);
250 head = nl_pid_hashfn(hash, pid); 250 head = nl_portid_hashfn(hash, portid);
251 sk_for_each(sk, node, head) { 251 sk_for_each(sk, node, head) {
252 if (net_eq(sock_net(sk), net) && (nlk_sk(sk)->pid == pid)) { 252 if (net_eq(sock_net(sk), net) && (nlk_sk(sk)->portid == portid)) {
253 sock_hold(sk); 253 sock_hold(sk);
254 goto found; 254 goto found;
255 } 255 }
@@ -260,7 +260,7 @@ found:
260 return sk; 260 return sk;
261} 261}
262 262
263static struct hlist_head *nl_pid_hash_zalloc(size_t size) 263static struct hlist_head *nl_portid_hash_zalloc(size_t size)
264{ 264{
265 if (size <= PAGE_SIZE) 265 if (size <= PAGE_SIZE)
266 return kzalloc(size, GFP_ATOMIC); 266 return kzalloc(size, GFP_ATOMIC);
@@ -270,7 +270,7 @@ static struct hlist_head *nl_pid_hash_zalloc(size_t size)
270 get_order(size)); 270 get_order(size));
271} 271}
272 272
273static void nl_pid_hash_free(struct hlist_head *table, size_t size) 273static void nl_portid_hash_free(struct hlist_head *table, size_t size)
274{ 274{
275 if (size <= PAGE_SIZE) 275 if (size <= PAGE_SIZE)
276 kfree(table); 276 kfree(table);
@@ -278,7 +278,7 @@ static void nl_pid_hash_free(struct hlist_head *table, size_t size)
278 free_pages((unsigned long)table, get_order(size)); 278 free_pages((unsigned long)table, get_order(size));
279} 279}
280 280
281static int nl_pid_hash_rehash(struct nl_pid_hash *hash, int grow) 281static int nl_portid_hash_rehash(struct nl_portid_hash *hash, int grow)
282{ 282{
283 unsigned int omask, mask, shift; 283 unsigned int omask, mask, shift;
284 size_t osize, size; 284 size_t osize, size;
@@ -296,7 +296,7 @@ static int nl_pid_hash_rehash(struct nl_pid_hash *hash, int grow)
296 size *= 2; 296 size *= 2;
297 } 297 }
298 298
299 table = nl_pid_hash_zalloc(size); 299 table = nl_portid_hash_zalloc(size);
300 if (!table) 300 if (!table)
301 return 0; 301 return 0;
302 302
@@ -311,23 +311,23 @@ static int nl_pid_hash_rehash(struct nl_pid_hash *hash, int grow)
311 struct hlist_node *node, *tmp; 311 struct hlist_node *node, *tmp;
312 312
313 sk_for_each_safe(sk, node, tmp, &otable[i]) 313 sk_for_each_safe(sk, node, tmp, &otable[i])
314 __sk_add_node(sk, nl_pid_hashfn(hash, nlk_sk(sk)->pid)); 314 __sk_add_node(sk, nl_portid_hashfn(hash, nlk_sk(sk)->portid));
315 } 315 }
316 316
317 nl_pid_hash_free(otable, osize); 317 nl_portid_hash_free(otable, osize);
318 hash->rehash_time = jiffies + 10 * 60 * HZ; 318 hash->rehash_time = jiffies + 10 * 60 * HZ;
319 return 1; 319 return 1;
320} 320}
321 321
322static inline int nl_pid_hash_dilute(struct nl_pid_hash *hash, int len) 322static inline int nl_portid_hash_dilute(struct nl_portid_hash *hash, int len)
323{ 323{
324 int avg = hash->entries >> hash->shift; 324 int avg = hash->entries >> hash->shift;
325 325
326 if (unlikely(avg > 1) && nl_pid_hash_rehash(hash, 1)) 326 if (unlikely(avg > 1) && nl_portid_hash_rehash(hash, 1))
327 return 1; 327 return 1;
328 328
329 if (unlikely(len > avg) && time_after(jiffies, hash->rehash_time)) { 329 if (unlikely(len > avg) && time_after(jiffies, hash->rehash_time)) {
330 nl_pid_hash_rehash(hash, 0); 330 nl_portid_hash_rehash(hash, 0);
331 return 1; 331 return 1;
332 } 332 }
333 333
@@ -356,9 +356,9 @@ netlink_update_listeners(struct sock *sk)
356 * makes sure updates are visible before bind or setsockopt return. */ 356 * makes sure updates are visible before bind or setsockopt return. */
357} 357}
358 358
359static int netlink_insert(struct sock *sk, struct net *net, u32 pid) 359static int netlink_insert(struct sock *sk, struct net *net, u32 portid)
360{ 360{
361 struct nl_pid_hash *hash = &nl_table[sk->sk_protocol].hash; 361 struct nl_portid_hash *hash = &nl_table[sk->sk_protocol].hash;
362 struct hlist_head *head; 362 struct hlist_head *head;
363 int err = -EADDRINUSE; 363 int err = -EADDRINUSE;
364 struct sock *osk; 364 struct sock *osk;
@@ -366,10 +366,10 @@ static int netlink_insert(struct sock *sk, struct net *net, u32 pid)
366 int len; 366 int len;
367 367
368 netlink_table_grab(); 368 netlink_table_grab();
369 head = nl_pid_hashfn(hash, pid); 369 head = nl_portid_hashfn(hash, portid);
370 len = 0; 370 len = 0;
371 sk_for_each(osk, node, head) { 371 sk_for_each(osk, node, head) {
372 if (net_eq(sock_net(osk), net) && (nlk_sk(osk)->pid == pid)) 372 if (net_eq(sock_net(osk), net) && (nlk_sk(osk)->portid == portid))
373 break; 373 break;
374 len++; 374 len++;
375 } 375 }
@@ -377,17 +377,17 @@ static int netlink_insert(struct sock *sk, struct net *net, u32 pid)
377 goto err; 377 goto err;
378 378
379 err = -EBUSY; 379 err = -EBUSY;
380 if (nlk_sk(sk)->pid) 380 if (nlk_sk(sk)->portid)
381 goto err; 381 goto err;
382 382
383 err = -ENOMEM; 383 err = -ENOMEM;
384 if (BITS_PER_LONG > 32 && unlikely(hash->entries >= UINT_MAX)) 384 if (BITS_PER_LONG > 32 && unlikely(hash->entries >= UINT_MAX))
385 goto err; 385 goto err;
386 386
387 if (len && nl_pid_hash_dilute(hash, len)) 387 if (len && nl_portid_hash_dilute(hash, len))
388 head = nl_pid_hashfn(hash, pid); 388 head = nl_portid_hashfn(hash, portid);
389 hash->entries++; 389 hash->entries++;
390 nlk_sk(sk)->pid = pid; 390 nlk_sk(sk)->portid = portid;
391 sk_add_node(sk, head); 391 sk_add_node(sk, head);
392 err = 0; 392 err = 0;
393 393
@@ -518,11 +518,11 @@ static int netlink_release(struct socket *sock)
518 518
519 skb_queue_purge(&sk->sk_write_queue); 519 skb_queue_purge(&sk->sk_write_queue);
520 520
521 if (nlk->pid) { 521 if (nlk->portid) {
522 struct netlink_notify n = { 522 struct netlink_notify n = {
523 .net = sock_net(sk), 523 .net = sock_net(sk),
524 .protocol = sk->sk_protocol, 524 .protocol = sk->sk_protocol,
525 .pid = nlk->pid, 525 .portid = nlk->portid,
526 }; 526 };
527 atomic_notifier_call_chain(&netlink_chain, 527 atomic_notifier_call_chain(&netlink_chain,
528 NETLINK_URELEASE, &n); 528 NETLINK_URELEASE, &n);
@@ -559,24 +559,24 @@ static int netlink_autobind(struct socket *sock)
559{ 559{
560 struct sock *sk = sock->sk; 560 struct sock *sk = sock->sk;
561 struct net *net = sock_net(sk); 561 struct net *net = sock_net(sk);
562 struct nl_pid_hash *hash = &nl_table[sk->sk_protocol].hash; 562 struct nl_portid_hash *hash = &nl_table[sk->sk_protocol].hash;
563 struct hlist_head *head; 563 struct hlist_head *head;
564 struct sock *osk; 564 struct sock *osk;
565 struct hlist_node *node; 565 struct hlist_node *node;
566 s32 pid = task_tgid_vnr(current); 566 s32 portid = task_tgid_vnr(current);
567 int err; 567 int err;
568 static s32 rover = -4097; 568 static s32 rover = -4097;
569 569
570retry: 570retry:
571 cond_resched(); 571 cond_resched();
572 netlink_table_grab(); 572 netlink_table_grab();
573 head = nl_pid_hashfn(hash, pid); 573 head = nl_portid_hashfn(hash, portid);
574 sk_for_each(osk, node, head) { 574 sk_for_each(osk, node, head) {
575 if (!net_eq(sock_net(osk), net)) 575 if (!net_eq(sock_net(osk), net))
576 continue; 576 continue;
577 if (nlk_sk(osk)->pid == pid) { 577 if (nlk_sk(osk)->portid == portid) {
578 /* Bind collision, search negative pid values. */ 578 /* Bind collision, search negative portid values. */
579 pid = rover--; 579 portid = rover--;
580 if (rover > -4097) 580 if (rover > -4097)
581 rover = -4097; 581 rover = -4097;
582 netlink_table_ungrab(); 582 netlink_table_ungrab();
@@ -585,7 +585,7 @@ retry:
585 } 585 }
586 netlink_table_ungrab(); 586 netlink_table_ungrab();
587 587
588 err = netlink_insert(sk, net, pid); 588 err = netlink_insert(sk, net, portid);
589 if (err == -EADDRINUSE) 589 if (err == -EADDRINUSE)
590 goto retry; 590 goto retry;
591 591
@@ -668,8 +668,8 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,
668 return err; 668 return err;
669 } 669 }
670 670
671 if (nlk->pid) { 671 if (nlk->portid) {
672 if (nladdr->nl_pid != nlk->pid) 672 if (nladdr->nl_pid != nlk->portid)
673 return -EINVAL; 673 return -EINVAL;
674 } else { 674 } else {
675 err = nladdr->nl_pid ? 675 err = nladdr->nl_pid ?
@@ -715,7 +715,7 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
715 715
716 if (addr->sa_family == AF_UNSPEC) { 716 if (addr->sa_family == AF_UNSPEC) {
717 sk->sk_state = NETLINK_UNCONNECTED; 717 sk->sk_state = NETLINK_UNCONNECTED;
718 nlk->dst_pid = 0; 718 nlk->dst_portid = 0;
719 nlk->dst_group = 0; 719 nlk->dst_group = 0;
720 return 0; 720 return 0;
721 } 721 }
@@ -726,12 +726,12 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
726 if (nladdr->nl_groups && !netlink_capable(sock, NL_CFG_F_NONROOT_SEND)) 726 if (nladdr->nl_groups && !netlink_capable(sock, NL_CFG_F_NONROOT_SEND))
727 return -EPERM; 727 return -EPERM;
728 728
729 if (!nlk->pid) 729 if (!nlk->portid)
730 err = netlink_autobind(sock); 730 err = netlink_autobind(sock);
731 731
732 if (err == 0) { 732 if (err == 0) {
733 sk->sk_state = NETLINK_CONNECTED; 733 sk->sk_state = NETLINK_CONNECTED;
734 nlk->dst_pid = nladdr->nl_pid; 734 nlk->dst_portid = nladdr->nl_pid;
735 nlk->dst_group = ffs(nladdr->nl_groups); 735 nlk->dst_group = ffs(nladdr->nl_groups);
736 } 736 }
737 737
@@ -750,10 +750,10 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr,
750 *addr_len = sizeof(*nladdr); 750 *addr_len = sizeof(*nladdr);
751 751
752 if (peer) { 752 if (peer) {
753 nladdr->nl_pid = nlk->dst_pid; 753 nladdr->nl_pid = nlk->dst_portid;
754 nladdr->nl_groups = netlink_group_mask(nlk->dst_group); 754 nladdr->nl_groups = netlink_group_mask(nlk->dst_group);
755 } else { 755 } else {
756 nladdr->nl_pid = nlk->pid; 756 nladdr->nl_pid = nlk->portid;
757 nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0; 757 nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0;
758 } 758 }
759 return 0; 759 return 0;
@@ -772,19 +772,19 @@ static void netlink_overrun(struct sock *sk)
772 atomic_inc(&sk->sk_drops); 772 atomic_inc(&sk->sk_drops);
773} 773}
774 774
775static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) 775static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid)
776{ 776{
777 struct sock *sock; 777 struct sock *sock;
778 struct netlink_sock *nlk; 778 struct netlink_sock *nlk;
779 779
780 sock = netlink_lookup(sock_net(ssk), ssk->sk_protocol, pid); 780 sock = netlink_lookup(sock_net(ssk), ssk->sk_protocol, portid);
781 if (!sock) 781 if (!sock)
782 return ERR_PTR(-ECONNREFUSED); 782 return ERR_PTR(-ECONNREFUSED);
783 783
784 /* Don't bother queuing skb if kernel socket has no input function */ 784 /* Don't bother queuing skb if kernel socket has no input function */
785 nlk = nlk_sk(sock); 785 nlk = nlk_sk(sock);
786 if (sock->sk_state == NETLINK_CONNECTED && 786 if (sock->sk_state == NETLINK_CONNECTED &&
787 nlk->dst_pid != nlk_sk(ssk)->pid) { 787 nlk->dst_portid != nlk_sk(ssk)->portid) {
788 sock_put(sock); 788 sock_put(sock);
789 return ERR_PTR(-ECONNREFUSED); 789 return ERR_PTR(-ECONNREFUSED);
790 } 790 }
@@ -935,7 +935,7 @@ static int netlink_unicast_kernel(struct sock *sk, struct sk_buff *skb,
935} 935}
936 936
937int netlink_unicast(struct sock *ssk, struct sk_buff *skb, 937int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
938 u32 pid, int nonblock) 938 u32 portid, int nonblock)
939{ 939{
940 struct sock *sk; 940 struct sock *sk;
941 int err; 941 int err;
@@ -945,7 +945,7 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
945 945
946 timeo = sock_sndtimeo(ssk, nonblock); 946 timeo = sock_sndtimeo(ssk, nonblock);
947retry: 947retry:
948 sk = netlink_getsockbypid(ssk, pid); 948 sk = netlink_getsockbyportid(ssk, portid);
949 if (IS_ERR(sk)) { 949 if (IS_ERR(sk)) {
950 kfree_skb(skb); 950 kfree_skb(skb);
951 return PTR_ERR(sk); 951 return PTR_ERR(sk);
@@ -1005,7 +1005,7 @@ static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
1005struct netlink_broadcast_data { 1005struct netlink_broadcast_data {
1006 struct sock *exclude_sk; 1006 struct sock *exclude_sk;
1007 struct net *net; 1007 struct net *net;
1008 u32 pid; 1008 u32 portid;
1009 u32 group; 1009 u32 group;
1010 int failure; 1010 int failure;
1011 int delivery_failure; 1011 int delivery_failure;
@@ -1026,7 +1026,7 @@ static int do_one_broadcast(struct sock *sk,
1026 if (p->exclude_sk == sk) 1026 if (p->exclude_sk == sk)
1027 goto out; 1027 goto out;
1028 1028
1029 if (nlk->pid == p->pid || p->group - 1 >= nlk->ngroups || 1029 if (nlk->portid == p->portid || p->group - 1 >= nlk->ngroups ||
1030 !test_bit(p->group - 1, nlk->groups)) 1030 !test_bit(p->group - 1, nlk->groups))
1031 goto out; 1031 goto out;
1032 1032
@@ -1078,7 +1078,7 @@ out:
1078 return 0; 1078 return 0;
1079} 1079}
1080 1080
1081int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, u32 pid, 1081int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, u32 portid,
1082 u32 group, gfp_t allocation, 1082 u32 group, gfp_t allocation,
1083 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data), 1083 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
1084 void *filter_data) 1084 void *filter_data)
@@ -1092,7 +1092,7 @@ int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, u32 pid,
1092 1092
1093 info.exclude_sk = ssk; 1093 info.exclude_sk = ssk;
1094 info.net = net; 1094 info.net = net;
1095 info.pid = pid; 1095 info.portid = portid;
1096 info.group = group; 1096 info.group = group;
1097 info.failure = 0; 1097 info.failure = 0;
1098 info.delivery_failure = 0; 1098 info.delivery_failure = 0;
@@ -1130,17 +1130,17 @@ int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, u32 pid,
1130} 1130}
1131EXPORT_SYMBOL(netlink_broadcast_filtered); 1131EXPORT_SYMBOL(netlink_broadcast_filtered);
1132 1132
1133int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid, 1133int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 portid,
1134 u32 group, gfp_t allocation) 1134 u32 group, gfp_t allocation)
1135{ 1135{
1136 return netlink_broadcast_filtered(ssk, skb, pid, group, allocation, 1136 return netlink_broadcast_filtered(ssk, skb, portid, group, allocation,
1137 NULL, NULL); 1137 NULL, NULL);
1138} 1138}
1139EXPORT_SYMBOL(netlink_broadcast); 1139EXPORT_SYMBOL(netlink_broadcast);
1140 1140
1141struct netlink_set_err_data { 1141struct netlink_set_err_data {
1142 struct sock *exclude_sk; 1142 struct sock *exclude_sk;
1143 u32 pid; 1143 u32 portid;
1144 u32 group; 1144 u32 group;
1145 int code; 1145 int code;
1146}; 1146};
@@ -1156,7 +1156,7 @@ static int do_one_set_err(struct sock *sk, struct netlink_set_err_data *p)
1156 if (!net_eq(sock_net(sk), sock_net(p->exclude_sk))) 1156 if (!net_eq(sock_net(sk), sock_net(p->exclude_sk)))
1157 goto out; 1157 goto out;
1158 1158
1159 if (nlk->pid == p->pid || p->group - 1 >= nlk->ngroups || 1159 if (nlk->portid == p->portid || p->group - 1 >= nlk->ngroups ||
1160 !test_bit(p->group - 1, nlk->groups)) 1160 !test_bit(p->group - 1, nlk->groups))
1161 goto out; 1161 goto out;
1162 1162
@@ -1174,14 +1174,14 @@ out:
1174/** 1174/**
1175 * netlink_set_err - report error to broadcast listeners 1175 * netlink_set_err - report error to broadcast listeners
1176 * @ssk: the kernel netlink socket, as returned by netlink_kernel_create() 1176 * @ssk: the kernel netlink socket, as returned by netlink_kernel_create()
1177 * @pid: the PID of a process that we want to skip (if any) 1177 * @portid: the PORTID of a process that we want to skip (if any)
1178 * @groups: the broadcast group that will notice the error 1178 * @groups: the broadcast group that will notice the error
1179 * @code: error code, must be negative (as usual in kernelspace) 1179 * @code: error code, must be negative (as usual in kernelspace)
1180 * 1180 *
1181 * This function returns the number of broadcast listeners that have set the 1181 * This function returns the number of broadcast listeners that have set the
1182 * NETLINK_RECV_NO_ENOBUFS socket option. 1182 * NETLINK_RECV_NO_ENOBUFS socket option.
1183 */ 1183 */
1184int netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) 1184int netlink_set_err(struct sock *ssk, u32 portid, u32 group, int code)
1185{ 1185{
1186 struct netlink_set_err_data info; 1186 struct netlink_set_err_data info;
1187 struct hlist_node *node; 1187 struct hlist_node *node;
@@ -1189,7 +1189,7 @@ int netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code)
1189 int ret = 0; 1189 int ret = 0;
1190 1190
1191 info.exclude_sk = ssk; 1191 info.exclude_sk = ssk;
1192 info.pid = pid; 1192 info.portid = portid;
1193 info.group = group; 1193 info.group = group;
1194 /* sk->sk_err wants a positive error value */ 1194 /* sk->sk_err wants a positive error value */
1195 info.code = -code; 1195 info.code = -code;
@@ -1354,7 +1354,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
1354 struct sock *sk = sock->sk; 1354 struct sock *sk = sock->sk;
1355 struct netlink_sock *nlk = nlk_sk(sk); 1355 struct netlink_sock *nlk = nlk_sk(sk);
1356 struct sockaddr_nl *addr = msg->msg_name; 1356 struct sockaddr_nl *addr = msg->msg_name;
1357 u32 dst_pid; 1357 u32 dst_portid;
1358 u32 dst_group; 1358 u32 dst_group;
1359 struct sk_buff *skb; 1359 struct sk_buff *skb;
1360 int err; 1360 int err;
@@ -1374,18 +1374,18 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
1374 err = -EINVAL; 1374 err = -EINVAL;
1375 if (addr->nl_family != AF_NETLINK) 1375 if (addr->nl_family != AF_NETLINK)
1376 goto out; 1376 goto out;
1377 dst_pid = addr->nl_pid; 1377 dst_portid = addr->nl_pid;
1378 dst_group = ffs(addr->nl_groups); 1378 dst_group = ffs(addr->nl_groups);
1379 err = -EPERM; 1379 err = -EPERM;
1380 if ((dst_group || dst_pid) && 1380 if ((dst_group || dst_portid) &&
1381 !netlink_capable(sock, NL_CFG_F_NONROOT_SEND)) 1381 !netlink_capable(sock, NL_CFG_F_NONROOT_SEND))
1382 goto out; 1382 goto out;
1383 } else { 1383 } else {
1384 dst_pid = nlk->dst_pid; 1384 dst_portid = nlk->dst_portid;
1385 dst_group = nlk->dst_group; 1385 dst_group = nlk->dst_group;
1386 } 1386 }
1387 1387
1388 if (!nlk->pid) { 1388 if (!nlk->portid) {
1389 err = netlink_autobind(sock); 1389 err = netlink_autobind(sock);
1390 if (err) 1390 if (err)
1391 goto out; 1391 goto out;
@@ -1399,7 +1399,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
1399 if (skb == NULL) 1399 if (skb == NULL)
1400 goto out; 1400 goto out;
1401 1401
1402 NETLINK_CB(skb).pid = nlk->pid; 1402 NETLINK_CB(skb).portid = nlk->portid;
1403 NETLINK_CB(skb).dst_group = dst_group; 1403 NETLINK_CB(skb).dst_group = dst_group;
1404 NETLINK_CB(skb).creds = siocb->scm->creds; 1404 NETLINK_CB(skb).creds = siocb->scm->creds;
1405 1405
@@ -1417,9 +1417,9 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
1417 1417
1418 if (dst_group) { 1418 if (dst_group) {
1419 atomic_inc(&skb->users); 1419 atomic_inc(&skb->users);
1420 netlink_broadcast(sk, skb, dst_pid, dst_group, GFP_KERNEL); 1420 netlink_broadcast(sk, skb, dst_portid, dst_group, GFP_KERNEL);
1421 } 1421 }
1422 err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT); 1422 err = netlink_unicast(sk, skb, dst_portid, msg->msg_flags&MSG_DONTWAIT);
1423 1423
1424out: 1424out:
1425 scm_destroy(siocb->scm); 1425 scm_destroy(siocb->scm);
@@ -1482,7 +1482,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1482 struct sockaddr_nl *addr = (struct sockaddr_nl *)msg->msg_name; 1482 struct sockaddr_nl *addr = (struct sockaddr_nl *)msg->msg_name;
1483 addr->nl_family = AF_NETLINK; 1483 addr->nl_family = AF_NETLINK;
1484 addr->nl_pad = 0; 1484 addr->nl_pad = 0;
1485 addr->nl_pid = NETLINK_CB(skb).pid; 1485 addr->nl_pid = NETLINK_CB(skb).portid;
1486 addr->nl_groups = netlink_group_mask(NETLINK_CB(skb).dst_group); 1486 addr->nl_groups = netlink_group_mask(NETLINK_CB(skb).dst_group);
1487 msg->msg_namelen = sizeof(*addr); 1487 msg->msg_namelen = sizeof(*addr);
1488 } 1488 }
@@ -1683,7 +1683,7 @@ void netlink_clear_multicast_users(struct sock *ksk, unsigned int group)
1683} 1683}
1684 1684
1685struct nlmsghdr * 1685struct nlmsghdr *
1686__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) 1686__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags)
1687{ 1687{
1688 struct nlmsghdr *nlh; 1688 struct nlmsghdr *nlh;
1689 int size = NLMSG_LENGTH(len); 1689 int size = NLMSG_LENGTH(len);
@@ -1692,7 +1692,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
1692 nlh->nlmsg_type = type; 1692 nlh->nlmsg_type = type;
1693 nlh->nlmsg_len = size; 1693 nlh->nlmsg_len = size;
1694 nlh->nlmsg_flags = flags; 1694 nlh->nlmsg_flags = flags;
1695 nlh->nlmsg_pid = pid; 1695 nlh->nlmsg_pid = portid;
1696 nlh->nlmsg_seq = seq; 1696 nlh->nlmsg_seq = seq;
1697 if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0) 1697 if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0)
1698 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size); 1698 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
@@ -1788,7 +1788,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1788 atomic_inc(&skb->users); 1788 atomic_inc(&skb->users);
1789 cb->skb = skb; 1789 cb->skb = skb;
1790 1790
1791 sk = netlink_lookup(sock_net(ssk), ssk->sk_protocol, NETLINK_CB(skb).pid); 1791 sk = netlink_lookup(sock_net(ssk), ssk->sk_protocol, NETLINK_CB(skb).portid);
1792 if (sk == NULL) { 1792 if (sk == NULL) {
1793 netlink_destroy_callback(cb); 1793 netlink_destroy_callback(cb);
1794 return -ECONNREFUSED; 1794 return -ECONNREFUSED;
@@ -1836,7 +1836,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
1836 1836
1837 sk = netlink_lookup(sock_net(in_skb->sk), 1837 sk = netlink_lookup(sock_net(in_skb->sk),
1838 in_skb->sk->sk_protocol, 1838 in_skb->sk->sk_protocol,
1839 NETLINK_CB(in_skb).pid); 1839 NETLINK_CB(in_skb).portid);
1840 if (sk) { 1840 if (sk) {
1841 sk->sk_err = ENOBUFS; 1841 sk->sk_err = ENOBUFS;
1842 sk->sk_error_report(sk); 1842 sk->sk_error_report(sk);
@@ -1845,12 +1845,12 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
1845 return; 1845 return;
1846 } 1846 }
1847 1847
1848 rep = __nlmsg_put(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, 1848 rep = __nlmsg_put(skb, NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
1849 NLMSG_ERROR, payload, 0); 1849 NLMSG_ERROR, payload, 0);
1850 errmsg = nlmsg_data(rep); 1850 errmsg = nlmsg_data(rep);
1851 errmsg->error = err; 1851 errmsg->error = err;
1852 memcpy(&errmsg->msg, nlh, err ? nlh->nlmsg_len : sizeof(*nlh)); 1852 memcpy(&errmsg->msg, nlh, err ? nlh->nlmsg_len : sizeof(*nlh));
1853 netlink_unicast(in_skb->sk, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 1853 netlink_unicast(in_skb->sk, skb, NETLINK_CB(in_skb).portid, MSG_DONTWAIT);
1854} 1854}
1855EXPORT_SYMBOL(netlink_ack); 1855EXPORT_SYMBOL(netlink_ack);
1856 1856
@@ -1900,33 +1900,33 @@ EXPORT_SYMBOL(netlink_rcv_skb);
1900 * nlmsg_notify - send a notification netlink message 1900 * nlmsg_notify - send a notification netlink message
1901 * @sk: netlink socket to use 1901 * @sk: netlink socket to use
1902 * @skb: notification message 1902 * @skb: notification message
1903 * @pid: destination netlink pid for reports or 0 1903 * @portid: destination netlink portid for reports or 0
1904 * @group: destination multicast group or 0 1904 * @group: destination multicast group or 0
1905 * @report: 1 to report back, 0 to disable 1905 * @report: 1 to report back, 0 to disable
1906 * @flags: allocation flags 1906 * @flags: allocation flags
1907 */ 1907 */
1908int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 pid, 1908int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid,
1909 unsigned int group, int report, gfp_t flags) 1909 unsigned int group, int report, gfp_t flags)
1910{ 1910{
1911 int err = 0; 1911 int err = 0;
1912 1912
1913 if (group) { 1913 if (group) {
1914 int exclude_pid = 0; 1914 int exclude_portid = 0;
1915 1915
1916 if (report) { 1916 if (report) {
1917 atomic_inc(&skb->users); 1917 atomic_inc(&skb->users);
1918 exclude_pid = pid; 1918 exclude_portid = portid;
1919 } 1919 }
1920 1920
1921 /* errors reported via destination sk->sk_err, but propagate 1921 /* errors reported via destination sk->sk_err, but propagate
1922 * delivery errors if NETLINK_BROADCAST_ERROR flag is set */ 1922 * delivery errors if NETLINK_BROADCAST_ERROR flag is set */
1923 err = nlmsg_multicast(sk, skb, exclude_pid, group, flags); 1923 err = nlmsg_multicast(sk, skb, exclude_portid, group, flags);
1924 } 1924 }
1925 1925
1926 if (report) { 1926 if (report) {
1927 int err2; 1927 int err2;
1928 1928
1929 err2 = nlmsg_unicast(sk, skb, pid); 1929 err2 = nlmsg_unicast(sk, skb, portid);
1930 if (!err || err == -ESRCH) 1930 if (!err || err == -ESRCH)
1931 err = err2; 1931 err = err2;
1932 } 1932 }
@@ -1951,7 +1951,7 @@ static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos)
1951 loff_t off = 0; 1951 loff_t off = 0;
1952 1952
1953 for (i = 0; i < MAX_LINKS; i++) { 1953 for (i = 0; i < MAX_LINKS; i++) {
1954 struct nl_pid_hash *hash = &nl_table[i].hash; 1954 struct nl_portid_hash *hash = &nl_table[i].hash;
1955 1955
1956 for (j = 0; j <= hash->mask; j++) { 1956 for (j = 0; j <= hash->mask; j++) {
1957 sk_for_each(s, node, &hash->table[j]) { 1957 sk_for_each(s, node, &hash->table[j]) {
@@ -1999,7 +1999,7 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1999 j = iter->hash_idx + 1; 1999 j = iter->hash_idx + 1;
2000 2000
2001 do { 2001 do {
2002 struct nl_pid_hash *hash = &nl_table[i].hash; 2002 struct nl_portid_hash *hash = &nl_table[i].hash;
2003 2003
2004 for (; j <= hash->mask; j++) { 2004 for (; j <= hash->mask; j++) {
2005 s = sk_head(&hash->table[j]); 2005 s = sk_head(&hash->table[j]);
@@ -2038,7 +2038,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
2038 seq_printf(seq, "%pK %-3d %-6d %08x %-8d %-8d %pK %-8d %-8d %-8lu\n", 2038 seq_printf(seq, "%pK %-3d %-6d %08x %-8d %-8d %pK %-8d %-8d %-8lu\n",
2039 s, 2039 s,
2040 s->sk_protocol, 2040 s->sk_protocol,
2041 nlk->pid, 2041 nlk->portid,
2042 nlk->groups ? (u32)nlk->groups[0] : 0, 2042 nlk->groups ? (u32)nlk->groups[0] : 0,
2043 sk_rmem_alloc_get(s), 2043 sk_rmem_alloc_get(s),
2044 sk_wmem_alloc_get(s), 2044 sk_wmem_alloc_get(s),
@@ -2183,12 +2183,12 @@ static int __init netlink_proto_init(void)
2183 order = get_bitmask_order(min(limit, (unsigned long)UINT_MAX)) - 1; 2183 order = get_bitmask_order(min(limit, (unsigned long)UINT_MAX)) - 1;
2184 2184
2185 for (i = 0; i < MAX_LINKS; i++) { 2185 for (i = 0; i < MAX_LINKS; i++) {
2186 struct nl_pid_hash *hash = &nl_table[i].hash; 2186 struct nl_portid_hash *hash = &nl_table[i].hash;
2187 2187
2188 hash->table = nl_pid_hash_zalloc(1 * sizeof(*hash->table)); 2188 hash->table = nl_portid_hash_zalloc(1 * sizeof(*hash->table));
2189 if (!hash->table) { 2189 if (!hash->table) {
2190 while (i-- > 0) 2190 while (i-- > 0)
2191 nl_pid_hash_free(nl_table[i].hash.table, 2191 nl_portid_hash_free(nl_table[i].hash.table,
2192 1 * sizeof(*hash->table)); 2192 1 * sizeof(*hash->table));
2193 kfree(nl_table); 2193 kfree(nl_table);
2194 goto panic; 2194 goto panic;
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 19288b7d6135..f2aabb6f4105 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -501,7 +501,7 @@ EXPORT_SYMBOL(genl_unregister_family);
501/** 501/**
502 * genlmsg_put - Add generic netlink header to netlink message 502 * genlmsg_put - Add generic netlink header to netlink message
503 * @skb: socket buffer holding the message 503 * @skb: socket buffer holding the message
504 * @pid: netlink pid the message is addressed to 504 * @portid: netlink portid the message is addressed to
505 * @seq: sequence number (usually the one of the sender) 505 * @seq: sequence number (usually the one of the sender)
506 * @family: generic netlink family 506 * @family: generic netlink family
507 * @flags: netlink message flags 507 * @flags: netlink message flags
@@ -509,13 +509,13 @@ EXPORT_SYMBOL(genl_unregister_family);
509 * 509 *
510 * Returns pointer to user specific header 510 * Returns pointer to user specific header
511 */ 511 */
512void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, 512void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
513 struct genl_family *family, int flags, u8 cmd) 513 struct genl_family *family, int flags, u8 cmd)
514{ 514{
515 struct nlmsghdr *nlh; 515 struct nlmsghdr *nlh;
516 struct genlmsghdr *hdr; 516 struct genlmsghdr *hdr;
517 517
518 nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN + 518 nlh = nlmsg_put(skb, portid, seq, family->id, GENL_HDRLEN +
519 family->hdrsize, flags); 519 family->hdrsize, flags);
520 if (nlh == NULL) 520 if (nlh == NULL)
521 return NULL; 521 return NULL;
@@ -585,7 +585,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
585 } 585 }
586 586
587 info.snd_seq = nlh->nlmsg_seq; 587 info.snd_seq = nlh->nlmsg_seq;
588 info.snd_pid = NETLINK_CB(skb).pid; 588 info.snd_portid = NETLINK_CB(skb).portid;
589 info.nlhdr = nlh; 589 info.nlhdr = nlh;
590 info.genlhdr = nlmsg_data(nlh); 590 info.genlhdr = nlmsg_data(nlh);
591 info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN; 591 info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN;
@@ -626,12 +626,12 @@ static struct genl_family genl_ctrl = {
626 .netnsok = true, 626 .netnsok = true,
627}; 627};
628 628
629static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq, 629static int ctrl_fill_info(struct genl_family *family, u32 portid, u32 seq,
630 u32 flags, struct sk_buff *skb, u8 cmd) 630 u32 flags, struct sk_buff *skb, u8 cmd)
631{ 631{
632 void *hdr; 632 void *hdr;
633 633
634 hdr = genlmsg_put(skb, pid, seq, &genl_ctrl, flags, cmd); 634 hdr = genlmsg_put(skb, portid, seq, &genl_ctrl, flags, cmd);
635 if (hdr == NULL) 635 if (hdr == NULL)
636 return -1; 636 return -1;
637 637
@@ -701,7 +701,7 @@ nla_put_failure:
701 return -EMSGSIZE; 701 return -EMSGSIZE;
702} 702}
703 703
704static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid, 704static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 portid,
705 u32 seq, u32 flags, struct sk_buff *skb, 705 u32 seq, u32 flags, struct sk_buff *skb,
706 u8 cmd) 706 u8 cmd)
707{ 707{
@@ -709,7 +709,7 @@ static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid,
709 struct nlattr *nla_grps; 709 struct nlattr *nla_grps;
710 struct nlattr *nest; 710 struct nlattr *nest;
711 711
712 hdr = genlmsg_put(skb, pid, seq, &genl_ctrl, flags, cmd); 712 hdr = genlmsg_put(skb, portid, seq, &genl_ctrl, flags, cmd);
713 if (hdr == NULL) 713 if (hdr == NULL)
714 return -1; 714 return -1;
715 715
@@ -756,7 +756,7 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
756 continue; 756 continue;
757 if (++n < fams_to_skip) 757 if (++n < fams_to_skip)
758 continue; 758 continue;
759 if (ctrl_fill_info(rt, NETLINK_CB(cb->skb).pid, 759 if (ctrl_fill_info(rt, NETLINK_CB(cb->skb).portid,
760 cb->nlh->nlmsg_seq, NLM_F_MULTI, 760 cb->nlh->nlmsg_seq, NLM_F_MULTI,
761 skb, CTRL_CMD_NEWFAMILY) < 0) 761 skb, CTRL_CMD_NEWFAMILY) < 0)
762 goto errout; 762 goto errout;
@@ -773,7 +773,7 @@ errout:
773} 773}
774 774
775static struct sk_buff *ctrl_build_family_msg(struct genl_family *family, 775static struct sk_buff *ctrl_build_family_msg(struct genl_family *family,
776 u32 pid, int seq, u8 cmd) 776 u32 portid, int seq, u8 cmd)
777{ 777{
778 struct sk_buff *skb; 778 struct sk_buff *skb;
779 int err; 779 int err;
@@ -782,7 +782,7 @@ static struct sk_buff *ctrl_build_family_msg(struct genl_family *family,
782 if (skb == NULL) 782 if (skb == NULL)
783 return ERR_PTR(-ENOBUFS); 783 return ERR_PTR(-ENOBUFS);
784 784
785 err = ctrl_fill_info(family, pid, seq, 0, skb, cmd); 785 err = ctrl_fill_info(family, portid, seq, 0, skb, cmd);
786 if (err < 0) { 786 if (err < 0) {
787 nlmsg_free(skb); 787 nlmsg_free(skb);
788 return ERR_PTR(err); 788 return ERR_PTR(err);
@@ -792,7 +792,7 @@ static struct sk_buff *ctrl_build_family_msg(struct genl_family *family,
792} 792}
793 793
794static struct sk_buff *ctrl_build_mcgrp_msg(struct genl_multicast_group *grp, 794static struct sk_buff *ctrl_build_mcgrp_msg(struct genl_multicast_group *grp,
795 u32 pid, int seq, u8 cmd) 795 u32 portid, int seq, u8 cmd)
796{ 796{
797 struct sk_buff *skb; 797 struct sk_buff *skb;
798 int err; 798 int err;
@@ -801,7 +801,7 @@ static struct sk_buff *ctrl_build_mcgrp_msg(struct genl_multicast_group *grp,
801 if (skb == NULL) 801 if (skb == NULL)
802 return ERR_PTR(-ENOBUFS); 802 return ERR_PTR(-ENOBUFS);
803 803
804 err = ctrl_fill_mcgrp_info(grp, pid, seq, 0, skb, cmd); 804 err = ctrl_fill_mcgrp_info(grp, portid, seq, 0, skb, cmd);
805 if (err < 0) { 805 if (err < 0) {
806 nlmsg_free(skb); 806 nlmsg_free(skb);
807 return ERR_PTR(err); 807 return ERR_PTR(err);
@@ -853,7 +853,7 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
853 return -ENOENT; 853 return -ENOENT;
854 } 854 }
855 855
856 msg = ctrl_build_family_msg(res, info->snd_pid, info->snd_seq, 856 msg = ctrl_build_family_msg(res, info->snd_portid, info->snd_seq,
857 CTRL_CMD_NEWFAMILY); 857 CTRL_CMD_NEWFAMILY);
858 if (IS_ERR(msg)) 858 if (IS_ERR(msg))
859 return PTR_ERR(msg); 859 return PTR_ERR(msg);
@@ -971,7 +971,7 @@ problem:
971 971
972subsys_initcall(genl_init); 972subsys_initcall(genl_init);
973 973
974static int genlmsg_mcast(struct sk_buff *skb, u32 pid, unsigned long group, 974static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
975 gfp_t flags) 975 gfp_t flags)
976{ 976{
977 struct sk_buff *tmp; 977 struct sk_buff *tmp;
@@ -986,7 +986,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 pid, unsigned long group,
986 goto error; 986 goto error;
987 } 987 }
988 err = nlmsg_multicast(prev->genl_sock, tmp, 988 err = nlmsg_multicast(prev->genl_sock, tmp,
989 pid, group, flags); 989 portid, group, flags);
990 if (err) 990 if (err)
991 goto error; 991 goto error;
992 } 992 }
@@ -994,20 +994,20 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 pid, unsigned long group,
994 prev = net; 994 prev = net;
995 } 995 }
996 996
997 return nlmsg_multicast(prev->genl_sock, skb, pid, group, flags); 997 return nlmsg_multicast(prev->genl_sock, skb, portid, group, flags);
998 error: 998 error:
999 kfree_skb(skb); 999 kfree_skb(skb);
1000 return err; 1000 return err;
1001} 1001}
1002 1002
1003int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid, unsigned int group, 1003int genlmsg_multicast_allns(struct sk_buff *skb, u32 portid, unsigned int group,
1004 gfp_t flags) 1004 gfp_t flags)
1005{ 1005{
1006 return genlmsg_mcast(skb, pid, group, flags); 1006 return genlmsg_mcast(skb, portid, group, flags);
1007} 1007}
1008EXPORT_SYMBOL(genlmsg_multicast_allns); 1008EXPORT_SYMBOL(genlmsg_multicast_allns);
1009 1009
1010void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, 1010void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, u32 group,
1011 struct nlmsghdr *nlh, gfp_t flags) 1011 struct nlmsghdr *nlh, gfp_t flags)
1012{ 1012{
1013 struct sock *sk = net->genl_sock; 1013 struct sock *sk = net->genl_sock;
@@ -1016,6 +1016,6 @@ void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
1016 if (nlh) 1016 if (nlh)
1017 report = nlmsg_report(nlh); 1017 report = nlmsg_report(nlh);
1018 1018
1019 nlmsg_notify(sk, skb, pid, group, report, flags); 1019 nlmsg_notify(sk, skb, portid, group, report, flags);
1020} 1020}
1021EXPORT_SYMBOL(genl_notify); 1021EXPORT_SYMBOL(genl_notify);
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 4c51714ee741..4bbb70e32d1e 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -58,7 +58,7 @@ static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,
58{ 58{
59 void *hdr; 59 void *hdr;
60 60
61 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 61 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
62 &nfc_genl_family, flags, NFC_CMD_GET_TARGET); 62 &nfc_genl_family, flags, NFC_CMD_GET_TARGET);
63 if (!hdr) 63 if (!hdr)
64 return -EMSGSIZE; 64 return -EMSGSIZE;
@@ -165,7 +165,7 @@ int nfc_genl_targets_found(struct nfc_dev *dev)
165 struct sk_buff *msg; 165 struct sk_buff *msg;
166 void *hdr; 166 void *hdr;
167 167
168 dev->genl_data.poll_req_pid = 0; 168 dev->genl_data.poll_req_portid = 0;
169 169
170 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); 170 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
171 if (!msg) 171 if (!msg)
@@ -347,13 +347,13 @@ free_msg:
347} 347}
348 348
349static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev, 349static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev,
350 u32 pid, u32 seq, 350 u32 portid, u32 seq,
351 struct netlink_callback *cb, 351 struct netlink_callback *cb,
352 int flags) 352 int flags)
353{ 353{
354 void *hdr; 354 void *hdr;
355 355
356 hdr = genlmsg_put(msg, pid, seq, &nfc_genl_family, flags, 356 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags,
357 NFC_CMD_GET_DEVICE); 357 NFC_CMD_GET_DEVICE);
358 if (!hdr) 358 if (!hdr)
359 return -EMSGSIZE; 359 return -EMSGSIZE;
@@ -401,7 +401,7 @@ static int nfc_genl_dump_devices(struct sk_buff *skb,
401 while (dev) { 401 while (dev) {
402 int rc; 402 int rc;
403 403
404 rc = nfc_genl_send_device(skb, dev, NETLINK_CB(cb->skb).pid, 404 rc = nfc_genl_send_device(skb, dev, NETLINK_CB(cb->skb).portid,
405 cb->nlh->nlmsg_seq, cb, NLM_F_MULTI); 405 cb->nlh->nlmsg_seq, cb, NLM_F_MULTI);
406 if (rc < 0) 406 if (rc < 0)
407 break; 407 break;
@@ -520,7 +520,7 @@ static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info)
520 goto out_putdev; 520 goto out_putdev;
521 } 521 }
522 522
523 rc = nfc_genl_send_device(msg, dev, info->snd_pid, info->snd_seq, 523 rc = nfc_genl_send_device(msg, dev, info->snd_portid, info->snd_seq,
524 NULL, 0); 524 NULL, 0);
525 if (rc < 0) 525 if (rc < 0)
526 goto out_free; 526 goto out_free;
@@ -611,7 +611,7 @@ static int nfc_genl_start_poll(struct sk_buff *skb, struct genl_info *info)
611 611
612 rc = nfc_start_poll(dev, im_protocols, tm_protocols); 612 rc = nfc_start_poll(dev, im_protocols, tm_protocols);
613 if (!rc) 613 if (!rc)
614 dev->genl_data.poll_req_pid = info->snd_pid; 614 dev->genl_data.poll_req_portid = info->snd_portid;
615 615
616 mutex_unlock(&dev->genl_data.genl_data_mutex); 616 mutex_unlock(&dev->genl_data.genl_data_mutex);
617 617
@@ -645,13 +645,13 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
645 645
646 mutex_lock(&dev->genl_data.genl_data_mutex); 646 mutex_lock(&dev->genl_data.genl_data_mutex);
647 647
648 if (dev->genl_data.poll_req_pid != info->snd_pid) { 648 if (dev->genl_data.poll_req_portid != info->snd_portid) {
649 rc = -EBUSY; 649 rc = -EBUSY;
650 goto out; 650 goto out;
651 } 651 }
652 652
653 rc = nfc_stop_poll(dev); 653 rc = nfc_stop_poll(dev);
654 dev->genl_data.poll_req_pid = 0; 654 dev->genl_data.poll_req_portid = 0;
655 655
656out: 656out:
657 mutex_unlock(&dev->genl_data.genl_data_mutex); 657 mutex_unlock(&dev->genl_data.genl_data_mutex);
@@ -771,15 +771,15 @@ static int nfc_genl_rcv_nl_event(struct notifier_block *this,
771 if (event != NETLINK_URELEASE || n->protocol != NETLINK_GENERIC) 771 if (event != NETLINK_URELEASE || n->protocol != NETLINK_GENERIC)
772 goto out; 772 goto out;
773 773
774 pr_debug("NETLINK_URELEASE event from id %d\n", n->pid); 774 pr_debug("NETLINK_URELEASE event from id %d\n", n->portid);
775 775
776 nfc_device_iter_init(&iter); 776 nfc_device_iter_init(&iter);
777 dev = nfc_device_iter_next(&iter); 777 dev = nfc_device_iter_next(&iter);
778 778
779 while (dev) { 779 while (dev) {
780 if (dev->genl_data.poll_req_pid == n->pid) { 780 if (dev->genl_data.poll_req_portid == n->portid) {
781 nfc_stop_poll(dev); 781 nfc_stop_poll(dev);
782 dev->genl_data.poll_req_pid = 0; 782 dev->genl_data.poll_req_portid = 0;
783 } 783 }
784 dev = nfc_device_iter_next(&iter); 784 dev = nfc_device_iter_next(&iter);
785 } 785 }
@@ -792,7 +792,7 @@ out:
792 792
793void nfc_genl_data_init(struct nfc_genl_data *genl_data) 793void nfc_genl_data_init(struct nfc_genl_data *genl_data)
794{ 794{
795 genl_data->poll_req_pid = 0; 795 genl_data->poll_req_portid = 0;
796 mutex_init(&genl_data->genl_data_mutex); 796 mutex_init(&genl_data->genl_data_mutex);
797} 797}
798 798
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 0da687769f56..c7425f32e7db 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -286,7 +286,7 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,
286 upcall.cmd = OVS_PACKET_CMD_ACTION; 286 upcall.cmd = OVS_PACKET_CMD_ACTION;
287 upcall.key = &OVS_CB(skb)->flow->key; 287 upcall.key = &OVS_CB(skb)->flow->key;
288 upcall.userdata = NULL; 288 upcall.userdata = NULL;
289 upcall.pid = 0; 289 upcall.portid = 0;
290 290
291 for (a = nla_data(attr), rem = nla_len(attr); rem > 0; 291 for (a = nla_data(attr), rem = nla_len(attr); rem > 0;
292 a = nla_next(a, &rem)) { 292 a = nla_next(a, &rem)) {
@@ -296,7 +296,7 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,
296 break; 296 break;
297 297
298 case OVS_USERSPACE_ATTR_PID: 298 case OVS_USERSPACE_ATTR_PID:
299 upcall.pid = nla_get_u32(a); 299 upcall.portid = nla_get_u32(a);
300 break; 300 break;
301 } 301 }
302 } 302 }
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 105a0b5adc51..56327e877ed9 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -225,7 +225,7 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
225 upcall.cmd = OVS_PACKET_CMD_MISS; 225 upcall.cmd = OVS_PACKET_CMD_MISS;
226 upcall.key = &key; 226 upcall.key = &key;
227 upcall.userdata = NULL; 227 upcall.userdata = NULL;
228 upcall.pid = p->upcall_pid; 228 upcall.portid = p->upcall_portid;
229 ovs_dp_upcall(dp, skb, &upcall); 229 ovs_dp_upcall(dp, skb, &upcall);
230 consume_skb(skb); 230 consume_skb(skb);
231 stats_counter = &stats->n_missed; 231 stats_counter = &stats->n_missed;
@@ -261,7 +261,7 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
261 int dp_ifindex; 261 int dp_ifindex;
262 int err; 262 int err;
263 263
264 if (upcall_info->pid == 0) { 264 if (upcall_info->portid == 0) {
265 err = -ENOTCONN; 265 err = -ENOTCONN;
266 goto err; 266 goto err;
267 } 267 }
@@ -395,7 +395,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
395 395
396 skb_copy_and_csum_dev(skb, nla_data(nla)); 396 skb_copy_and_csum_dev(skb, nla_data(nla));
397 397
398 err = genlmsg_unicast(net, user_skb, upcall_info->pid); 398 err = genlmsg_unicast(net, user_skb, upcall_info->portid);
399 399
400out: 400out:
401 kfree_skb(nskb); 401 kfree_skb(nskb);
@@ -780,7 +780,7 @@ static struct genl_multicast_group ovs_dp_flow_multicast_group = {
780 780
781/* Called with genl_lock. */ 781/* Called with genl_lock. */
782static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp, 782static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
783 struct sk_buff *skb, u32 pid, 783 struct sk_buff *skb, u32 portid,
784 u32 seq, u32 flags, u8 cmd) 784 u32 seq, u32 flags, u8 cmd)
785{ 785{
786 const int skb_orig_len = skb->len; 786 const int skb_orig_len = skb->len;
@@ -795,7 +795,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
795 sf_acts = rcu_dereference_protected(flow->sf_acts, 795 sf_acts = rcu_dereference_protected(flow->sf_acts,
796 lockdep_genl_is_held()); 796 lockdep_genl_is_held());
797 797
798 ovs_header = genlmsg_put(skb, pid, seq, &dp_flow_genl_family, flags, cmd); 798 ovs_header = genlmsg_put(skb, portid, seq, &dp_flow_genl_family, flags, cmd);
799 if (!ovs_header) 799 if (!ovs_header)
800 return -EMSGSIZE; 800 return -EMSGSIZE;
801 801
@@ -879,7 +879,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(struct sw_flow *flow)
879 879
880static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow, 880static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow,
881 struct datapath *dp, 881 struct datapath *dp,
882 u32 pid, u32 seq, u8 cmd) 882 u32 portid, u32 seq, u8 cmd)
883{ 883{
884 struct sk_buff *skb; 884 struct sk_buff *skb;
885 int retval; 885 int retval;
@@ -888,7 +888,7 @@ static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow,
888 if (!skb) 888 if (!skb)
889 return ERR_PTR(-ENOMEM); 889 return ERR_PTR(-ENOMEM);
890 890
891 retval = ovs_flow_cmd_fill_info(flow, dp, skb, pid, seq, 0, cmd); 891 retval = ovs_flow_cmd_fill_info(flow, dp, skb, portid, seq, 0, cmd);
892 BUG_ON(retval < 0); 892 BUG_ON(retval < 0);
893 return skb; 893 return skb;
894} 894}
@@ -970,7 +970,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
970 flow->hash = ovs_flow_hash(&key, key_len); 970 flow->hash = ovs_flow_hash(&key, key_len);
971 ovs_flow_tbl_insert(table, flow); 971 ovs_flow_tbl_insert(table, flow);
972 972
973 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, 973 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
974 info->snd_seq, 974 info->snd_seq,
975 OVS_FLOW_CMD_NEW); 975 OVS_FLOW_CMD_NEW);
976 } else { 976 } else {
@@ -1008,7 +1008,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
1008 ovs_flow_deferred_free_acts(old_acts); 1008 ovs_flow_deferred_free_acts(old_acts);
1009 } 1009 }
1010 1010
1011 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, 1011 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
1012 info->snd_seq, OVS_FLOW_CMD_NEW); 1012 info->snd_seq, OVS_FLOW_CMD_NEW);
1013 1013
1014 /* Clear stats. */ 1014 /* Clear stats. */
@@ -1020,7 +1020,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
1020 } 1020 }
1021 1021
1022 if (!IS_ERR(reply)) 1022 if (!IS_ERR(reply))
1023 genl_notify(reply, genl_info_net(info), info->snd_pid, 1023 genl_notify(reply, genl_info_net(info), info->snd_portid,
1024 ovs_dp_flow_multicast_group.id, info->nlhdr, 1024 ovs_dp_flow_multicast_group.id, info->nlhdr,
1025 GFP_KERNEL); 1025 GFP_KERNEL);
1026 else 1026 else
@@ -1061,7 +1061,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
1061 if (!flow) 1061 if (!flow)
1062 return -ENOENT; 1062 return -ENOENT;
1063 1063
1064 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, 1064 reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
1065 info->snd_seq, OVS_FLOW_CMD_NEW); 1065 info->snd_seq, OVS_FLOW_CMD_NEW);
1066 if (IS_ERR(reply)) 1066 if (IS_ERR(reply))
1067 return PTR_ERR(reply); 1067 return PTR_ERR(reply);
@@ -1103,13 +1103,13 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
1103 1103
1104 ovs_flow_tbl_remove(table, flow); 1104 ovs_flow_tbl_remove(table, flow);
1105 1105
1106 err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_pid, 1106 err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_portid,
1107 info->snd_seq, 0, OVS_FLOW_CMD_DEL); 1107 info->snd_seq, 0, OVS_FLOW_CMD_DEL);
1108 BUG_ON(err < 0); 1108 BUG_ON(err < 0);
1109 1109
1110 ovs_flow_deferred_free(flow); 1110 ovs_flow_deferred_free(flow);
1111 1111
1112 genl_notify(reply, genl_info_net(info), info->snd_pid, 1112 genl_notify(reply, genl_info_net(info), info->snd_portid,
1113 ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL); 1113 ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL);
1114 return 0; 1114 return 0;
1115} 1115}
@@ -1137,7 +1137,7 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
1137 break; 1137 break;
1138 1138
1139 if (ovs_flow_cmd_fill_info(flow, dp, skb, 1139 if (ovs_flow_cmd_fill_info(flow, dp, skb,
1140 NETLINK_CB(cb->skb).pid, 1140 NETLINK_CB(cb->skb).portid,
1141 cb->nlh->nlmsg_seq, NLM_F_MULTI, 1141 cb->nlh->nlmsg_seq, NLM_F_MULTI,
1142 OVS_FLOW_CMD_NEW) < 0) 1142 OVS_FLOW_CMD_NEW) < 0)
1143 break; 1143 break;
@@ -1191,13 +1191,13 @@ static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
1191}; 1191};
1192 1192
1193static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb, 1193static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb,
1194 u32 pid, u32 seq, u32 flags, u8 cmd) 1194 u32 portid, u32 seq, u32 flags, u8 cmd)
1195{ 1195{
1196 struct ovs_header *ovs_header; 1196 struct ovs_header *ovs_header;
1197 struct ovs_dp_stats dp_stats; 1197 struct ovs_dp_stats dp_stats;
1198 int err; 1198 int err;
1199 1199
1200 ovs_header = genlmsg_put(skb, pid, seq, &dp_datapath_genl_family, 1200 ovs_header = genlmsg_put(skb, portid, seq, &dp_datapath_genl_family,
1201 flags, cmd); 1201 flags, cmd);
1202 if (!ovs_header) 1202 if (!ovs_header)
1203 goto error; 1203 goto error;
@@ -1222,7 +1222,7 @@ error:
1222 return -EMSGSIZE; 1222 return -EMSGSIZE;
1223} 1223}
1224 1224
1225static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid, 1225static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 portid,
1226 u32 seq, u8 cmd) 1226 u32 seq, u8 cmd)
1227{ 1227{
1228 struct sk_buff *skb; 1228 struct sk_buff *skb;
@@ -1232,7 +1232,7 @@ static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid,
1232 if (!skb) 1232 if (!skb)
1233 return ERR_PTR(-ENOMEM); 1233 return ERR_PTR(-ENOMEM);
1234 1234
1235 retval = ovs_dp_cmd_fill_info(dp, skb, pid, seq, 0, cmd); 1235 retval = ovs_dp_cmd_fill_info(dp, skb, portid, seq, 0, cmd);
1236 if (retval < 0) { 1236 if (retval < 0) {
1237 kfree_skb(skb); 1237 kfree_skb(skb);
1238 return ERR_PTR(retval); 1238 return ERR_PTR(retval);
@@ -1311,7 +1311,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1311 parms.options = NULL; 1311 parms.options = NULL;
1312 parms.dp = dp; 1312 parms.dp = dp;
1313 parms.port_no = OVSP_LOCAL; 1313 parms.port_no = OVSP_LOCAL;
1314 parms.upcall_pid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]); 1314 parms.upcall_portid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]);
1315 1315
1316 vport = new_vport(&parms); 1316 vport = new_vport(&parms);
1317 if (IS_ERR(vport)) { 1317 if (IS_ERR(vport)) {
@@ -1322,7 +1322,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1322 goto err_destroy_ports_array; 1322 goto err_destroy_ports_array;
1323 } 1323 }
1324 1324
1325 reply = ovs_dp_cmd_build_info(dp, info->snd_pid, 1325 reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
1326 info->snd_seq, OVS_DP_CMD_NEW); 1326 info->snd_seq, OVS_DP_CMD_NEW);
1327 err = PTR_ERR(reply); 1327 err = PTR_ERR(reply);
1328 if (IS_ERR(reply)) 1328 if (IS_ERR(reply))
@@ -1332,7 +1332,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1332 list_add_tail(&dp->list_node, &ovs_net->dps); 1332 list_add_tail(&dp->list_node, &ovs_net->dps);
1333 rtnl_unlock(); 1333 rtnl_unlock();
1334 1334
1335 genl_notify(reply, genl_info_net(info), info->snd_pid, 1335 genl_notify(reply, genl_info_net(info), info->snd_portid,
1336 ovs_dp_datapath_multicast_group.id, info->nlhdr, 1336 ovs_dp_datapath_multicast_group.id, info->nlhdr,
1337 GFP_KERNEL); 1337 GFP_KERNEL);
1338 return 0; 1338 return 0;
@@ -1394,7 +1394,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
1394 if (IS_ERR(dp)) 1394 if (IS_ERR(dp))
1395 return err; 1395 return err;
1396 1396
1397 reply = ovs_dp_cmd_build_info(dp, info->snd_pid, 1397 reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
1398 info->snd_seq, OVS_DP_CMD_DEL); 1398 info->snd_seq, OVS_DP_CMD_DEL);
1399 err = PTR_ERR(reply); 1399 err = PTR_ERR(reply);
1400 if (IS_ERR(reply)) 1400 if (IS_ERR(reply))
@@ -1402,7 +1402,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
1402 1402
1403 __dp_destroy(dp); 1403 __dp_destroy(dp);
1404 1404
1405 genl_notify(reply, genl_info_net(info), info->snd_pid, 1405 genl_notify(reply, genl_info_net(info), info->snd_portid,
1406 ovs_dp_datapath_multicast_group.id, info->nlhdr, 1406 ovs_dp_datapath_multicast_group.id, info->nlhdr,
1407 GFP_KERNEL); 1407 GFP_KERNEL);
1408 1408
@@ -1419,7 +1419,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
1419 if (IS_ERR(dp)) 1419 if (IS_ERR(dp))
1420 return PTR_ERR(dp); 1420 return PTR_ERR(dp);
1421 1421
1422 reply = ovs_dp_cmd_build_info(dp, info->snd_pid, 1422 reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
1423 info->snd_seq, OVS_DP_CMD_NEW); 1423 info->snd_seq, OVS_DP_CMD_NEW);
1424 if (IS_ERR(reply)) { 1424 if (IS_ERR(reply)) {
1425 err = PTR_ERR(reply); 1425 err = PTR_ERR(reply);
@@ -1428,7 +1428,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
1428 return 0; 1428 return 0;
1429 } 1429 }
1430 1430
1431 genl_notify(reply, genl_info_net(info), info->snd_pid, 1431 genl_notify(reply, genl_info_net(info), info->snd_portid,
1432 ovs_dp_datapath_multicast_group.id, info->nlhdr, 1432 ovs_dp_datapath_multicast_group.id, info->nlhdr,
1433 GFP_KERNEL); 1433 GFP_KERNEL);
1434 1434
@@ -1444,7 +1444,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info)
1444 if (IS_ERR(dp)) 1444 if (IS_ERR(dp))
1445 return PTR_ERR(dp); 1445 return PTR_ERR(dp);
1446 1446
1447 reply = ovs_dp_cmd_build_info(dp, info->snd_pid, 1447 reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
1448 info->snd_seq, OVS_DP_CMD_NEW); 1448 info->snd_seq, OVS_DP_CMD_NEW);
1449 if (IS_ERR(reply)) 1449 if (IS_ERR(reply))
1450 return PTR_ERR(reply); 1450 return PTR_ERR(reply);
@@ -1461,7 +1461,7 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
1461 1461
1462 list_for_each_entry(dp, &ovs_net->dps, list_node) { 1462 list_for_each_entry(dp, &ovs_net->dps, list_node) {
1463 if (i >= skip && 1463 if (i >= skip &&
1464 ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).pid, 1464 ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).portid,
1465 cb->nlh->nlmsg_seq, NLM_F_MULTI, 1465 cb->nlh->nlmsg_seq, NLM_F_MULTI,
1466 OVS_DP_CMD_NEW) < 0) 1466 OVS_DP_CMD_NEW) < 0)
1467 break; 1467 break;
@@ -1521,13 +1521,13 @@ struct genl_multicast_group ovs_dp_vport_multicast_group = {
1521 1521
1522/* Called with RTNL lock or RCU read lock. */ 1522/* Called with RTNL lock or RCU read lock. */
1523static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, 1523static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
1524 u32 pid, u32 seq, u32 flags, u8 cmd) 1524 u32 portid, u32 seq, u32 flags, u8 cmd)
1525{ 1525{
1526 struct ovs_header *ovs_header; 1526 struct ovs_header *ovs_header;
1527 struct ovs_vport_stats vport_stats; 1527 struct ovs_vport_stats vport_stats;
1528 int err; 1528 int err;
1529 1529
1530 ovs_header = genlmsg_put(skb, pid, seq, &dp_vport_genl_family, 1530 ovs_header = genlmsg_put(skb, portid, seq, &dp_vport_genl_family,
1531 flags, cmd); 1531 flags, cmd);
1532 if (!ovs_header) 1532 if (!ovs_header)
1533 return -EMSGSIZE; 1533 return -EMSGSIZE;
@@ -1537,7 +1537,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
1537 if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) || 1537 if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) ||
1538 nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) || 1538 nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) ||
1539 nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) || 1539 nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) ||
1540 nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_pid)) 1540 nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_portid))
1541 goto nla_put_failure; 1541 goto nla_put_failure;
1542 1542
1543 ovs_vport_get_stats(vport, &vport_stats); 1543 ovs_vport_get_stats(vport, &vport_stats);
@@ -1559,7 +1559,7 @@ error:
1559} 1559}
1560 1560
1561/* Called with RTNL lock or RCU read lock. */ 1561/* Called with RTNL lock or RCU read lock. */
1562struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid, 1562struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid,
1563 u32 seq, u8 cmd) 1563 u32 seq, u8 cmd)
1564{ 1564{
1565 struct sk_buff *skb; 1565 struct sk_buff *skb;
@@ -1569,7 +1569,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid,
1569 if (!skb) 1569 if (!skb)
1570 return ERR_PTR(-ENOMEM); 1570 return ERR_PTR(-ENOMEM);
1571 1571
1572 retval = ovs_vport_cmd_fill_info(vport, skb, pid, seq, 0, cmd); 1572 retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd);
1573 if (retval < 0) { 1573 if (retval < 0) {
1574 kfree_skb(skb); 1574 kfree_skb(skb);
1575 return ERR_PTR(retval); 1575 return ERR_PTR(retval);
@@ -1661,21 +1661,21 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
1661 parms.options = a[OVS_VPORT_ATTR_OPTIONS]; 1661 parms.options = a[OVS_VPORT_ATTR_OPTIONS];
1662 parms.dp = dp; 1662 parms.dp = dp;
1663 parms.port_no = port_no; 1663 parms.port_no = port_no;
1664 parms.upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); 1664 parms.upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
1665 1665
1666 vport = new_vport(&parms); 1666 vport = new_vport(&parms);
1667 err = PTR_ERR(vport); 1667 err = PTR_ERR(vport);
1668 if (IS_ERR(vport)) 1668 if (IS_ERR(vport))
1669 goto exit_unlock; 1669 goto exit_unlock;
1670 1670
1671 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1671 reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
1672 OVS_VPORT_CMD_NEW); 1672 OVS_VPORT_CMD_NEW);
1673 if (IS_ERR(reply)) { 1673 if (IS_ERR(reply)) {
1674 err = PTR_ERR(reply); 1674 err = PTR_ERR(reply);
1675 ovs_dp_detach_port(vport); 1675 ovs_dp_detach_port(vport);
1676 goto exit_unlock; 1676 goto exit_unlock;
1677 } 1677 }
1678 genl_notify(reply, genl_info_net(info), info->snd_pid, 1678 genl_notify(reply, genl_info_net(info), info->snd_portid,
1679 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); 1679 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
1680 1680
1681exit_unlock: 1681exit_unlock:
@@ -1707,9 +1707,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1707 if (err) 1707 if (err)
1708 goto exit_unlock; 1708 goto exit_unlock;
1709 if (a[OVS_VPORT_ATTR_UPCALL_PID]) 1709 if (a[OVS_VPORT_ATTR_UPCALL_PID])
1710 vport->upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); 1710 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
1711 1711
1712 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1712 reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
1713 OVS_VPORT_CMD_NEW); 1713 OVS_VPORT_CMD_NEW);
1714 if (IS_ERR(reply)) { 1714 if (IS_ERR(reply)) {
1715 netlink_set_err(sock_net(skb->sk)->genl_sock, 0, 1715 netlink_set_err(sock_net(skb->sk)->genl_sock, 0,
@@ -1717,7 +1717,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1717 goto exit_unlock; 1717 goto exit_unlock;
1718 } 1718 }
1719 1719
1720 genl_notify(reply, genl_info_net(info), info->snd_pid, 1720 genl_notify(reply, genl_info_net(info), info->snd_portid,
1721 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); 1721 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
1722 1722
1723exit_unlock: 1723exit_unlock:
@@ -1743,7 +1743,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
1743 goto exit_unlock; 1743 goto exit_unlock;
1744 } 1744 }
1745 1745
1746 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1746 reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
1747 OVS_VPORT_CMD_DEL); 1747 OVS_VPORT_CMD_DEL);
1748 err = PTR_ERR(reply); 1748 err = PTR_ERR(reply);
1749 if (IS_ERR(reply)) 1749 if (IS_ERR(reply))
@@ -1751,7 +1751,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
1751 1751
1752 ovs_dp_detach_port(vport); 1752 ovs_dp_detach_port(vport);
1753 1753
1754 genl_notify(reply, genl_info_net(info), info->snd_pid, 1754 genl_notify(reply, genl_info_net(info), info->snd_portid,
1755 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); 1755 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
1756 1756
1757exit_unlock: 1757exit_unlock:
@@ -1773,7 +1773,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info)
1773 if (IS_ERR(vport)) 1773 if (IS_ERR(vport))
1774 goto exit_unlock; 1774 goto exit_unlock;
1775 1775
1776 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1776 reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
1777 OVS_VPORT_CMD_NEW); 1777 OVS_VPORT_CMD_NEW);
1778 err = PTR_ERR(reply); 1778 err = PTR_ERR(reply);
1779 if (IS_ERR(reply)) 1779 if (IS_ERR(reply))
@@ -1808,7 +1808,7 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
1808 hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) { 1808 hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) {
1809 if (j >= skip && 1809 if (j >= skip &&
1810 ovs_vport_cmd_fill_info(vport, skb, 1810 ovs_vport_cmd_fill_info(vport, skb,
1811 NETLINK_CB(cb->skb).pid, 1811 NETLINK_CB(cb->skb).portid,
1812 cb->nlh->nlmsg_seq, 1812 cb->nlh->nlmsg_seq,
1813 NLM_F_MULTI, 1813 NLM_F_MULTI,
1814 OVS_VPORT_CMD_NEW) < 0) 1814 OVS_VPORT_CMD_NEW) < 0)
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
index 129ec5480758..031dfbf37c93 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -129,7 +129,7 @@ struct dp_upcall_info {
129 u8 cmd; 129 u8 cmd;
130 const struct sw_flow_key *key; 130 const struct sw_flow_key *key;
131 const struct nlattr *userdata; 131 const struct nlattr *userdata;
132 u32 pid; 132 u32 portid;
133}; 133};
134 134
135static inline struct net *ovs_dp_get_net(struct datapath *dp) 135static inline struct net *ovs_dp_get_net(struct datapath *dp)
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 1abd9609ba78..9055dd698c70 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -125,7 +125,7 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
125 125
126 vport->dp = parms->dp; 126 vport->dp = parms->dp;
127 vport->port_no = parms->port_no; 127 vport->port_no = parms->port_no;
128 vport->upcall_pid = parms->upcall_pid; 128 vport->upcall_portid = parms->upcall_portid;
129 vport->ops = ops; 129 vport->ops = ops;
130 INIT_HLIST_NODE(&vport->dp_hash_node); 130 INIT_HLIST_NODE(&vport->dp_hash_node);
131 131
diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h
index c56e4836e93b..3f7961ea3c56 100644
--- a/net/openvswitch/vport.h
+++ b/net/openvswitch/vport.h
@@ -70,7 +70,7 @@ struct vport_err_stats {
70 * @rcu: RCU callback head for deferred destruction. 70 * @rcu: RCU callback head for deferred destruction.
71 * @port_no: Index into @dp's @ports array. 71 * @port_no: Index into @dp's @ports array.
72 * @dp: Datapath to which this port belongs. 72 * @dp: Datapath to which this port belongs.
73 * @upcall_pid: The Netlink port to use for packets received on this port that 73 * @upcall_portid: The Netlink port to use for packets received on this port that
74 * miss the flow table. 74 * miss the flow table.
75 * @hash_node: Element in @dev_table hash table in vport.c. 75 * @hash_node: Element in @dev_table hash table in vport.c.
76 * @dp_hash_node: Element in @datapath->ports hash table in datapath.c. 76 * @dp_hash_node: Element in @datapath->ports hash table in datapath.c.
@@ -83,7 +83,7 @@ struct vport {
83 struct rcu_head rcu; 83 struct rcu_head rcu;
84 u16 port_no; 84 u16 port_no;
85 struct datapath *dp; 85 struct datapath *dp;
86 u32 upcall_pid; 86 u32 upcall_portid;
87 87
88 struct hlist_node hash_node; 88 struct hlist_node hash_node;
89 struct hlist_node dp_hash_node; 89 struct hlist_node dp_hash_node;
@@ -113,7 +113,7 @@ struct vport_parms {
113 /* For ovs_vport_alloc(). */ 113 /* For ovs_vport_alloc(). */
114 struct datapath *dp; 114 struct datapath *dp;
115 u16 port_no; 115 u16 port_no;
116 u32 upcall_pid; 116 u32 upcall_portid;
117}; 117};
118 118
119/** 119/**
diff --git a/net/packet/diag.c b/net/packet/diag.c
index 39bce0d50df9..8db6e21c46bd 100644
--- a/net/packet/diag.c
+++ b/net/packet/diag.c
@@ -126,13 +126,13 @@ static int pdiag_put_fanout(struct packet_sock *po, struct sk_buff *nlskb)
126} 126}
127 127
128static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct packet_diag_req *req, 128static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct packet_diag_req *req,
129 u32 pid, u32 seq, u32 flags, int sk_ino) 129 u32 portid, u32 seq, u32 flags, int sk_ino)
130{ 130{
131 struct nlmsghdr *nlh; 131 struct nlmsghdr *nlh;
132 struct packet_diag_msg *rp; 132 struct packet_diag_msg *rp;
133 struct packet_sock *po = pkt_sk(sk); 133 struct packet_sock *po = pkt_sk(sk);
134 134
135 nlh = nlmsg_put(skb, pid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rp), flags); 135 nlh = nlmsg_put(skb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rp), flags);
136 if (!nlh) 136 if (!nlh)
137 return -EMSGSIZE; 137 return -EMSGSIZE;
138 138
@@ -184,7 +184,7 @@ static int packet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
184 if (num < s_num) 184 if (num < s_num)
185 goto next; 185 goto next;
186 186
187 if (sk_diag_fill(sk, skb, req, NETLINK_CB(cb->skb).pid, 187 if (sk_diag_fill(sk, skb, req, NETLINK_CB(cb->skb).portid,
188 cb->nlh->nlmsg_seq, NLM_F_MULTI, 188 cb->nlh->nlmsg_seq, NLM_F_MULTI,
189 sock_i_ino(sk)) < 0) 189 sock_i_ino(sk)) < 0)
190 goto done; 190 goto done;
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index 7dd762a464e5..83a8389619aa 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -33,7 +33,7 @@
33/* Device address handling */ 33/* Device address handling */
34 34
35static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr, 35static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr,
36 u32 pid, u32 seq, int event); 36 u32 portid, u32 seq, int event);
37 37
38void phonet_address_notify(int event, struct net_device *dev, u8 addr) 38void phonet_address_notify(int event, struct net_device *dev, u8 addr)
39{ 39{
@@ -101,12 +101,12 @@ static int addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *attr)
101} 101}
102 102
103static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr, 103static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr,
104 u32 pid, u32 seq, int event) 104 u32 portid, u32 seq, int event)
105{ 105{
106 struct ifaddrmsg *ifm; 106 struct ifaddrmsg *ifm;
107 struct nlmsghdr *nlh; 107 struct nlmsghdr *nlh;
108 108
109 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*ifm), 0); 109 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), 0);
110 if (nlh == NULL) 110 if (nlh == NULL)
111 return -EMSGSIZE; 111 return -EMSGSIZE;
112 112
@@ -148,7 +148,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
148 continue; 148 continue;
149 149
150 if (fill_addr(skb, pnd->netdev, addr << 2, 150 if (fill_addr(skb, pnd->netdev, addr << 2,
151 NETLINK_CB(cb->skb).pid, 151 NETLINK_CB(cb->skb).portid,
152 cb->nlh->nlmsg_seq, RTM_NEWADDR) < 0) 152 cb->nlh->nlmsg_seq, RTM_NEWADDR) < 0)
153 goto out; 153 goto out;
154 } 154 }
@@ -165,12 +165,12 @@ out:
165/* Routes handling */ 165/* Routes handling */
166 166
167static int fill_route(struct sk_buff *skb, struct net_device *dev, u8 dst, 167static int fill_route(struct sk_buff *skb, struct net_device *dev, u8 dst,
168 u32 pid, u32 seq, int event) 168 u32 portid, u32 seq, int event)
169{ 169{
170 struct rtmsg *rtm; 170 struct rtmsg *rtm;
171 struct nlmsghdr *nlh; 171 struct nlmsghdr *nlh;
172 172
173 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), 0); 173 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*rtm), 0);
174 if (nlh == NULL) 174 if (nlh == NULL)
175 return -EMSGSIZE; 175 return -EMSGSIZE;
176 176
@@ -276,7 +276,7 @@ static int route_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
276 276
277 if (addr_idx++ < addr_start_idx) 277 if (addr_idx++ < addr_start_idx)
278 continue; 278 continue;
279 if (fill_route(skb, dev, addr << 2, NETLINK_CB(cb->skb).pid, 279 if (fill_route(skb, dev, addr << 2, NETLINK_CB(cb->skb).portid,
280 cb->nlh->nlmsg_seq, RTM_NEWROUTE)) 280 cb->nlh->nlmsg_seq, RTM_NEWROUTE))
281 goto out; 281 goto out;
282 } 282 }
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index e3d2c78cb52c..102761d294cb 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -644,7 +644,7 @@ errout:
644} 644}
645 645
646static int 646static int
647tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, 647tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 portid, u32 seq,
648 u16 flags, int event, int bind, int ref) 648 u16 flags, int event, int bind, int ref)
649{ 649{
650 struct tcamsg *t; 650 struct tcamsg *t;
@@ -652,7 +652,7 @@ tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq,
652 unsigned char *b = skb_tail_pointer(skb); 652 unsigned char *b = skb_tail_pointer(skb);
653 struct nlattr *nest; 653 struct nlattr *nest;
654 654
655 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*t), flags); 655 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
656 if (!nlh) 656 if (!nlh)
657 goto out_nlmsg_trim; 657 goto out_nlmsg_trim;
658 t = nlmsg_data(nlh); 658 t = nlmsg_data(nlh);
@@ -678,7 +678,7 @@ out_nlmsg_trim:
678} 678}
679 679
680static int 680static int
681act_get_notify(struct net *net, u32 pid, struct nlmsghdr *n, 681act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
682 struct tc_action *a, int event) 682 struct tc_action *a, int event)
683{ 683{
684 struct sk_buff *skb; 684 struct sk_buff *skb;
@@ -686,16 +686,16 @@ act_get_notify(struct net *net, u32 pid, struct nlmsghdr *n,
686 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 686 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
687 if (!skb) 687 if (!skb)
688 return -ENOBUFS; 688 return -ENOBUFS;
689 if (tca_get_fill(skb, a, pid, n->nlmsg_seq, 0, event, 0, 0) <= 0) { 689 if (tca_get_fill(skb, a, portid, n->nlmsg_seq, 0, event, 0, 0) <= 0) {
690 kfree_skb(skb); 690 kfree_skb(skb);
691 return -EINVAL; 691 return -EINVAL;
692 } 692 }
693 693
694 return rtnl_unicast(skb, net, pid); 694 return rtnl_unicast(skb, net, portid);
695} 695}
696 696
697static struct tc_action * 697static struct tc_action *
698tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 pid) 698tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
699{ 699{
700 struct nlattr *tb[TCA_ACT_MAX + 1]; 700 struct nlattr *tb[TCA_ACT_MAX + 1];
701 struct tc_action *a; 701 struct tc_action *a;
@@ -762,7 +762,7 @@ static struct tc_action *create_a(int i)
762} 762}
763 763
764static int tca_action_flush(struct net *net, struct nlattr *nla, 764static int tca_action_flush(struct net *net, struct nlattr *nla,
765 struct nlmsghdr *n, u32 pid) 765 struct nlmsghdr *n, u32 portid)
766{ 766{
767 struct sk_buff *skb; 767 struct sk_buff *skb;
768 unsigned char *b; 768 unsigned char *b;
@@ -799,7 +799,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
799 if (a->ops == NULL) 799 if (a->ops == NULL)
800 goto err_out; 800 goto err_out;
801 801
802 nlh = nlmsg_put(skb, pid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0); 802 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0);
803 if (!nlh) 803 if (!nlh)
804 goto out_module_put; 804 goto out_module_put;
805 t = nlmsg_data(nlh); 805 t = nlmsg_data(nlh);
@@ -823,7 +823,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
823 nlh->nlmsg_flags |= NLM_F_ROOT; 823 nlh->nlmsg_flags |= NLM_F_ROOT;
824 module_put(a->ops->owner); 824 module_put(a->ops->owner);
825 kfree(a); 825 kfree(a);
826 err = rtnetlink_send(skb, net, pid, RTNLGRP_TC, 826 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
827 n->nlmsg_flags & NLM_F_ECHO); 827 n->nlmsg_flags & NLM_F_ECHO);
828 if (err > 0) 828 if (err > 0)
829 return 0; 829 return 0;
@@ -841,7 +841,7 @@ noflush_out:
841 841
842static int 842static int
843tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n, 843tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
844 u32 pid, int event) 844 u32 portid, int event)
845{ 845{
846 int i, ret; 846 int i, ret;
847 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1]; 847 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
@@ -853,13 +853,13 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
853 853
854 if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) { 854 if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
855 if (tb[1] != NULL) 855 if (tb[1] != NULL)
856 return tca_action_flush(net, tb[1], n, pid); 856 return tca_action_flush(net, tb[1], n, portid);
857 else 857 else
858 return -EINVAL; 858 return -EINVAL;
859 } 859 }
860 860
861 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) { 861 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
862 act = tcf_action_get_1(tb[i], n, pid); 862 act = tcf_action_get_1(tb[i], n, portid);
863 if (IS_ERR(act)) { 863 if (IS_ERR(act)) {
864 ret = PTR_ERR(act); 864 ret = PTR_ERR(act);
865 goto err; 865 goto err;
@@ -874,7 +874,7 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
874 } 874 }
875 875
876 if (event == RTM_GETACTION) 876 if (event == RTM_GETACTION)
877 ret = act_get_notify(net, pid, n, head, event); 877 ret = act_get_notify(net, portid, n, head, event);
878 else { /* delete */ 878 else { /* delete */
879 struct sk_buff *skb; 879 struct sk_buff *skb;
880 880
@@ -884,7 +884,7 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
884 goto err; 884 goto err;
885 } 885 }
886 886
887 if (tca_get_fill(skb, head, pid, n->nlmsg_seq, 0, event, 887 if (tca_get_fill(skb, head, portid, n->nlmsg_seq, 0, event,
888 0, 1) <= 0) { 888 0, 1) <= 0) {
889 kfree_skb(skb); 889 kfree_skb(skb);
890 ret = -EINVAL; 890 ret = -EINVAL;
@@ -893,7 +893,7 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
893 893
894 /* now do the delete */ 894 /* now do the delete */
895 tcf_action_destroy(head, 0); 895 tcf_action_destroy(head, 0);
896 ret = rtnetlink_send(skb, net, pid, RTNLGRP_TC, 896 ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
897 n->nlmsg_flags & NLM_F_ECHO); 897 n->nlmsg_flags & NLM_F_ECHO);
898 if (ret > 0) 898 if (ret > 0)
899 return 0; 899 return 0;
@@ -905,7 +905,7 @@ err:
905} 905}
906 906
907static int tcf_add_notify(struct net *net, struct tc_action *a, 907static int tcf_add_notify(struct net *net, struct tc_action *a,
908 u32 pid, u32 seq, int event, u16 flags) 908 u32 portid, u32 seq, int event, u16 flags)
909{ 909{
910 struct tcamsg *t; 910 struct tcamsg *t;
911 struct nlmsghdr *nlh; 911 struct nlmsghdr *nlh;
@@ -920,7 +920,7 @@ static int tcf_add_notify(struct net *net, struct tc_action *a,
920 920
921 b = skb_tail_pointer(skb); 921 b = skb_tail_pointer(skb);
922 922
923 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*t), flags); 923 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
924 if (!nlh) 924 if (!nlh)
925 goto out_kfree_skb; 925 goto out_kfree_skb;
926 t = nlmsg_data(nlh); 926 t = nlmsg_data(nlh);
@@ -940,7 +940,7 @@ static int tcf_add_notify(struct net *net, struct tc_action *a,
940 nlh->nlmsg_len = skb_tail_pointer(skb) - b; 940 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
941 NETLINK_CB(skb).dst_group = RTNLGRP_TC; 941 NETLINK_CB(skb).dst_group = RTNLGRP_TC;
942 942
943 err = rtnetlink_send(skb, net, pid, RTNLGRP_TC, flags & NLM_F_ECHO); 943 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO);
944 if (err > 0) 944 if (err > 0)
945 err = 0; 945 err = 0;
946 return err; 946 return err;
@@ -953,7 +953,7 @@ out_kfree_skb:
953 953
954static int 954static int
955tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n, 955tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
956 u32 pid, int ovr) 956 u32 portid, int ovr)
957{ 957{
958 int ret = 0; 958 int ret = 0;
959 struct tc_action *act; 959 struct tc_action *act;
@@ -971,7 +971,7 @@ tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
971 /* dump then free all the actions after update; inserted policy 971 /* dump then free all the actions after update; inserted policy
972 * stays intact 972 * stays intact
973 */ 973 */
974 ret = tcf_add_notify(net, act, pid, seq, RTM_NEWACTION, n->nlmsg_flags); 974 ret = tcf_add_notify(net, act, portid, seq, RTM_NEWACTION, n->nlmsg_flags);
975 for (a = act; a; a = act) { 975 for (a = act; a; a = act) {
976 act = a->next; 976 act = a->next;
977 kfree(a); 977 kfree(a);
@@ -984,7 +984,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
984{ 984{
985 struct net *net = sock_net(skb->sk); 985 struct net *net = sock_net(skb->sk);
986 struct nlattr *tca[TCA_ACT_MAX + 1]; 986 struct nlattr *tca[TCA_ACT_MAX + 1];
987 u32 pid = skb ? NETLINK_CB(skb).pid : 0; 987 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
988 int ret = 0, ovr = 0; 988 int ret = 0, ovr = 0;
989 989
990 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); 990 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
@@ -1008,17 +1008,17 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1008 if (n->nlmsg_flags & NLM_F_REPLACE) 1008 if (n->nlmsg_flags & NLM_F_REPLACE)
1009 ovr = 1; 1009 ovr = 1;
1010replay: 1010replay:
1011 ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, pid, ovr); 1011 ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
1012 if (ret == -EAGAIN) 1012 if (ret == -EAGAIN)
1013 goto replay; 1013 goto replay;
1014 break; 1014 break;
1015 case RTM_DELACTION: 1015 case RTM_DELACTION:
1016 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n, 1016 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1017 pid, RTM_DELACTION); 1017 portid, RTM_DELACTION);
1018 break; 1018 break;
1019 case RTM_GETACTION: 1019 case RTM_GETACTION:
1020 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n, 1020 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1021 pid, RTM_GETACTION); 1021 portid, RTM_GETACTION);
1022 break; 1022 break;
1023 default: 1023 default:
1024 BUG(); 1024 BUG();
@@ -1085,7 +1085,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1085 goto out_module_put; 1085 goto out_module_put;
1086 } 1086 }
1087 1087
1088 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, 1088 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
1089 cb->nlh->nlmsg_type, sizeof(*t), 0); 1089 cb->nlh->nlmsg_type, sizeof(*t), 0);
1090 if (!nlh) 1090 if (!nlh)
1091 goto out_module_put; 1091 goto out_module_put;
@@ -1109,7 +1109,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1109 nla_nest_cancel(skb, nest); 1109 nla_nest_cancel(skb, nest);
1110 1110
1111 nlh->nlmsg_len = skb_tail_pointer(skb) - b; 1111 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1112 if (NETLINK_CB(cb->skb).pid && ret) 1112 if (NETLINK_CB(cb->skb).portid && ret)
1113 nlh->nlmsg_flags |= NLM_F_MULTI; 1113 nlh->nlmsg_flags |= NLM_F_MULTI;
1114 module_put(a_o->owner); 1114 module_put(a_o->owner);
1115 return skb->len; 1115 return skb->len;
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
345static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, 345static 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;
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index a08b4ab3e421..a18d975db59c 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1185,7 +1185,7 @@ graft:
1185} 1185}
1186 1186
1187static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, 1187static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
1188 u32 pid, u32 seq, u16 flags, int event) 1188 u32 portid, u32 seq, u16 flags, int event)
1189{ 1189{
1190 struct tcmsg *tcm; 1190 struct tcmsg *tcm;
1191 struct nlmsghdr *nlh; 1191 struct nlmsghdr *nlh;
@@ -1193,7 +1193,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
1193 struct gnet_dump d; 1193 struct gnet_dump d;
1194 struct qdisc_size_table *stab; 1194 struct qdisc_size_table *stab;
1195 1195
1196 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*tcm), flags); 1196 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags);
1197 if (!nlh) 1197 if (!nlh)
1198 goto out_nlmsg_trim; 1198 goto out_nlmsg_trim;
1199 tcm = nlmsg_data(nlh); 1199 tcm = nlmsg_data(nlh);
@@ -1248,25 +1248,25 @@ static int qdisc_notify(struct net *net, struct sk_buff *oskb,
1248 struct Qdisc *old, struct Qdisc *new) 1248 struct Qdisc *old, struct Qdisc *new)
1249{ 1249{
1250 struct sk_buff *skb; 1250 struct sk_buff *skb;
1251 u32 pid = oskb ? NETLINK_CB(oskb).pid : 0; 1251 u32 portid = oskb ? NETLINK_CB(oskb).portid : 0;
1252 1252
1253 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 1253 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
1254 if (!skb) 1254 if (!skb)
1255 return -ENOBUFS; 1255 return -ENOBUFS;
1256 1256
1257 if (old && !tc_qdisc_dump_ignore(old)) { 1257 if (old && !tc_qdisc_dump_ignore(old)) {
1258 if (tc_fill_qdisc(skb, old, clid, pid, n->nlmsg_seq, 1258 if (tc_fill_qdisc(skb, old, clid, portid, n->nlmsg_seq,
1259 0, RTM_DELQDISC) < 0) 1259 0, RTM_DELQDISC) < 0)
1260 goto err_out; 1260 goto err_out;
1261 } 1261 }
1262 if (new && !tc_qdisc_dump_ignore(new)) { 1262 if (new && !tc_qdisc_dump_ignore(new)) {
1263 if (tc_fill_qdisc(skb, new, clid, pid, n->nlmsg_seq, 1263 if (tc_fill_qdisc(skb, new, clid, portid, n->nlmsg_seq,
1264 old ? NLM_F_REPLACE : 0, RTM_NEWQDISC) < 0) 1264 old ? NLM_F_REPLACE : 0, RTM_NEWQDISC) < 0)
1265 goto err_out; 1265 goto err_out;
1266 } 1266 }
1267 1267
1268 if (skb->len) 1268 if (skb->len)
1269 return rtnetlink_send(skb, net, pid, RTNLGRP_TC, 1269 return rtnetlink_send(skb, net, portid, RTNLGRP_TC,
1270 n->nlmsg_flags & NLM_F_ECHO); 1270 n->nlmsg_flags & NLM_F_ECHO);
1271 1271
1272err_out: 1272err_out:
@@ -1289,7 +1289,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
1289 q_idx++; 1289 q_idx++;
1290 } else { 1290 } else {
1291 if (!tc_qdisc_dump_ignore(q) && 1291 if (!tc_qdisc_dump_ignore(q) &&
1292 tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid, 1292 tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).portid,
1293 cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) 1293 cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0)
1294 goto done; 1294 goto done;
1295 q_idx++; 1295 q_idx++;
@@ -1300,7 +1300,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
1300 continue; 1300 continue;
1301 } 1301 }
1302 if (!tc_qdisc_dump_ignore(q) && 1302 if (!tc_qdisc_dump_ignore(q) &&
1303 tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid, 1303 tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).portid,
1304 cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) 1304 cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0)
1305 goto done; 1305 goto done;
1306 q_idx++; 1306 q_idx++;
@@ -1375,7 +1375,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1375 const struct Qdisc_class_ops *cops; 1375 const struct Qdisc_class_ops *cops;
1376 unsigned long cl = 0; 1376 unsigned long cl = 0;
1377 unsigned long new_cl; 1377 unsigned long new_cl;
1378 u32 pid = tcm->tcm_parent; 1378 u32 portid = tcm->tcm_parent;
1379 u32 clid = tcm->tcm_handle; 1379 u32 clid = tcm->tcm_handle;
1380 u32 qid = TC_H_MAJ(clid); 1380 u32 qid = TC_H_MAJ(clid);
1381 int err; 1381 int err;
@@ -1403,8 +1403,8 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1403 1403
1404 /* Step 1. Determine qdisc handle X:0 */ 1404 /* Step 1. Determine qdisc handle X:0 */
1405 1405
1406 if (pid != TC_H_ROOT) { 1406 if (portid != TC_H_ROOT) {
1407 u32 qid1 = TC_H_MAJ(pid); 1407 u32 qid1 = TC_H_MAJ(portid);
1408 1408
1409 if (qid && qid1) { 1409 if (qid && qid1) {
1410 /* If both majors are known, they must be identical. */ 1410 /* If both majors are known, they must be identical. */
@@ -1418,10 +1418,10 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1418 /* Now qid is genuine qdisc handle consistent 1418 /* Now qid is genuine qdisc handle consistent
1419 * both with parent and child. 1419 * both with parent and child.
1420 * 1420 *
1421 * TC_H_MAJ(pid) still may be unspecified, complete it now. 1421 * TC_H_MAJ(portid) still may be unspecified, complete it now.
1422 */ 1422 */
1423 if (pid) 1423 if (portid)
1424 pid = TC_H_MAKE(qid, pid); 1424 portid = TC_H_MAKE(qid, portid);
1425 } else { 1425 } else {
1426 if (qid == 0) 1426 if (qid == 0)
1427 qid = dev->qdisc->handle; 1427 qid = dev->qdisc->handle;
@@ -1439,7 +1439,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1439 1439
1440 /* Now try to get class */ 1440 /* Now try to get class */
1441 if (clid == 0) { 1441 if (clid == 0) {
1442 if (pid == TC_H_ROOT) 1442 if (portid == TC_H_ROOT)
1443 clid = qid; 1443 clid = qid;
1444 } else 1444 } else
1445 clid = TC_H_MAKE(qid, clid); 1445 clid = TC_H_MAKE(qid, clid);
@@ -1478,7 +1478,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
1478 new_cl = cl; 1478 new_cl = cl;
1479 err = -EOPNOTSUPP; 1479 err = -EOPNOTSUPP;
1480 if (cops->change) 1480 if (cops->change)
1481 err = cops->change(q, clid, pid, tca, &new_cl); 1481 err = cops->change(q, clid, portid, tca, &new_cl);
1482 if (err == 0) 1482 if (err == 0)
1483 tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS); 1483 tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS);
1484 1484
@@ -1492,7 +1492,7 @@ out:
1492 1492
1493static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, 1493static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
1494 unsigned long cl, 1494 unsigned long cl,
1495 u32 pid, u32 seq, u16 flags, int event) 1495 u32 portid, u32 seq, u16 flags, int event)
1496{ 1496{
1497 struct tcmsg *tcm; 1497 struct tcmsg *tcm;
1498 struct nlmsghdr *nlh; 1498 struct nlmsghdr *nlh;
@@ -1500,7 +1500,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
1500 struct gnet_dump d; 1500 struct gnet_dump d;
1501 const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; 1501 const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops;
1502 1502
1503 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*tcm), flags); 1503 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags);
1504 if (!nlh) 1504 if (!nlh)
1505 goto out_nlmsg_trim; 1505 goto out_nlmsg_trim;
1506 tcm = nlmsg_data(nlh); 1506 tcm = nlmsg_data(nlh);
@@ -1540,18 +1540,18 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb,
1540 unsigned long cl, int event) 1540 unsigned long cl, int event)
1541{ 1541{
1542 struct sk_buff *skb; 1542 struct sk_buff *skb;
1543 u32 pid = oskb ? NETLINK_CB(oskb).pid : 0; 1543 u32 portid = oskb ? NETLINK_CB(oskb).portid : 0;
1544 1544
1545 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 1545 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
1546 if (!skb) 1546 if (!skb)
1547 return -ENOBUFS; 1547 return -ENOBUFS;
1548 1548
1549 if (tc_fill_tclass(skb, q, cl, pid, n->nlmsg_seq, 0, event) < 0) { 1549 if (tc_fill_tclass(skb, q, cl, portid, n->nlmsg_seq, 0, event) < 0) {
1550 kfree_skb(skb); 1550 kfree_skb(skb);
1551 return -EINVAL; 1551 return -EINVAL;
1552 } 1552 }
1553 1553
1554 return rtnetlink_send(skb, net, pid, RTNLGRP_TC, 1554 return rtnetlink_send(skb, net, portid, RTNLGRP_TC,
1555 n->nlmsg_flags & NLM_F_ECHO); 1555 n->nlmsg_flags & NLM_F_ECHO);
1556} 1556}
1557 1557
@@ -1565,7 +1565,7 @@ static int qdisc_class_dump(struct Qdisc *q, unsigned long cl, struct qdisc_walk
1565{ 1565{
1566 struct qdisc_dump_args *a = (struct qdisc_dump_args *)arg; 1566 struct qdisc_dump_args *a = (struct qdisc_dump_args *)arg;
1567 1567
1568 return tc_fill_tclass(a->skb, q, cl, NETLINK_CB(a->cb->skb).pid, 1568 return tc_fill_tclass(a->skb, q, cl, NETLINK_CB(a->cb->skb).portid,
1569 a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTCLASS); 1569 a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTCLASS);
1570} 1570}
1571 1571
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 47a839df27dc..6675914dc592 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -62,7 +62,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
62 rep_nlh = nlmsg_hdr(rep_buf); 62 rep_nlh = nlmsg_hdr(rep_buf);
63 memcpy(rep_nlh, req_nlh, hdr_space); 63 memcpy(rep_nlh, req_nlh, hdr_space);
64 rep_nlh->nlmsg_len = rep_buf->len; 64 rep_nlh->nlmsg_len = rep_buf->len;
65 genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).pid); 65 genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).portid);
66 } 66 }
67 67
68 return 0; 68 return 0;
diff --git a/net/unix/diag.c b/net/unix/diag.c
index 750b13408449..06748f108a57 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -110,12 +110,12 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb)
110} 110}
111 111
112static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, 112static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
113 u32 pid, u32 seq, u32 flags, int sk_ino) 113 u32 portid, u32 seq, u32 flags, int sk_ino)
114{ 114{
115 struct nlmsghdr *nlh; 115 struct nlmsghdr *nlh;
116 struct unix_diag_msg *rep; 116 struct unix_diag_msg *rep;
117 117
118 nlh = nlmsg_put(skb, pid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep), 118 nlh = nlmsg_put(skb, portid, seq, SOCK_DIAG_BY_FAMILY, sizeof(*rep),
119 flags); 119 flags);
120 if (!nlh) 120 if (!nlh)
121 return -EMSGSIZE; 121 return -EMSGSIZE;
@@ -159,7 +159,7 @@ out_nlmsg_trim:
159} 159}
160 160
161static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req, 161static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_req *req,
162 u32 pid, u32 seq, u32 flags) 162 u32 portid, u32 seq, u32 flags)
163{ 163{
164 int sk_ino; 164 int sk_ino;
165 165
@@ -170,7 +170,7 @@ static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, struct unix_diag_r
170 if (!sk_ino) 170 if (!sk_ino)
171 return 0; 171 return 0;
172 172
173 return sk_diag_fill(sk, skb, req, pid, seq, flags, sk_ino); 173 return sk_diag_fill(sk, skb, req, portid, seq, flags, sk_ino);
174} 174}
175 175
176static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) 176static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
@@ -200,7 +200,7 @@ static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
200 if (!(req->udiag_states & (1 << sk->sk_state))) 200 if (!(req->udiag_states & (1 << sk->sk_state)))
201 goto next; 201 goto next;
202 if (sk_diag_dump(sk, skb, req, 202 if (sk_diag_dump(sk, skb, req,
203 NETLINK_CB(cb->skb).pid, 203 NETLINK_CB(cb->skb).portid,
204 cb->nlh->nlmsg_seq, 204 cb->nlh->nlmsg_seq,
205 NLM_F_MULTI) < 0) 205 NLM_F_MULTI) < 0)
206 goto done; 206 goto done;
@@ -267,7 +267,7 @@ again:
267 if (!rep) 267 if (!rep)
268 goto out; 268 goto out;
269 269
270 err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).pid, 270 err = sk_diag_fill(sk, rep, req, NETLINK_CB(in_skb).portid,
271 nlh->nlmsg_seq, 0, req->udiag_ino); 271 nlh->nlmsg_seq, 0, req->udiag_ino);
272 if (err < 0) { 272 if (err < 0) {
273 nlmsg_free(rep); 273 nlmsg_free(rep);
@@ -277,7 +277,7 @@ again:
277 277
278 goto again; 278 goto again;
279 } 279 }
280 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid, 280 err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid,
281 MSG_DONTWAIT); 281 MSG_DONTWAIT);
282 if (err > 0) 282 if (err > 0)
283 err = 0; 283 err = 0;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index bc7430b54771..a343be4a52bd 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -55,7 +55,7 @@ struct cfg80211_registered_device {
55 int opencount; /* also protected by devlist_mtx */ 55 int opencount; /* also protected by devlist_mtx */
56 wait_queue_head_t dev_wait; 56 wait_queue_head_t dev_wait;
57 57
58 u32 ap_beacons_nlpid; 58 u32 ap_beacons_nlportid;
59 59
60 /* protected by RTNL only */ 60 /* protected by RTNL only */
61 int num_running_ifaces; 61 int num_running_ifaces;
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 8fd0242ee169..ec7fcee5bad6 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -615,7 +615,7 @@ EXPORT_SYMBOL(cfg80211_del_sta);
615struct cfg80211_mgmt_registration { 615struct cfg80211_mgmt_registration {
616 struct list_head list; 616 struct list_head list;
617 617
618 u32 nlpid; 618 u32 nlportid;
619 619
620 int match_len; 620 int match_len;
621 621
@@ -624,7 +624,7 @@ struct cfg80211_mgmt_registration {
624 u8 match[]; 624 u8 match[];
625}; 625};
626 626
627int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid, 627int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
628 u16 frame_type, const u8 *match_data, 628 u16 frame_type, const u8 *match_data,
629 int match_len) 629 int match_len)
630{ 630{
@@ -672,7 +672,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
672 672
673 memcpy(nreg->match, match_data, match_len); 673 memcpy(nreg->match, match_data, match_len);
674 nreg->match_len = match_len; 674 nreg->match_len = match_len;
675 nreg->nlpid = snd_pid; 675 nreg->nlportid = snd_portid;
676 nreg->frame_type = cpu_to_le16(frame_type); 676 nreg->frame_type = cpu_to_le16(frame_type);
677 list_add(&nreg->list, &wdev->mgmt_registrations); 677 list_add(&nreg->list, &wdev->mgmt_registrations);
678 678
@@ -685,7 +685,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
685 return err; 685 return err;
686} 686}
687 687
688void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid) 688void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid)
689{ 689{
690 struct wiphy *wiphy = wdev->wiphy; 690 struct wiphy *wiphy = wdev->wiphy;
691 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 691 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
@@ -694,7 +694,7 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid)
694 spin_lock_bh(&wdev->mgmt_registrations_lock); 694 spin_lock_bh(&wdev->mgmt_registrations_lock);
695 695
696 list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) { 696 list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) {
697 if (reg->nlpid != nlpid) 697 if (reg->nlportid != nlportid)
698 continue; 698 continue;
699 699
700 if (rdev->ops->mgmt_frame_register) { 700 if (rdev->ops->mgmt_frame_register) {
@@ -710,8 +710,8 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid)
710 710
711 spin_unlock_bh(&wdev->mgmt_registrations_lock); 711 spin_unlock_bh(&wdev->mgmt_registrations_lock);
712 712
713 if (nlpid == wdev->ap_unexpected_nlpid) 713 if (nlportid == wdev->ap_unexpected_nlportid)
714 wdev->ap_unexpected_nlpid = 0; 714 wdev->ap_unexpected_nlportid = 0;
715} 715}
716 716
717void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev) 717void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev)
@@ -872,7 +872,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
872 /* found match! */ 872 /* found match! */
873 873
874 /* Indicate the received Action frame to user space */ 874 /* Indicate the received Action frame to user space */
875 if (nl80211_send_mgmt(rdev, wdev, reg->nlpid, 875 if (nl80211_send_mgmt(rdev, wdev, reg->nlportid,
876 freq, sig_mbm, 876 freq, sig_mbm,
877 buf, len, gfp)) 877 buf, len, gfp))
878 continue; 878 continue;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 787aeaa902fe..34eb5c07a567 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -496,11 +496,11 @@ static bool is_valid_ie_attr(const struct nlattr *attr)
496} 496}
497 497
498/* message building helper */ 498/* message building helper */
499static inline void *nl80211hdr_put(struct sk_buff *skb, u32 pid, u32 seq, 499static inline void *nl80211hdr_put(struct sk_buff *skb, u32 portid, u32 seq,
500 int flags, u8 cmd) 500 int flags, u8 cmd)
501{ 501{
502 /* since there is no private header just add the generic one */ 502 /* since there is no private header just add the generic one */
503 return genlmsg_put(skb, pid, seq, &nl80211_fam, flags, cmd); 503 return genlmsg_put(skb, portid, seq, &nl80211_fam, flags, cmd);
504} 504}
505 505
506static int nl80211_msg_put_channel(struct sk_buff *msg, 506static int nl80211_msg_put_channel(struct sk_buff *msg,
@@ -851,7 +851,7 @@ nla_put_failure:
851 return -ENOBUFS; 851 return -ENOBUFS;
852} 852}
853 853
854static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, 854static int nl80211_send_wiphy(struct sk_buff *msg, u32 portid, u32 seq, int flags,
855 struct cfg80211_registered_device *dev) 855 struct cfg80211_registered_device *dev)
856{ 856{
857 void *hdr; 857 void *hdr;
@@ -866,7 +866,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
866 const struct ieee80211_txrx_stypes *mgmt_stypes = 866 const struct ieee80211_txrx_stypes *mgmt_stypes =
867 dev->wiphy.mgmt_stypes; 867 dev->wiphy.mgmt_stypes;
868 868
869 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY); 869 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_WIPHY);
870 if (!hdr) 870 if (!hdr)
871 return -1; 871 return -1;
872 872
@@ -1267,7 +1267,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
1267 continue; 1267 continue;
1268 if (++idx <= start) 1268 if (++idx <= start)
1269 continue; 1269 continue;
1270 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid, 1270 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).portid,
1271 cb->nlh->nlmsg_seq, NLM_F_MULTI, 1271 cb->nlh->nlmsg_seq, NLM_F_MULTI,
1272 dev) < 0) { 1272 dev) < 0) {
1273 idx--; 1273 idx--;
@@ -1290,7 +1290,7 @@ static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info)
1290 if (!msg) 1290 if (!msg)
1291 return -ENOMEM; 1291 return -ENOMEM;
1292 1292
1293 if (nl80211_send_wiphy(msg, info->snd_pid, info->snd_seq, 0, dev) < 0) { 1293 if (nl80211_send_wiphy(msg, info->snd_portid, info->snd_seq, 0, dev) < 0) {
1294 nlmsg_free(msg); 1294 nlmsg_free(msg);
1295 return -ENOBUFS; 1295 return -ENOBUFS;
1296 } 1296 }
@@ -1736,14 +1736,14 @@ static inline u64 wdev_id(struct wireless_dev *wdev)
1736 ((u64)wiphy_to_dev(wdev->wiphy)->wiphy_idx << 32); 1736 ((u64)wiphy_to_dev(wdev->wiphy)->wiphy_idx << 32);
1737} 1737}
1738 1738
1739static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags, 1739static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,
1740 struct cfg80211_registered_device *rdev, 1740 struct cfg80211_registered_device *rdev,
1741 struct wireless_dev *wdev) 1741 struct wireless_dev *wdev)
1742{ 1742{
1743 struct net_device *dev = wdev->netdev; 1743 struct net_device *dev = wdev->netdev;
1744 void *hdr; 1744 void *hdr;
1745 1745
1746 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_INTERFACE); 1746 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_INTERFACE);
1747 if (!hdr) 1747 if (!hdr)
1748 return -1; 1748 return -1;
1749 1749
@@ -1807,7 +1807,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
1807 if_idx++; 1807 if_idx++;
1808 continue; 1808 continue;
1809 } 1809 }
1810 if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).pid, 1810 if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).portid,
1811 cb->nlh->nlmsg_seq, NLM_F_MULTI, 1811 cb->nlh->nlmsg_seq, NLM_F_MULTI,
1812 rdev, wdev) < 0) { 1812 rdev, wdev) < 0) {
1813 mutex_unlock(&rdev->devlist_mtx); 1813 mutex_unlock(&rdev->devlist_mtx);
@@ -1838,7 +1838,7 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
1838 if (!msg) 1838 if (!msg)
1839 return -ENOMEM; 1839 return -ENOMEM;
1840 1840
1841 if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, 1841 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0,
1842 dev, wdev) < 0) { 1842 dev, wdev) < 0) {
1843 nlmsg_free(msg); 1843 nlmsg_free(msg);
1844 return -ENOBUFS; 1844 return -ENOBUFS;
@@ -2056,7 +2056,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
2056 break; 2056 break;
2057 } 2057 }
2058 2058
2059 if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, 2059 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0,
2060 rdev, wdev) < 0) { 2060 rdev, wdev) < 0) {
2061 nlmsg_free(msg); 2061 nlmsg_free(msg);
2062 return -ENOBUFS; 2062 return -ENOBUFS;
@@ -2191,7 +2191,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
2191 if (!msg) 2191 if (!msg)
2192 return -ENOMEM; 2192 return -ENOMEM;
2193 2193
2194 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 2194 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
2195 NL80211_CMD_NEW_KEY); 2195 NL80211_CMD_NEW_KEY);
2196 if (IS_ERR(hdr)) 2196 if (IS_ERR(hdr))
2197 return PTR_ERR(hdr); 2197 return PTR_ERR(hdr);
@@ -2769,7 +2769,7 @@ nla_put_failure:
2769 return false; 2769 return false;
2770} 2770}
2771 2771
2772static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, 2772static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq,
2773 int flags, 2773 int flags,
2774 struct cfg80211_registered_device *rdev, 2774 struct cfg80211_registered_device *rdev,
2775 struct net_device *dev, 2775 struct net_device *dev,
@@ -2778,7 +2778,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
2778 void *hdr; 2778 void *hdr;
2779 struct nlattr *sinfoattr, *bss_param; 2779 struct nlattr *sinfoattr, *bss_param;
2780 2780
2781 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_STATION); 2781 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_STATION);
2782 if (!hdr) 2782 if (!hdr)
2783 return -1; 2783 return -1;
2784 2784
@@ -2931,7 +2931,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
2931 goto out_err; 2931 goto out_err;
2932 2932
2933 if (nl80211_send_station(skb, 2933 if (nl80211_send_station(skb,
2934 NETLINK_CB(cb->skb).pid, 2934 NETLINK_CB(cb->skb).portid,
2935 cb->nlh->nlmsg_seq, NLM_F_MULTI, 2935 cb->nlh->nlmsg_seq, NLM_F_MULTI,
2936 dev, netdev, mac_addr, 2936 dev, netdev, mac_addr,
2937 &sinfo) < 0) 2937 &sinfo) < 0)
@@ -2977,7 +2977,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
2977 if (!msg) 2977 if (!msg)
2978 return -ENOMEM; 2978 return -ENOMEM;
2979 2979
2980 if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0, 2980 if (nl80211_send_station(msg, info->snd_portid, info->snd_seq, 0,
2981 rdev, dev, mac_addr, &sinfo) < 0) { 2981 rdev, dev, mac_addr, &sinfo) < 0) {
2982 nlmsg_free(msg); 2982 nlmsg_free(msg);
2983 return -ENOBUFS; 2983 return -ENOBUFS;
@@ -3303,7 +3303,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
3303 return rdev->ops->del_station(&rdev->wiphy, dev, mac_addr); 3303 return rdev->ops->del_station(&rdev->wiphy, dev, mac_addr);
3304} 3304}
3305 3305
3306static int nl80211_send_mpath(struct sk_buff *msg, u32 pid, u32 seq, 3306static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq,
3307 int flags, struct net_device *dev, 3307 int flags, struct net_device *dev,
3308 u8 *dst, u8 *next_hop, 3308 u8 *dst, u8 *next_hop,
3309 struct mpath_info *pinfo) 3309 struct mpath_info *pinfo)
@@ -3311,7 +3311,7 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 pid, u32 seq,
3311 void *hdr; 3311 void *hdr;
3312 struct nlattr *pinfoattr; 3312 struct nlattr *pinfoattr;
3313 3313
3314 hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_STATION); 3314 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_STATION);
3315 if (!hdr) 3315 if (!hdr)
3316 return -1; 3316 return -1;
3317 3317
@@ -3389,7 +3389,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
3389 if (err) 3389 if (err)
3390 goto out_err; 3390 goto out_err;
3391 3391
3392 if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).pid, 3392 if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).portid,
3393 cb->nlh->nlmsg_seq, NLM_F_MULTI, 3393 cb->nlh->nlmsg_seq, NLM_F_MULTI,
3394 netdev, dst, next_hop, 3394 netdev, dst, next_hop,
3395 &pinfo) < 0) 3395 &pinfo) < 0)
@@ -3438,7 +3438,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
3438 if (!msg) 3438 if (!msg)
3439 return -ENOMEM; 3439 return -ENOMEM;
3440 3440
3441 if (nl80211_send_mpath(msg, info->snd_pid, info->snd_seq, 0, 3441 if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0,
3442 dev, dst, next_hop, &pinfo) < 0) { 3442 dev, dst, next_hop, &pinfo) < 0) {
3443 nlmsg_free(msg); 3443 nlmsg_free(msg);
3444 return -ENOBUFS; 3444 return -ENOBUFS;
@@ -3679,7 +3679,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
3679 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 3679 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
3680 if (!msg) 3680 if (!msg)
3681 return -ENOMEM; 3681 return -ENOMEM;
3682 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 3682 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
3683 NL80211_CMD_GET_MESH_CONFIG); 3683 NL80211_CMD_GET_MESH_CONFIG);
3684 if (!hdr) 3684 if (!hdr)
3685 goto out; 3685 goto out;
@@ -3998,7 +3998,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info)
3998 goto out; 3998 goto out;
3999 } 3999 }
4000 4000
4001 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 4001 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
4002 NL80211_CMD_GET_REG); 4002 NL80211_CMD_GET_REG);
4003 if (!hdr) 4003 if (!hdr)
4004 goto put_failure; 4004 goto put_failure;
@@ -4616,7 +4616,7 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
4616 4616
4617 ASSERT_WDEV_LOCK(wdev); 4617 ASSERT_WDEV_LOCK(wdev);
4618 4618
4619 hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).pid, seq, flags, 4619 hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags,
4620 NL80211_CMD_NEW_SCAN_RESULTS); 4620 NL80211_CMD_NEW_SCAN_RESULTS);
4621 if (!hdr) 4621 if (!hdr)
4622 return -1; 4622 return -1;
@@ -4735,14 +4735,14 @@ static int nl80211_dump_scan(struct sk_buff *skb,
4735 return skb->len; 4735 return skb->len;
4736} 4736}
4737 4737
4738static int nl80211_send_survey(struct sk_buff *msg, u32 pid, u32 seq, 4738static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq,
4739 int flags, struct net_device *dev, 4739 int flags, struct net_device *dev,
4740 struct survey_info *survey) 4740 struct survey_info *survey)
4741{ 4741{
4742 void *hdr; 4742 void *hdr;
4743 struct nlattr *infoattr; 4743 struct nlattr *infoattr;
4744 4744
4745 hdr = nl80211hdr_put(msg, pid, seq, flags, 4745 hdr = nl80211hdr_put(msg, portid, seq, flags,
4746 NL80211_CMD_NEW_SURVEY_RESULTS); 4746 NL80211_CMD_NEW_SURVEY_RESULTS);
4747 if (!hdr) 4747 if (!hdr)
4748 return -ENOMEM; 4748 return -ENOMEM;
@@ -4836,7 +4836,7 @@ static int nl80211_dump_survey(struct sk_buff *skb,
4836 } 4836 }
4837 4837
4838 if (nl80211_send_survey(skb, 4838 if (nl80211_send_survey(skb,
4839 NETLINK_CB(cb->skb).pid, 4839 NETLINK_CB(cb->skb).portid,
4840 cb->nlh->nlmsg_seq, NLM_F_MULTI, 4840 cb->nlh->nlmsg_seq, NLM_F_MULTI,
4841 netdev, 4841 netdev,
4842 &survey) < 0) 4842 &survey) < 0)
@@ -5451,7 +5451,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
5451 } 5451 }
5452 5452
5453 while (1) { 5453 while (1) {
5454 void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).pid, 5454 void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).portid,
5455 cb->nlh->nlmsg_seq, NLM_F_MULTI, 5455 cb->nlh->nlmsg_seq, NLM_F_MULTI,
5456 NL80211_CMD_TESTMODE); 5456 NL80211_CMD_TESTMODE);
5457 struct nlattr *tmdata; 5457 struct nlattr *tmdata;
@@ -5491,7 +5491,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
5491 5491
5492static struct sk_buff * 5492static struct sk_buff *
5493__cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev, 5493__cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev,
5494 int approxlen, u32 pid, u32 seq, gfp_t gfp) 5494 int approxlen, u32 portid, u32 seq, gfp_t gfp)
5495{ 5495{
5496 struct sk_buff *skb; 5496 struct sk_buff *skb;
5497 void *hdr; 5497 void *hdr;
@@ -5501,7 +5501,7 @@ __cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev,
5501 if (!skb) 5501 if (!skb)
5502 return NULL; 5502 return NULL;
5503 5503
5504 hdr = nl80211hdr_put(skb, pid, seq, 0, NL80211_CMD_TESTMODE); 5504 hdr = nl80211hdr_put(skb, portid, seq, 0, NL80211_CMD_TESTMODE);
5505 if (!hdr) { 5505 if (!hdr) {
5506 kfree_skb(skb); 5506 kfree_skb(skb);
5507 return NULL; 5507 return NULL;
@@ -5531,7 +5531,7 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
5531 return NULL; 5531 return NULL;
5532 5532
5533 return __cfg80211_testmode_alloc_skb(rdev, approxlen, 5533 return __cfg80211_testmode_alloc_skb(rdev, approxlen,
5534 rdev->testmode_info->snd_pid, 5534 rdev->testmode_info->snd_portid,
5535 rdev->testmode_info->snd_seq, 5535 rdev->testmode_info->snd_seq,
5536 GFP_KERNEL); 5536 GFP_KERNEL);
5537} 5537}
@@ -5867,7 +5867,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
5867 if (!msg) 5867 if (!msg)
5868 return -ENOMEM; 5868 return -ENOMEM;
5869 5869
5870 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 5870 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
5871 NL80211_CMD_REMAIN_ON_CHANNEL); 5871 NL80211_CMD_REMAIN_ON_CHANNEL);
5872 5872
5873 if (IS_ERR(hdr)) { 5873 if (IS_ERR(hdr)) {
@@ -6086,7 +6086,7 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
6086 if (!rdev->ops->mgmt_tx) 6086 if (!rdev->ops->mgmt_tx)
6087 return -EOPNOTSUPP; 6087 return -EOPNOTSUPP;
6088 6088
6089 return cfg80211_mlme_register_mgmt(wdev, info->snd_pid, frame_type, 6089 return cfg80211_mlme_register_mgmt(wdev, info->snd_portid, frame_type,
6090 nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), 6090 nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
6091 nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); 6091 nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));
6092} 6092}
@@ -6167,7 +6167,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
6167 if (!msg) 6167 if (!msg)
6168 return -ENOMEM; 6168 return -ENOMEM;
6169 6169
6170 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 6170 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
6171 NL80211_CMD_FRAME); 6171 NL80211_CMD_FRAME);
6172 6172
6173 if (IS_ERR(hdr)) { 6173 if (IS_ERR(hdr)) {
@@ -6284,7 +6284,7 @@ static int nl80211_get_power_save(struct sk_buff *skb, struct genl_info *info)
6284 if (!msg) 6284 if (!msg)
6285 return -ENOMEM; 6285 return -ENOMEM;
6286 6286
6287 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 6287 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
6288 NL80211_CMD_GET_POWER_SAVE); 6288 NL80211_CMD_GET_POWER_SAVE);
6289 if (!hdr) { 6289 if (!hdr) {
6290 err = -ENOBUFS; 6290 err = -ENOBUFS;
@@ -6486,7 +6486,7 @@ static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info)
6486 if (!msg) 6486 if (!msg)
6487 return -ENOMEM; 6487 return -ENOMEM;
6488 6488
6489 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 6489 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
6490 NL80211_CMD_GET_WOWLAN); 6490 NL80211_CMD_GET_WOWLAN);
6491 if (!hdr) 6491 if (!hdr)
6492 goto nla_put_failure; 6492 goto nla_put_failure;
@@ -6760,10 +6760,10 @@ static int nl80211_register_unexpected_frame(struct sk_buff *skb,
6760 wdev->iftype != NL80211_IFTYPE_P2P_GO) 6760 wdev->iftype != NL80211_IFTYPE_P2P_GO)
6761 return -EINVAL; 6761 return -EINVAL;
6762 6762
6763 if (wdev->ap_unexpected_nlpid) 6763 if (wdev->ap_unexpected_nlportid)
6764 return -EBUSY; 6764 return -EBUSY;
6765 6765
6766 wdev->ap_unexpected_nlpid = info->snd_pid; 6766 wdev->ap_unexpected_nlportid = info->snd_portid;
6767 return 0; 6767 return 0;
6768} 6768}
6769 6769
@@ -6793,7 +6793,7 @@ static int nl80211_probe_client(struct sk_buff *skb,
6793 if (!msg) 6793 if (!msg)
6794 return -ENOMEM; 6794 return -ENOMEM;
6795 6795
6796 hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, 6796 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
6797 NL80211_CMD_PROBE_CLIENT); 6797 NL80211_CMD_PROBE_CLIENT);
6798 6798
6799 if (IS_ERR(hdr)) { 6799 if (IS_ERR(hdr)) {
@@ -6828,10 +6828,10 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info)
6828 if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) 6828 if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS))
6829 return -EOPNOTSUPP; 6829 return -EOPNOTSUPP;
6830 6830
6831 if (rdev->ap_beacons_nlpid) 6831 if (rdev->ap_beacons_nlportid)
6832 return -EBUSY; 6832 return -EBUSY;
6833 6833
6834 rdev->ap_beacons_nlpid = info->snd_pid; 6834 rdev->ap_beacons_nlportid = info->snd_portid;
6835 6835
6836 return 0; 6836 return 0;
6837} 6837}
@@ -7628,12 +7628,12 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
7628static int nl80211_send_scan_msg(struct sk_buff *msg, 7628static int nl80211_send_scan_msg(struct sk_buff *msg,
7629 struct cfg80211_registered_device *rdev, 7629 struct cfg80211_registered_device *rdev,
7630 struct wireless_dev *wdev, 7630 struct wireless_dev *wdev,
7631 u32 pid, u32 seq, int flags, 7631 u32 portid, u32 seq, int flags,
7632 u32 cmd) 7632 u32 cmd)
7633{ 7633{
7634 void *hdr; 7634 void *hdr;
7635 7635
7636 hdr = nl80211hdr_put(msg, pid, seq, flags, cmd); 7636 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
7637 if (!hdr) 7637 if (!hdr)
7638 return -1; 7638 return -1;
7639 7639
@@ -7657,11 +7657,11 @@ static int
7657nl80211_send_sched_scan_msg(struct sk_buff *msg, 7657nl80211_send_sched_scan_msg(struct sk_buff *msg,
7658 struct cfg80211_registered_device *rdev, 7658 struct cfg80211_registered_device *rdev,
7659 struct net_device *netdev, 7659 struct net_device *netdev,
7660 u32 pid, u32 seq, int flags, u32 cmd) 7660 u32 portid, u32 seq, int flags, u32 cmd)
7661{ 7661{
7662 void *hdr; 7662 void *hdr;
7663 7663
7664 hdr = nl80211hdr_put(msg, pid, seq, flags, cmd); 7664 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
7665 if (!hdr) 7665 if (!hdr)
7666 return -1; 7666 return -1;
7667 7667
@@ -8370,9 +8370,9 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
8370 struct sk_buff *msg; 8370 struct sk_buff *msg;
8371 void *hdr; 8371 void *hdr;
8372 int err; 8372 int err;
8373 u32 nlpid = ACCESS_ONCE(wdev->ap_unexpected_nlpid); 8373 u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid);
8374 8374
8375 if (!nlpid) 8375 if (!nlportid)
8376 return false; 8376 return false;
8377 8377
8378 msg = nlmsg_new(100, gfp); 8378 msg = nlmsg_new(100, gfp);
@@ -8396,7 +8396,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
8396 return true; 8396 return true;
8397 } 8397 }
8398 8398
8399 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); 8399 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
8400 return true; 8400 return true;
8401 8401
8402 nla_put_failure: 8402 nla_put_failure:
@@ -8420,7 +8420,7 @@ bool nl80211_unexpected_4addr_frame(struct net_device *dev,
8420} 8420}
8421 8421
8422int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, 8422int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
8423 struct wireless_dev *wdev, u32 nlpid, 8423 struct wireless_dev *wdev, u32 nlportid,
8424 int freq, int sig_dbm, 8424 int freq, int sig_dbm,
8425 const u8 *buf, size_t len, gfp_t gfp) 8425 const u8 *buf, size_t len, gfp_t gfp)
8426{ 8426{
@@ -8449,7 +8449,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
8449 8449
8450 genlmsg_end(msg, hdr); 8450 genlmsg_end(msg, hdr);
8451 8451
8452 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); 8452 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
8453 8453
8454 nla_put_failure: 8454 nla_put_failure:
8455 genlmsg_cancel(msg, hdr); 8455 genlmsg_cancel(msg, hdr);
@@ -8804,9 +8804,9 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
8804 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 8804 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
8805 struct sk_buff *msg; 8805 struct sk_buff *msg;
8806 void *hdr; 8806 void *hdr;
8807 u32 nlpid = ACCESS_ONCE(rdev->ap_beacons_nlpid); 8807 u32 nlportid = ACCESS_ONCE(rdev->ap_beacons_nlportid);
8808 8808
8809 if (!nlpid) 8809 if (!nlportid)
8810 return; 8810 return;
8811 8811
8812 msg = nlmsg_new(len + 100, gfp); 8812 msg = nlmsg_new(len + 100, gfp);
@@ -8829,7 +8829,7 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
8829 8829
8830 genlmsg_end(msg, hdr); 8830 genlmsg_end(msg, hdr);
8831 8831
8832 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); 8832 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
8833 return; 8833 return;
8834 8834
8835 nla_put_failure: 8835 nla_put_failure:
@@ -8853,9 +8853,9 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
8853 8853
8854 list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) { 8854 list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
8855 list_for_each_entry_rcu(wdev, &rdev->wdev_list, list) 8855 list_for_each_entry_rcu(wdev, &rdev->wdev_list, list)
8856 cfg80211_mlme_unregister_socket(wdev, notify->pid); 8856 cfg80211_mlme_unregister_socket(wdev, notify->portid);
8857 if (rdev->ap_beacons_nlpid == notify->pid) 8857 if (rdev->ap_beacons_nlportid == notify->portid)
8858 rdev->ap_beacons_nlpid = 0; 8858 rdev->ap_beacons_nlportid = 0;
8859 } 8859 }
8860 8860
8861 rcu_read_unlock(); 8861 rcu_read_unlock();
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 7856c33898fa..30edad44e7fc 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -166,7 +166,7 @@ static DEFINE_SPINLOCK(xfrm_state_gc_lock);
166int __xfrm_state_delete(struct xfrm_state *x); 166int __xfrm_state_delete(struct xfrm_state *x);
167 167
168int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); 168int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
169void km_state_expired(struct xfrm_state *x, int hard, u32 pid); 169void km_state_expired(struct xfrm_state *x, int hard, u32 portid);
170 170
171static struct xfrm_state_afinfo *xfrm_state_lock_afinfo(unsigned int family) 171static struct xfrm_state_afinfo *xfrm_state_lock_afinfo(unsigned int family)
172{ 172{
@@ -1674,13 +1674,13 @@ void km_state_notify(struct xfrm_state *x, const struct km_event *c)
1674EXPORT_SYMBOL(km_policy_notify); 1674EXPORT_SYMBOL(km_policy_notify);
1675EXPORT_SYMBOL(km_state_notify); 1675EXPORT_SYMBOL(km_state_notify);
1676 1676
1677void km_state_expired(struct xfrm_state *x, int hard, u32 pid) 1677void km_state_expired(struct xfrm_state *x, int hard, u32 portid)
1678{ 1678{
1679 struct net *net = xs_net(x); 1679 struct net *net = xs_net(x);
1680 struct km_event c; 1680 struct km_event c;
1681 1681
1682 c.data.hard = hard; 1682 c.data.hard = hard;
1683 c.pid = pid; 1683 c.portid = portid;
1684 c.event = XFRM_MSG_EXPIRE; 1684 c.event = XFRM_MSG_EXPIRE;
1685 km_state_notify(x, &c); 1685 km_state_notify(x, &c);
1686 1686
@@ -1726,13 +1726,13 @@ int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport)
1726} 1726}
1727EXPORT_SYMBOL(km_new_mapping); 1727EXPORT_SYMBOL(km_new_mapping);
1728 1728
1729void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid) 1729void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 portid)
1730{ 1730{
1731 struct net *net = xp_net(pol); 1731 struct net *net = xp_net(pol);
1732 struct km_event c; 1732 struct km_event c;
1733 1733
1734 c.data.hard = hard; 1734 c.data.hard = hard;
1735 c.pid = pid; 1735 c.portid = portid;
1736 c.event = XFRM_MSG_POLEXPIRE; 1736 c.event = XFRM_MSG_POLEXPIRE;
1737 km_policy_notify(pol, dir, &c); 1737 km_policy_notify(pol, dir, &c);
1738 1738
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 354070adb5ef..b313d932d678 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -603,7 +603,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
603 } 603 }
604 604
605 c.seq = nlh->nlmsg_seq; 605 c.seq = nlh->nlmsg_seq;
606 c.pid = nlh->nlmsg_pid; 606 c.portid = nlh->nlmsg_pid;
607 c.event = nlh->nlmsg_type; 607 c.event = nlh->nlmsg_type;
608 608
609 km_state_notify(x, &c); 609 km_state_notify(x, &c);
@@ -676,7 +676,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
676 goto out; 676 goto out;
677 677
678 c.seq = nlh->nlmsg_seq; 678 c.seq = nlh->nlmsg_seq;
679 c.pid = nlh->nlmsg_pid; 679 c.portid = nlh->nlmsg_pid;
680 c.event = nlh->nlmsg_type; 680 c.event = nlh->nlmsg_type;
681 km_state_notify(x, &c); 681 km_state_notify(x, &c);
682 682
@@ -826,7 +826,7 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr)
826 struct nlmsghdr *nlh; 826 struct nlmsghdr *nlh;
827 int err; 827 int err;
828 828
829 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq, 829 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
830 XFRM_MSG_NEWSA, sizeof(*p), sp->nlmsg_flags); 830 XFRM_MSG_NEWSA, sizeof(*p), sp->nlmsg_flags);
831 if (nlh == NULL) 831 if (nlh == NULL)
832 return -EMSGSIZE; 832 return -EMSGSIZE;
@@ -904,7 +904,7 @@ static inline size_t xfrm_spdinfo_msgsize(void)
904} 904}
905 905
906static int build_spdinfo(struct sk_buff *skb, struct net *net, 906static int build_spdinfo(struct sk_buff *skb, struct net *net,
907 u32 pid, u32 seq, u32 flags) 907 u32 portid, u32 seq, u32 flags)
908{ 908{
909 struct xfrmk_spdinfo si; 909 struct xfrmk_spdinfo si;
910 struct xfrmu_spdinfo spc; 910 struct xfrmu_spdinfo spc;
@@ -913,7 +913,7 @@ static int build_spdinfo(struct sk_buff *skb, struct net *net,
913 int err; 913 int err;
914 u32 *f; 914 u32 *f;
915 915
916 nlh = nlmsg_put(skb, pid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); 916 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0);
917 if (nlh == NULL) /* shouldn't really happen ... */ 917 if (nlh == NULL) /* shouldn't really happen ... */
918 return -EMSGSIZE; 918 return -EMSGSIZE;
919 919
@@ -946,17 +946,17 @@ static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
946 struct net *net = sock_net(skb->sk); 946 struct net *net = sock_net(skb->sk);
947 struct sk_buff *r_skb; 947 struct sk_buff *r_skb;
948 u32 *flags = nlmsg_data(nlh); 948 u32 *flags = nlmsg_data(nlh);
949 u32 spid = NETLINK_CB(skb).pid; 949 u32 sportid = NETLINK_CB(skb).portid;
950 u32 seq = nlh->nlmsg_seq; 950 u32 seq = nlh->nlmsg_seq;
951 951
952 r_skb = nlmsg_new(xfrm_spdinfo_msgsize(), GFP_ATOMIC); 952 r_skb = nlmsg_new(xfrm_spdinfo_msgsize(), GFP_ATOMIC);
953 if (r_skb == NULL) 953 if (r_skb == NULL)
954 return -ENOMEM; 954 return -ENOMEM;
955 955
956 if (build_spdinfo(r_skb, net, spid, seq, *flags) < 0) 956 if (build_spdinfo(r_skb, net, sportid, seq, *flags) < 0)
957 BUG(); 957 BUG();
958 958
959 return nlmsg_unicast(net->xfrm.nlsk, r_skb, spid); 959 return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
960} 960}
961 961
962static inline size_t xfrm_sadinfo_msgsize(void) 962static inline size_t xfrm_sadinfo_msgsize(void)
@@ -967,7 +967,7 @@ static inline size_t xfrm_sadinfo_msgsize(void)
967} 967}
968 968
969static int build_sadinfo(struct sk_buff *skb, struct net *net, 969static int build_sadinfo(struct sk_buff *skb, struct net *net,
970 u32 pid, u32 seq, u32 flags) 970 u32 portid, u32 seq, u32 flags)
971{ 971{
972 struct xfrmk_sadinfo si; 972 struct xfrmk_sadinfo si;
973 struct xfrmu_sadhinfo sh; 973 struct xfrmu_sadhinfo sh;
@@ -975,7 +975,7 @@ static int build_sadinfo(struct sk_buff *skb, struct net *net,
975 int err; 975 int err;
976 u32 *f; 976 u32 *f;
977 977
978 nlh = nlmsg_put(skb, pid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); 978 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0);
979 if (nlh == NULL) /* shouldn't really happen ... */ 979 if (nlh == NULL) /* shouldn't really happen ... */
980 return -EMSGSIZE; 980 return -EMSGSIZE;
981 981
@@ -1003,17 +1003,17 @@ static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1003 struct net *net = sock_net(skb->sk); 1003 struct net *net = sock_net(skb->sk);
1004 struct sk_buff *r_skb; 1004 struct sk_buff *r_skb;
1005 u32 *flags = nlmsg_data(nlh); 1005 u32 *flags = nlmsg_data(nlh);
1006 u32 spid = NETLINK_CB(skb).pid; 1006 u32 sportid = NETLINK_CB(skb).portid;
1007 u32 seq = nlh->nlmsg_seq; 1007 u32 seq = nlh->nlmsg_seq;
1008 1008
1009 r_skb = nlmsg_new(xfrm_sadinfo_msgsize(), GFP_ATOMIC); 1009 r_skb = nlmsg_new(xfrm_sadinfo_msgsize(), GFP_ATOMIC);
1010 if (r_skb == NULL) 1010 if (r_skb == NULL)
1011 return -ENOMEM; 1011 return -ENOMEM;
1012 1012
1013 if (build_sadinfo(r_skb, net, spid, seq, *flags) < 0) 1013 if (build_sadinfo(r_skb, net, sportid, seq, *flags) < 0)
1014 BUG(); 1014 BUG();
1015 1015
1016 return nlmsg_unicast(net->xfrm.nlsk, r_skb, spid); 1016 return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
1017} 1017}
1018 1018
1019static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, 1019static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
@@ -1033,7 +1033,7 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1033 if (IS_ERR(resp_skb)) { 1033 if (IS_ERR(resp_skb)) {
1034 err = PTR_ERR(resp_skb); 1034 err = PTR_ERR(resp_skb);
1035 } else { 1035 } else {
1036 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).pid); 1036 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
1037 } 1037 }
1038 xfrm_state_put(x); 1038 xfrm_state_put(x);
1039out_noput: 1039out_noput:
@@ -1114,7 +1114,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
1114 goto out; 1114 goto out;
1115 } 1115 }
1116 1116
1117 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).pid); 1117 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
1118 1118
1119out: 1119out:
1120 xfrm_state_put(x); 1120 xfrm_state_put(x);
@@ -1401,7 +1401,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1401 1401
1402 c.event = nlh->nlmsg_type; 1402 c.event = nlh->nlmsg_type;
1403 c.seq = nlh->nlmsg_seq; 1403 c.seq = nlh->nlmsg_seq;
1404 c.pid = nlh->nlmsg_pid; 1404 c.portid = nlh->nlmsg_pid;
1405 km_policy_notify(xp, p->dir, &c); 1405 km_policy_notify(xp, p->dir, &c);
1406 1406
1407 xfrm_pol_put(xp); 1407 xfrm_pol_put(xp);
@@ -1486,7 +1486,7 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr
1486 struct nlmsghdr *nlh; 1486 struct nlmsghdr *nlh;
1487 int err; 1487 int err;
1488 1488
1489 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq, 1489 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
1490 XFRM_MSG_NEWPOLICY, sizeof(*p), sp->nlmsg_flags); 1490 XFRM_MSG_NEWPOLICY, sizeof(*p), sp->nlmsg_flags);
1491 if (nlh == NULL) 1491 if (nlh == NULL)
1492 return -EMSGSIZE; 1492 return -EMSGSIZE;
@@ -1621,7 +1621,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1621 err = PTR_ERR(resp_skb); 1621 err = PTR_ERR(resp_skb);
1622 } else { 1622 } else {
1623 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, 1623 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb,
1624 NETLINK_CB(skb).pid); 1624 NETLINK_CB(skb).portid);
1625 } 1625 }
1626 } else { 1626 } else {
1627 uid_t loginuid = audit_get_loginuid(current); 1627 uid_t loginuid = audit_get_loginuid(current);
@@ -1638,7 +1638,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1638 c.data.byid = p->index; 1638 c.data.byid = p->index;
1639 c.event = nlh->nlmsg_type; 1639 c.event = nlh->nlmsg_type;
1640 c.seq = nlh->nlmsg_seq; 1640 c.seq = nlh->nlmsg_seq;
1641 c.pid = nlh->nlmsg_pid; 1641 c.portid = nlh->nlmsg_pid;
1642 km_policy_notify(xp, p->dir, &c); 1642 km_policy_notify(xp, p->dir, &c);
1643 } 1643 }
1644 1644
@@ -1668,7 +1668,7 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1668 c.data.proto = p->proto; 1668 c.data.proto = p->proto;
1669 c.event = nlh->nlmsg_type; 1669 c.event = nlh->nlmsg_type;
1670 c.seq = nlh->nlmsg_seq; 1670 c.seq = nlh->nlmsg_seq;
1671 c.pid = nlh->nlmsg_pid; 1671 c.portid = nlh->nlmsg_pid;
1672 c.net = net; 1672 c.net = net;
1673 km_state_notify(NULL, &c); 1673 km_state_notify(NULL, &c);
1674 1674
@@ -1695,7 +1695,7 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct
1695 struct nlmsghdr *nlh; 1695 struct nlmsghdr *nlh;
1696 int err; 1696 int err;
1697 1697
1698 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); 1698 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0);
1699 if (nlh == NULL) 1699 if (nlh == NULL)
1700 return -EMSGSIZE; 1700 return -EMSGSIZE;
1701 1701
@@ -1777,11 +1777,11 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
1777 spin_lock_bh(&x->lock); 1777 spin_lock_bh(&x->lock);
1778 c.data.aevent = p->flags; 1778 c.data.aevent = p->flags;
1779 c.seq = nlh->nlmsg_seq; 1779 c.seq = nlh->nlmsg_seq;
1780 c.pid = nlh->nlmsg_pid; 1780 c.portid = nlh->nlmsg_pid;
1781 1781
1782 if (build_aevent(r_skb, x, &c) < 0) 1782 if (build_aevent(r_skb, x, &c) < 0)
1783 BUG(); 1783 BUG();
1784 err = nlmsg_unicast(net->xfrm.nlsk, r_skb, NETLINK_CB(skb).pid); 1784 err = nlmsg_unicast(net->xfrm.nlsk, r_skb, NETLINK_CB(skb).portid);
1785 spin_unlock_bh(&x->lock); 1785 spin_unlock_bh(&x->lock);
1786 xfrm_state_put(x); 1786 xfrm_state_put(x);
1787 return err; 1787 return err;
@@ -1827,7 +1827,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
1827 1827
1828 c.event = nlh->nlmsg_type; 1828 c.event = nlh->nlmsg_type;
1829 c.seq = nlh->nlmsg_seq; 1829 c.seq = nlh->nlmsg_seq;
1830 c.pid = nlh->nlmsg_pid; 1830 c.portid = nlh->nlmsg_pid;
1831 c.data.aevent = XFRM_AE_CU; 1831 c.data.aevent = XFRM_AE_CU;
1832 km_state_notify(x, &c); 1832 km_state_notify(x, &c);
1833 err = 0; 1833 err = 0;
@@ -1862,7 +1862,7 @@ static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1862 c.data.type = type; 1862 c.data.type = type;
1863 c.event = nlh->nlmsg_type; 1863 c.event = nlh->nlmsg_type;
1864 c.seq = nlh->nlmsg_seq; 1864 c.seq = nlh->nlmsg_seq;
1865 c.pid = nlh->nlmsg_pid; 1865 c.portid = nlh->nlmsg_pid;
1866 c.net = net; 1866 c.net = net;
1867 km_policy_notify(NULL, 0, &c); 1867 km_policy_notify(NULL, 0, &c);
1868 return 0; 1868 return 0;
@@ -2370,7 +2370,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct
2370 struct nlmsghdr *nlh; 2370 struct nlmsghdr *nlh;
2371 int err; 2371 int err;
2372 2372
2373 nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); 2373 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0);
2374 if (nlh == NULL) 2374 if (nlh == NULL)
2375 return -EMSGSIZE; 2375 return -EMSGSIZE;
2376 2376
@@ -2429,7 +2429,7 @@ static int xfrm_notify_sa_flush(const struct km_event *c)
2429 if (skb == NULL) 2429 if (skb == NULL)
2430 return -ENOMEM; 2430 return -ENOMEM;
2431 2431
2432 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); 2432 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0);
2433 if (nlh == NULL) { 2433 if (nlh == NULL) {
2434 kfree_skb(skb); 2434 kfree_skb(skb);
2435 return -EMSGSIZE; 2435 return -EMSGSIZE;
@@ -2497,7 +2497,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c)
2497 if (skb == NULL) 2497 if (skb == NULL)
2498 return -ENOMEM; 2498 return -ENOMEM;
2499 2499
2500 nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); 2500 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
2501 err = -EMSGSIZE; 2501 err = -EMSGSIZE;
2502 if (nlh == NULL) 2502 if (nlh == NULL)
2503 goto out_free_skb; 2503 goto out_free_skb;
@@ -2696,7 +2696,7 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp,
2696 struct nlmsghdr *nlh; 2696 struct nlmsghdr *nlh;
2697 int err; 2697 int err;
2698 2698
2699 nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); 2699 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0);
2700 if (nlh == NULL) 2700 if (nlh == NULL)
2701 return -EMSGSIZE; 2701 return -EMSGSIZE;
2702 2702
@@ -2756,7 +2756,7 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, const struct km_e
2756 if (skb == NULL) 2756 if (skb == NULL)
2757 return -ENOMEM; 2757 return -ENOMEM;
2758 2758
2759 nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); 2759 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
2760 err = -EMSGSIZE; 2760 err = -EMSGSIZE;
2761 if (nlh == NULL) 2761 if (nlh == NULL)
2762 goto out_free_skb; 2762 goto out_free_skb;
@@ -2810,7 +2810,7 @@ static int xfrm_notify_policy_flush(const struct km_event *c)
2810 if (skb == NULL) 2810 if (skb == NULL)
2811 return -ENOMEM; 2811 return -ENOMEM;
2812 2812
2813 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); 2813 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0);
2814 err = -EMSGSIZE; 2814 err = -EMSGSIZE;
2815 if (nlh == NULL) 2815 if (nlh == NULL)
2816 goto out_free_skb; 2816 goto out_free_skb;