diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 62 |
1 files changed, 31 insertions, 31 deletions
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 | ||
906 | static int build_spdinfo(struct sk_buff *skb, struct net *net, | 906 | static 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 | ||
962 | static inline size_t xfrm_sadinfo_msgsize(void) | 962 | static inline size_t xfrm_sadinfo_msgsize(void) |
@@ -967,7 +967,7 @@ static inline size_t xfrm_sadinfo_msgsize(void) | |||
967 | } | 967 | } |
968 | 968 | ||
969 | static int build_sadinfo(struct sk_buff *skb, struct net *net, | 969 | static 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 | ||
1019 | static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, | 1019 | static 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); |
1039 | out_noput: | 1039 | out_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 | ||
1119 | out: | 1119 | out: |
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; |