aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/genetlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r--net/netlink/genetlink.c42
1 files changed, 21 insertions, 21 deletions
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);