diff options
author | Jamal Hadi Salim <hadi@cyberus.ca> | 2005-06-19 01:54:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-19 01:54:12 -0400 |
commit | b6544c0b4cf2bd96195f3cdb7cebfb35090fc557 (patch) | |
tree | 717f69a0c204b12eeedb8035fb66c8e9bb2d5a09 /net/decnet/dn_dev.c | |
parent | 1797754ea7ee5e0d859b0a32506ff999f8d5fb71 (diff) |
[NETLINK]: Correctly set NLM_F_MULTI without checking the pid
This patch rectifies some rtnetlink message builders that derive the
flags from the pid. It is now explicit like the other cases
which get it right. Also fixes half a dozen dumpers which did not
set NLM_F_MULTI at all.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r-- | net/decnet/dn_dev.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index ee7bf46eb78a..00233ecbc9cb 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -716,13 +716,13 @@ static int dn_dev_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *a | |||
716 | } | 716 | } |
717 | 717 | ||
718 | static int dn_dev_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, | 718 | static int dn_dev_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, |
719 | u32 pid, u32 seq, int event) | 719 | u32 pid, u32 seq, int event, unsigned int flags) |
720 | { | 720 | { |
721 | struct ifaddrmsg *ifm; | 721 | struct ifaddrmsg *ifm; |
722 | struct nlmsghdr *nlh; | 722 | struct nlmsghdr *nlh; |
723 | unsigned char *b = skb->tail; | 723 | unsigned char *b = skb->tail; |
724 | 724 | ||
725 | nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); | 725 | nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*ifm), flags); |
726 | ifm = NLMSG_DATA(nlh); | 726 | ifm = NLMSG_DATA(nlh); |
727 | 727 | ||
728 | ifm->ifa_family = AF_DECnet; | 728 | ifm->ifa_family = AF_DECnet; |
@@ -755,7 +755,7 @@ static void rtmsg_ifa(int event, struct dn_ifaddr *ifa) | |||
755 | netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, ENOBUFS); | 755 | netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, ENOBUFS); |
756 | return; | 756 | return; |
757 | } | 757 | } |
758 | if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event) < 0) { | 758 | if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) { |
759 | kfree_skb(skb); | 759 | kfree_skb(skb); |
760 | netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, EINVAL); | 760 | netlink_set_err(rtnl, 0, RTMGRP_DECnet_IFADDR, EINVAL); |
761 | return; | 761 | return; |
@@ -790,7 +790,8 @@ static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | |||
790 | if (dn_dev_fill_ifaddr(skb, ifa, | 790 | if (dn_dev_fill_ifaddr(skb, ifa, |
791 | NETLINK_CB(cb->skb).pid, | 791 | NETLINK_CB(cb->skb).pid, |
792 | cb->nlh->nlmsg_seq, | 792 | cb->nlh->nlmsg_seq, |
793 | RTM_NEWADDR) <= 0) | 793 | RTM_NEWADDR, |
794 | NLM_F_MULTI) <= 0) | ||
794 | goto done; | 795 | goto done; |
795 | } | 796 | } |
796 | } | 797 | } |