aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 16:38:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 16:38:27 -0400
commitaecdc33e111b2c447b622e287c6003726daa1426 (patch)
tree3e7657eae4b785e1a1fb5dfb225dbae0b2f0cfc6 /net/xfrm/xfrm_user.c
parenta20acf99f75e49271381d65db097c9763060a1e8 (diff)
parenta3a6cab5ea10cca64d036851fe0d932448f2fe4f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking changes from David Miller: 1) GRE now works over ipv6, from Dmitry Kozlov. 2) Make SCTP more network namespace aware, from Eric Biederman. 3) TEAM driver now works with non-ethernet devices, from Jiri Pirko. 4) Make openvswitch network namespace aware, from Pravin B Shelar. 5) IPV6 NAT implementation, from Patrick McHardy. 6) Server side support for TCP Fast Open, from Jerry Chu and others. 7) Packet BPF filter supports MOD and XOR, from Eric Dumazet and Daniel Borkmann. 8) Increate the loopback default MTU to 64K, from Eric Dumazet. 9) Use a per-task rather than per-socket page fragment allocator for outgoing networking traffic. This benefits processes that have very many mostly idle sockets, which is quite common. From Eric Dumazet. 10) Use up to 32K for page fragment allocations, with fallbacks to smaller sizes when higher order page allocations fail. Benefits are a) less segments for driver to process b) less calls to page allocator c) less waste of space. From Eric Dumazet. 11) Allow GRO to be used on GRE tunnels, from Eric Dumazet. 12) VXLAN device driver, one way to handle VLAN issues such as the limitation of 4096 VLAN IDs yet still have some level of isolation. From Stephen Hemminger. 13) As usual there is a large boatload of driver changes, with the scale perhaps tilted towards the wireless side this time around. Fix up various fairly trivial conflicts, mostly caused by the user namespace changes. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1012 commits) hyperv: Add buffer for extended info after the RNDIS response message. hyperv: Report actual status in receive completion packet hyperv: Remove extra allocated space for recv_pkt_list elements hyperv: Fix page buffer handling in rndis_filter_send_request() hyperv: Fix the missing return value in rndis_filter_set_packet_filter() hyperv: Fix the max_xfer_size in RNDIS initialization vxlan: put UDP socket in correct namespace vxlan: Depend on CONFIG_INET sfc: Fix the reported priorities of different filter types sfc: Remove EFX_FILTER_FLAG_RX_OVERRIDE_IP sfc: Fix loopback self-test with separate_tx_channels=1 sfc: Fix MCDI structure field lookup sfc: Add parentheses around use of bitfield macro arguments sfc: Fix null function pointer in efx_sriov_channel_type vxlan: virtual extensible lan igmp: export symbol ip_mc_leave_group netlink: add attributes to fdb interface tg3: unconditionally select HWMON support when tg3 is enabled. Revert "net: ti cpsw ethernet: allow reading phy interface mode from DT" gre: fix sparse warning ...
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index bc542448307a..421f98444335 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -623,7 +623,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
623 } 623 }
624 624
625 c.seq = nlh->nlmsg_seq; 625 c.seq = nlh->nlmsg_seq;
626 c.pid = nlh->nlmsg_pid; 626 c.portid = nlh->nlmsg_pid;
627 c.event = nlh->nlmsg_type; 627 c.event = nlh->nlmsg_type;
628 628
629 km_state_notify(x, &c); 629 km_state_notify(x, &c);
@@ -696,7 +696,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
696 goto out; 696 goto out;
697 697
698 c.seq = nlh->nlmsg_seq; 698 c.seq = nlh->nlmsg_seq;
699 c.pid = nlh->nlmsg_pid; 699 c.portid = nlh->nlmsg_pid;
700 c.event = nlh->nlmsg_type; 700 c.event = nlh->nlmsg_type;
701 km_state_notify(x, &c); 701 km_state_notify(x, &c);
702 702
@@ -847,7 +847,7 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr)
847 struct nlmsghdr *nlh; 847 struct nlmsghdr *nlh;
848 int err; 848 int err;
849 849
850 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq, 850 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
851 XFRM_MSG_NEWSA, sizeof(*p), sp->nlmsg_flags); 851 XFRM_MSG_NEWSA, sizeof(*p), sp->nlmsg_flags);
852 if (nlh == NULL) 852 if (nlh == NULL)
853 return -EMSGSIZE; 853 return -EMSGSIZE;
@@ -927,7 +927,7 @@ static inline size_t xfrm_spdinfo_msgsize(void)
927} 927}
928 928
929static int build_spdinfo(struct sk_buff *skb, struct net *net, 929static int build_spdinfo(struct sk_buff *skb, struct net *net,
930 u32 pid, u32 seq, u32 flags) 930 u32 portid, u32 seq, u32 flags)
931{ 931{
932 struct xfrmk_spdinfo si; 932 struct xfrmk_spdinfo si;
933 struct xfrmu_spdinfo spc; 933 struct xfrmu_spdinfo spc;
@@ -936,7 +936,7 @@ static int build_spdinfo(struct sk_buff *skb, struct net *net,
936 int err; 936 int err;
937 u32 *f; 937 u32 *f;
938 938
939 nlh = nlmsg_put(skb, pid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); 939 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0);
940 if (nlh == NULL) /* shouldn't really happen ... */ 940 if (nlh == NULL) /* shouldn't really happen ... */
941 return -EMSGSIZE; 941 return -EMSGSIZE;
942 942
@@ -969,17 +969,17 @@ static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
969 struct net *net = sock_net(skb->sk); 969 struct net *net = sock_net(skb->sk);
970 struct sk_buff *r_skb; 970 struct sk_buff *r_skb;
971 u32 *flags = nlmsg_data(nlh); 971 u32 *flags = nlmsg_data(nlh);
972 u32 spid = NETLINK_CB(skb).pid; 972 u32 sportid = NETLINK_CB(skb).portid;
973 u32 seq = nlh->nlmsg_seq; 973 u32 seq = nlh->nlmsg_seq;
974 974
975 r_skb = nlmsg_new(xfrm_spdinfo_msgsize(), GFP_ATOMIC); 975 r_skb = nlmsg_new(xfrm_spdinfo_msgsize(), GFP_ATOMIC);
976 if (r_skb == NULL) 976 if (r_skb == NULL)
977 return -ENOMEM; 977 return -ENOMEM;
978 978
979 if (build_spdinfo(r_skb, net, spid, seq, *flags) < 0) 979 if (build_spdinfo(r_skb, net, sportid, seq, *flags) < 0)
980 BUG(); 980 BUG();
981 981
982 return nlmsg_unicast(net->xfrm.nlsk, r_skb, spid); 982 return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
983} 983}
984 984
985static inline size_t xfrm_sadinfo_msgsize(void) 985static inline size_t xfrm_sadinfo_msgsize(void)
@@ -990,7 +990,7 @@ static inline size_t xfrm_sadinfo_msgsize(void)
990} 990}
991 991
992static int build_sadinfo(struct sk_buff *skb, struct net *net, 992static int build_sadinfo(struct sk_buff *skb, struct net *net,
993 u32 pid, u32 seq, u32 flags) 993 u32 portid, u32 seq, u32 flags)
994{ 994{
995 struct xfrmk_sadinfo si; 995 struct xfrmk_sadinfo si;
996 struct xfrmu_sadhinfo sh; 996 struct xfrmu_sadhinfo sh;
@@ -998,7 +998,7 @@ static int build_sadinfo(struct sk_buff *skb, struct net *net,
998 int err; 998 int err;
999 u32 *f; 999 u32 *f;
1000 1000
1001 nlh = nlmsg_put(skb, pid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); 1001 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0);
1002 if (nlh == NULL) /* shouldn't really happen ... */ 1002 if (nlh == NULL) /* shouldn't really happen ... */
1003 return -EMSGSIZE; 1003 return -EMSGSIZE;
1004 1004
@@ -1026,17 +1026,17 @@ static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1026 struct net *net = sock_net(skb->sk); 1026 struct net *net = sock_net(skb->sk);
1027 struct sk_buff *r_skb; 1027 struct sk_buff *r_skb;
1028 u32 *flags = nlmsg_data(nlh); 1028 u32 *flags = nlmsg_data(nlh);
1029 u32 spid = NETLINK_CB(skb).pid; 1029 u32 sportid = NETLINK_CB(skb).portid;
1030 u32 seq = nlh->nlmsg_seq; 1030 u32 seq = nlh->nlmsg_seq;
1031 1031
1032 r_skb = nlmsg_new(xfrm_sadinfo_msgsize(), GFP_ATOMIC); 1032 r_skb = nlmsg_new(xfrm_sadinfo_msgsize(), GFP_ATOMIC);
1033 if (r_skb == NULL) 1033 if (r_skb == NULL)
1034 return -ENOMEM; 1034 return -ENOMEM;
1035 1035
1036 if (build_sadinfo(r_skb, net, spid, seq, *flags) < 0) 1036 if (build_sadinfo(r_skb, net, sportid, seq, *flags) < 0)
1037 BUG(); 1037 BUG();
1038 1038
1039 return nlmsg_unicast(net->xfrm.nlsk, r_skb, spid); 1039 return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
1040} 1040}
1041 1041
1042static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, 1042static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
@@ -1056,7 +1056,7 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1056 if (IS_ERR(resp_skb)) { 1056 if (IS_ERR(resp_skb)) {
1057 err = PTR_ERR(resp_skb); 1057 err = PTR_ERR(resp_skb);
1058 } else { 1058 } else {
1059 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).pid); 1059 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
1060 } 1060 }
1061 xfrm_state_put(x); 1061 xfrm_state_put(x);
1062out_noput: 1062out_noput:
@@ -1137,7 +1137,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
1137 goto out; 1137 goto out;
1138 } 1138 }
1139 1139
1140 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).pid); 1140 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
1141 1141
1142out: 1142out:
1143 xfrm_state_put(x); 1143 xfrm_state_put(x);
@@ -1425,7 +1425,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1425 1425
1426 c.event = nlh->nlmsg_type; 1426 c.event = nlh->nlmsg_type;
1427 c.seq = nlh->nlmsg_seq; 1427 c.seq = nlh->nlmsg_seq;
1428 c.pid = nlh->nlmsg_pid; 1428 c.portid = nlh->nlmsg_pid;
1429 km_policy_notify(xp, p->dir, &c); 1429 km_policy_notify(xp, p->dir, &c);
1430 1430
1431 xfrm_pol_put(xp); 1431 xfrm_pol_put(xp);
@@ -1511,7 +1511,7 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr
1511 struct nlmsghdr *nlh; 1511 struct nlmsghdr *nlh;
1512 int err; 1512 int err;
1513 1513
1514 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq, 1514 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
1515 XFRM_MSG_NEWPOLICY, sizeof(*p), sp->nlmsg_flags); 1515 XFRM_MSG_NEWPOLICY, sizeof(*p), sp->nlmsg_flags);
1516 if (nlh == NULL) 1516 if (nlh == NULL)
1517 return -EMSGSIZE; 1517 return -EMSGSIZE;
@@ -1648,7 +1648,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1648 err = PTR_ERR(resp_skb); 1648 err = PTR_ERR(resp_skb);
1649 } else { 1649 } else {
1650 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, 1650 err = nlmsg_unicast(net->xfrm.nlsk, resp_skb,
1651 NETLINK_CB(skb).pid); 1651 NETLINK_CB(skb).portid);
1652 } 1652 }
1653 } else { 1653 } else {
1654 kuid_t loginuid = audit_get_loginuid(current); 1654 kuid_t loginuid = audit_get_loginuid(current);
@@ -1665,7 +1665,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1665 c.data.byid = p->index; 1665 c.data.byid = p->index;
1666 c.event = nlh->nlmsg_type; 1666 c.event = nlh->nlmsg_type;
1667 c.seq = nlh->nlmsg_seq; 1667 c.seq = nlh->nlmsg_seq;
1668 c.pid = nlh->nlmsg_pid; 1668 c.portid = nlh->nlmsg_pid;
1669 km_policy_notify(xp, p->dir, &c); 1669 km_policy_notify(xp, p->dir, &c);
1670 } 1670 }
1671 1671
@@ -1695,7 +1695,7 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1695 c.data.proto = p->proto; 1695 c.data.proto = p->proto;
1696 c.event = nlh->nlmsg_type; 1696 c.event = nlh->nlmsg_type;
1697 c.seq = nlh->nlmsg_seq; 1697 c.seq = nlh->nlmsg_seq;
1698 c.pid = nlh->nlmsg_pid; 1698 c.portid = nlh->nlmsg_pid;
1699 c.net = net; 1699 c.net = net;
1700 km_state_notify(NULL, &c); 1700 km_state_notify(NULL, &c);
1701 1701
@@ -1722,7 +1722,7 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct
1722 struct nlmsghdr *nlh; 1722 struct nlmsghdr *nlh;
1723 int err; 1723 int err;
1724 1724
1725 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); 1725 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0);
1726 if (nlh == NULL) 1726 if (nlh == NULL)
1727 return -EMSGSIZE; 1727 return -EMSGSIZE;
1728 1728
@@ -1804,11 +1804,11 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
1804 spin_lock_bh(&x->lock); 1804 spin_lock_bh(&x->lock);
1805 c.data.aevent = p->flags; 1805 c.data.aevent = p->flags;
1806 c.seq = nlh->nlmsg_seq; 1806 c.seq = nlh->nlmsg_seq;
1807 c.pid = nlh->nlmsg_pid; 1807 c.portid = nlh->nlmsg_pid;
1808 1808
1809 if (build_aevent(r_skb, x, &c) < 0) 1809 if (build_aevent(r_skb, x, &c) < 0)
1810 BUG(); 1810 BUG();
1811 err = nlmsg_unicast(net->xfrm.nlsk, r_skb, NETLINK_CB(skb).pid); 1811 err = nlmsg_unicast(net->xfrm.nlsk, r_skb, NETLINK_CB(skb).portid);
1812 spin_unlock_bh(&x->lock); 1812 spin_unlock_bh(&x->lock);
1813 xfrm_state_put(x); 1813 xfrm_state_put(x);
1814 return err; 1814 return err;
@@ -1854,7 +1854,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
1854 1854
1855 c.event = nlh->nlmsg_type; 1855 c.event = nlh->nlmsg_type;
1856 c.seq = nlh->nlmsg_seq; 1856 c.seq = nlh->nlmsg_seq;
1857 c.pid = nlh->nlmsg_pid; 1857 c.portid = nlh->nlmsg_pid;
1858 c.data.aevent = XFRM_AE_CU; 1858 c.data.aevent = XFRM_AE_CU;
1859 km_state_notify(x, &c); 1859 km_state_notify(x, &c);
1860 err = 0; 1860 err = 0;
@@ -1889,7 +1889,7 @@ static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1889 c.data.type = type; 1889 c.data.type = type;
1890 c.event = nlh->nlmsg_type; 1890 c.event = nlh->nlmsg_type;
1891 c.seq = nlh->nlmsg_seq; 1891 c.seq = nlh->nlmsg_seq;
1892 c.pid = nlh->nlmsg_pid; 1892 c.portid = nlh->nlmsg_pid;
1893 c.net = net; 1893 c.net = net;
1894 km_policy_notify(NULL, 0, &c); 1894 km_policy_notify(NULL, 0, &c);
1895 return 0; 1895 return 0;
@@ -1957,7 +1957,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1957 // reset the timers here? 1957 // reset the timers here?
1958 WARN(1, "Dont know what to do with soft policy expire\n"); 1958 WARN(1, "Dont know what to do with soft policy expire\n");
1959 } 1959 }
1960 km_policy_expired(xp, p->dir, up->hard, current->pid); 1960 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid);
1961 1961
1962out: 1962out:
1963 xfrm_pol_put(xp); 1963 xfrm_pol_put(xp);
@@ -1985,7 +1985,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1985 err = -EINVAL; 1985 err = -EINVAL;
1986 if (x->km.state != XFRM_STATE_VALID) 1986 if (x->km.state != XFRM_STATE_VALID)
1987 goto out; 1987 goto out;
1988 km_state_expired(x, ue->hard, current->pid); 1988 km_state_expired(x, ue->hard, nlh->nlmsg_pid);
1989 1989
1990 if (ue->hard) { 1990 if (ue->hard) {
1991 kuid_t loginuid = audit_get_loginuid(current); 1991 kuid_t loginuid = audit_get_loginuid(current);
@@ -2397,7 +2397,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct
2397 struct nlmsghdr *nlh; 2397 struct nlmsghdr *nlh;
2398 int err; 2398 int err;
2399 2399
2400 nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); 2400 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0);
2401 if (nlh == NULL) 2401 if (nlh == NULL)
2402 return -EMSGSIZE; 2402 return -EMSGSIZE;
2403 2403
@@ -2456,7 +2456,7 @@ static int xfrm_notify_sa_flush(const struct km_event *c)
2456 if (skb == NULL) 2456 if (skb == NULL)
2457 return -ENOMEM; 2457 return -ENOMEM;
2458 2458
2459 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); 2459 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0);
2460 if (nlh == NULL) { 2460 if (nlh == NULL) {
2461 kfree_skb(skb); 2461 kfree_skb(skb);
2462 return -EMSGSIZE; 2462 return -EMSGSIZE;
@@ -2524,7 +2524,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c)
2524 if (skb == NULL) 2524 if (skb == NULL)
2525 return -ENOMEM; 2525 return -ENOMEM;
2526 2526
2527 nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); 2527 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
2528 err = -EMSGSIZE; 2528 err = -EMSGSIZE;
2529 if (nlh == NULL) 2529 if (nlh == NULL)
2530 goto out_free_skb; 2530 goto out_free_skb;
@@ -2594,8 +2594,7 @@ static inline size_t xfrm_acquire_msgsize(struct xfrm_state *x,
2594} 2594}
2595 2595
2596static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, 2596static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2597 struct xfrm_tmpl *xt, struct xfrm_policy *xp, 2597 struct xfrm_tmpl *xt, struct xfrm_policy *xp)
2598 int dir)
2599{ 2598{
2600 __u32 seq = xfrm_get_acqseq(); 2599 __u32 seq = xfrm_get_acqseq();
2601 struct xfrm_user_acquire *ua; 2600 struct xfrm_user_acquire *ua;
@@ -2610,7 +2609,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2610 memcpy(&ua->id, &x->id, sizeof(ua->id)); 2609 memcpy(&ua->id, &x->id, sizeof(ua->id));
2611 memcpy(&ua->saddr, &x->props.saddr, sizeof(ua->saddr)); 2610 memcpy(&ua->saddr, &x->props.saddr, sizeof(ua->saddr));
2612 memcpy(&ua->sel, &x->sel, sizeof(ua->sel)); 2611 memcpy(&ua->sel, &x->sel, sizeof(ua->sel));
2613 copy_to_user_policy(xp, &ua->policy, dir); 2612 copy_to_user_policy(xp, &ua->policy, XFRM_POLICY_OUT);
2614 ua->aalgos = xt->aalgos; 2613 ua->aalgos = xt->aalgos;
2615 ua->ealgos = xt->ealgos; 2614 ua->ealgos = xt->ealgos;
2616 ua->calgos = xt->calgos; 2615 ua->calgos = xt->calgos;
@@ -2632,7 +2631,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
2632} 2631}
2633 2632
2634static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, 2633static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
2635 struct xfrm_policy *xp, int dir) 2634 struct xfrm_policy *xp)
2636{ 2635{
2637 struct net *net = xs_net(x); 2636 struct net *net = xs_net(x);
2638 struct sk_buff *skb; 2637 struct sk_buff *skb;
@@ -2641,7 +2640,7 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
2641 if (skb == NULL) 2640 if (skb == NULL)
2642 return -ENOMEM; 2641 return -ENOMEM;
2643 2642
2644 if (build_acquire(skb, x, xt, xp, dir) < 0) 2643 if (build_acquire(skb, x, xt, xp) < 0)
2645 BUG(); 2644 BUG();
2646 2645
2647 return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC); 2646 return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_ACQUIRE, GFP_ATOMIC);
@@ -2724,7 +2723,7 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp,
2724 struct nlmsghdr *nlh; 2723 struct nlmsghdr *nlh;
2725 int err; 2724 int err;
2726 2725
2727 nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); 2726 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0);
2728 if (nlh == NULL) 2727 if (nlh == NULL)
2729 return -EMSGSIZE; 2728 return -EMSGSIZE;
2730 2729
@@ -2784,7 +2783,7 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, const struct km_e
2784 if (skb == NULL) 2783 if (skb == NULL)
2785 return -ENOMEM; 2784 return -ENOMEM;
2786 2785
2787 nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); 2786 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
2788 err = -EMSGSIZE; 2787 err = -EMSGSIZE;
2789 if (nlh == NULL) 2788 if (nlh == NULL)
2790 goto out_free_skb; 2789 goto out_free_skb;
@@ -2838,7 +2837,7 @@ static int xfrm_notify_policy_flush(const struct km_event *c)
2838 if (skb == NULL) 2837 if (skb == NULL)
2839 return -ENOMEM; 2838 return -ENOMEM;
2840 2839
2841 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); 2840 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0);
2842 err = -EMSGSIZE; 2841 err = -EMSGSIZE;
2843 if (nlh == NULL) 2842 if (nlh == NULL)
2844 goto out_free_skb; 2843 goto out_free_skb;
@@ -2991,7 +2990,7 @@ static int __net_init xfrm_user_net_init(struct net *net)
2991 .input = xfrm_netlink_rcv, 2990 .input = xfrm_netlink_rcv,
2992 }; 2991 };
2993 2992
2994 nlsk = netlink_kernel_create(net, NETLINK_XFRM, THIS_MODULE, &cfg); 2993 nlsk = netlink_kernel_create(net, NETLINK_XFRM, &cfg);
2995 if (nlsk == NULL) 2994 if (nlsk == NULL)
2996 return -ENOMEM; 2995 return -ENOMEM;
2997 net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ 2996 net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */