aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:30:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:48 -0400
commit2942e90050569525628a9f34e0daaa9b661b49cc (patch)
treefc6acc11514e64ff9efc31bdc1bb458232206642
parentf8d8fda54a1bfcf8cf829e44c494b2b4582819aa (diff)
[RTNETLINK]: Use rtnl_unicast() for rtnetlink unicasts
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--net/core/rtnetlink.c10
-rw-r--r--net/decnet/dn_route.c4
-rw-r--r--net/ipv4/ipmr.c7
-rw-r--r--net/ipv4/route.c7
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/route.c4
-rw-r--r--net/sched/act_api.c7
8 files changed, 20 insertions, 24 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 7e4aa48680a7..0e4f478e2cb5 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -584,6 +584,7 @@ struct rtnetlink_link
584 584
585extern struct rtnetlink_link * rtnetlink_links[NPROTO]; 585extern struct rtnetlink_link * rtnetlink_links[NPROTO];
586extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); 586extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
587extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
587extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 588extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
588 589
589extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); 590extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a1b783a6afc6..e02fa6a33f42 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -166,6 +166,11 @@ int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
166 return err; 166 return err;
167} 167}
168 168
169int rtnl_unicast(struct sk_buff *skb, u32 pid)
170{
171 return nlmsg_unicast(rtnl, skb, pid);
172}
173
169int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics) 174int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
170{ 175{
171 struct rtattr *mx = (struct rtattr*)skb->tail; 176 struct rtattr *mx = (struct rtattr*)skb->tail;
@@ -574,9 +579,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
574 goto errout; 579 goto errout;
575 } 580 }
576 581
577 err = netlink_unicast(rtnl, skb, NETLINK_CB(skb).pid, MSG_DONTWAIT); 582 err = rtnl_unicast(skb, NETLINK_CB(skb).pid);
578 if (err > 0)
579 err = 0;
580errout: 583errout:
581 kfree(iw_buf); 584 kfree(iw_buf);
582 dev_put(dev); 585 dev_put(dev);
@@ -825,3 +828,4 @@ EXPORT_SYMBOL(rtnl);
825EXPORT_SYMBOL(rtnl_lock); 828EXPORT_SYMBOL(rtnl_lock);
826EXPORT_SYMBOL(rtnl_trylock); 829EXPORT_SYMBOL(rtnl_trylock);
827EXPORT_SYMBOL(rtnl_unlock); 830EXPORT_SYMBOL(rtnl_unlock);
831EXPORT_SYMBOL(rtnl_unicast);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 4c963213fba5..c5daf3557c1f 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1611,9 +1611,7 @@ int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
1611 goto out_free; 1611 goto out_free;
1612 } 1612 }
1613 1613
1614 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 1614 return rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
1615
1616 return err;
1617 1615
1618out_free: 1616out_free:
1619 kfree_skb(skb); 1617 kfree_skb(skb);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 85893eef6b16..98f0aa0d4216 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -312,7 +312,8 @@ static void ipmr_destroy_unres(struct mfc_cache *c)
312 e = NLMSG_DATA(nlh); 312 e = NLMSG_DATA(nlh);
313 e->error = -ETIMEDOUT; 313 e->error = -ETIMEDOUT;
314 memset(&e->msg, 0, sizeof(e->msg)); 314 memset(&e->msg, 0, sizeof(e->msg));
315 netlink_unicast(rtnl, skb, NETLINK_CB(skb).dst_pid, MSG_DONTWAIT); 315
316 rtnl_unicast(skb, NETLINK_CB(skb).pid);
316 } else 317 } else
317 kfree_skb(skb); 318 kfree_skb(skb);
318 } 319 }
@@ -512,7 +513,6 @@ static void ipmr_cache_resolve(struct mfc_cache *uc, struct mfc_cache *c)
512 513
513 while((skb=__skb_dequeue(&uc->mfc_un.unres.unresolved))) { 514 while((skb=__skb_dequeue(&uc->mfc_un.unres.unresolved))) {
514 if (skb->nh.iph->version == 0) { 515 if (skb->nh.iph->version == 0) {
515 int err;
516 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); 516 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr));
517 517
518 if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) { 518 if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) {
@@ -525,7 +525,8 @@ static void ipmr_cache_resolve(struct mfc_cache *uc, struct mfc_cache *c)
525 e->error = -EMSGSIZE; 525 e->error = -EMSGSIZE;
526 memset(&e->msg, 0, sizeof(e->msg)); 526 memset(&e->msg, 0, sizeof(e->msg));
527 } 527 }
528 err = netlink_unicast(rtnl, skb, NETLINK_CB(skb).dst_pid, MSG_DONTWAIT); 528
529 rtnl_unicast(skb, NETLINK_CB(skb).pid);
529 } else 530 } else
530 ip_mr_forward(skb, c, 0); 531 ip_mr_forward(skb, c, 0);
531 } 532 }
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 12128b82c9dc..b8f6cadc5b3a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2809,10 +2809,9 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2809 goto out_free; 2809 goto out_free;
2810 } 2810 }
2811 2811
2812 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 2812 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
2813 if (err > 0) 2813out:
2814 err = 0; 2814 return err;
2815out: return err;
2816 2815
2817out_free: 2816out_free:
2818 kfree_skb(skb); 2817 kfree_skb(skb);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9ba1e811ba50..4f991a2234d0 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3268,9 +3268,7 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb,
3268 goto out_free; 3268 goto out_free;
3269 } 3269 }
3270 3270
3271 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 3271 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
3272 if (err > 0)
3273 err = 0;
3274out: 3272out:
3275 in6_ifa_put(ifa); 3273 in6_ifa_put(ifa);
3276 return err; 3274 return err;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9ce28277f47f..024c8e26c2ec 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2044,9 +2044,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2044 goto out_free; 2044 goto out_free;
2045 } 2045 }
2046 2046
2047 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 2047 err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
2048 if (err > 0)
2049 err = 0;
2050out: 2048out:
2051 return err; 2049 return err;
2052out_free: 2050out_free:
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index a2587b52e531..6990747d6d5a 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -459,7 +459,6 @@ static int
459act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event) 459act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event)
460{ 460{
461 struct sk_buff *skb; 461 struct sk_buff *skb;
462 int err = 0;
463 462
464 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 463 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
465 if (!skb) 464 if (!skb)
@@ -468,10 +467,8 @@ act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event)
468 kfree_skb(skb); 467 kfree_skb(skb);
469 return -EINVAL; 468 return -EINVAL;
470 } 469 }
471 err = netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT); 470
472 if (err > 0) 471 return rtnl_unicast(skb, pid);
473 err = 0;
474 return err;
475} 472}
476 473
477static struct tc_action * 474static struct tc_action *