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/core/neighbour.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/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 0fb742e228cc..f6bdcad47da6 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1859,18 +1859,17 @@ out: | |||
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n, | 1861 | static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n, |
1862 | u32 pid, u32 seq, int event) | 1862 | u32 pid, u32 seq, int event, unsigned int flags) |
1863 | { | 1863 | { |
1864 | unsigned long now = jiffies; | 1864 | unsigned long now = jiffies; |
1865 | unsigned char *b = skb->tail; | 1865 | unsigned char *b = skb->tail; |
1866 | struct nda_cacheinfo ci; | 1866 | struct nda_cacheinfo ci; |
1867 | int locked = 0; | 1867 | int locked = 0; |
1868 | u32 probes; | 1868 | u32 probes; |
1869 | struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq, event, | 1869 | struct nlmsghdr *nlh = NLMSG_NEW(skb, pid, seq, event, |
1870 | sizeof(struct ndmsg)); | 1870 | sizeof(struct ndmsg), flags); |
1871 | struct ndmsg *ndm = NLMSG_DATA(nlh); | 1871 | struct ndmsg *ndm = NLMSG_DATA(nlh); |
1872 | 1872 | ||
1873 | nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0; | ||
1874 | ndm->ndm_family = n->ops->family; | 1873 | ndm->ndm_family = n->ops->family; |
1875 | ndm->ndm_flags = n->flags; | 1874 | ndm->ndm_flags = n->flags; |
1876 | ndm->ndm_type = n->type; | 1875 | ndm->ndm_type = n->type; |
@@ -1920,7 +1919,8 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb, | |||
1920 | continue; | 1919 | continue; |
1921 | if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid, | 1920 | if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid, |
1922 | cb->nlh->nlmsg_seq, | 1921 | cb->nlh->nlmsg_seq, |
1923 | RTM_NEWNEIGH) <= 0) { | 1922 | RTM_NEWNEIGH, |
1923 | NLM_F_MULTI) <= 0) { | ||
1924 | read_unlock_bh(&tbl->lock); | 1924 | read_unlock_bh(&tbl->lock); |
1925 | rc = -1; | 1925 | rc = -1; |
1926 | goto out; | 1926 | goto out; |
@@ -2329,7 +2329,7 @@ void neigh_app_ns(struct neighbour *n) | |||
2329 | if (!skb) | 2329 | if (!skb) |
2330 | return; | 2330 | return; |
2331 | 2331 | ||
2332 | if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH) < 0) { | 2332 | if (neigh_fill_info(skb, n, 0, 0, RTM_GETNEIGH, 0) < 0) { |
2333 | kfree_skb(skb); | 2333 | kfree_skb(skb); |
2334 | return; | 2334 | return; |
2335 | } | 2335 | } |
@@ -2348,7 +2348,7 @@ static void neigh_app_notify(struct neighbour *n) | |||
2348 | if (!skb) | 2348 | if (!skb) |
2349 | return; | 2349 | return; |
2350 | 2350 | ||
2351 | if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH) < 0) { | 2351 | if (neigh_fill_info(skb, n, 0, 0, RTM_NEWNEIGH, 0) < 0) { |
2352 | kfree_skb(skb); | 2352 | kfree_skb(skb); |
2353 | return; | 2353 | return; |
2354 | } | 2354 | } |