netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH 01/16] [RTNETLINK]: Use rtnl_unicast() for rtnetlink unicasts
Date: Mon, 14 Aug 2006 00:00:01 +0200	[thread overview]
Message-ID: <20060814214339.134019023@postel.suug.ch> (raw)
In-Reply-To: 20060814213718.580598840@postel.suug.ch

[-- Attachment #1: rtnl_unicast --]
[-- Type: text/plain, Size: 5220 bytes --]

Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6.19.git/include/linux/rtnetlink.h
===================================================================
--- net-2.6.19.git.orig/include/linux/rtnetlink.h
+++ net-2.6.19.git/include/linux/rtnetlink.h
@@ -584,6 +584,7 @@ struct rtnetlink_link
 
 extern struct rtnetlink_link * rtnetlink_links[NPROTO];
 extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
+extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
 extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
 
 extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
Index: net-2.6.19.git/net/core/rtnetlink.c
===================================================================
--- net-2.6.19.git.orig/net/core/rtnetlink.c
+++ net-2.6.19.git/net/core/rtnetlink.c
@@ -166,6 +166,11 @@ int rtnetlink_send(struct sk_buff *skb, 
 	return err;
 }
 
+int rtnl_unicast(struct sk_buff *skb, u32 pid)
+{
+	return nlmsg_unicast(rtnl, skb, pid);
+}
+
 int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
 {
 	struct rtattr *mx = (struct rtattr*)skb->tail;
@@ -574,9 +579,7 @@ static int rtnl_getlink(struct sk_buff *
 		goto errout;
 	}
 
-	err = netlink_unicast(rtnl, skb, NETLINK_CB(skb).pid, MSG_DONTWAIT);
-	if (err > 0)
-		err = 0;
+	err = rtnl_unicast(skb, NETLINK_CB(skb).pid);
 errout:
 	kfree(iw_buf);
 	dev_put(dev);
@@ -825,3 +828,4 @@ EXPORT_SYMBOL(rtnl);
 EXPORT_SYMBOL(rtnl_lock);
 EXPORT_SYMBOL(rtnl_trylock);
 EXPORT_SYMBOL(rtnl_unlock);
+EXPORT_SYMBOL(rtnl_unicast);
Index: net-2.6.19.git/net/decnet/dn_route.c
===================================================================
--- net-2.6.19.git.orig/net/decnet/dn_route.c
+++ net-2.6.19.git/net/decnet/dn_route.c
@@ -1611,9 +1611,7 @@ int dn_cache_getroute(struct sk_buff *in
 		goto out_free;
 	}
 
-	err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
-
-	return err;
+	return rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
 
 out_free:
 	kfree_skb(skb);
Index: net-2.6.19.git/net/ipv4/ipmr.c
===================================================================
--- net-2.6.19.git.orig/net/ipv4/ipmr.c
+++ net-2.6.19.git/net/ipv4/ipmr.c
@@ -312,7 +312,8 @@ static void ipmr_destroy_unres(struct mf
 			e = NLMSG_DATA(nlh);
 			e->error = -ETIMEDOUT;
 			memset(&e->msg, 0, sizeof(e->msg));
-			netlink_unicast(rtnl, skb, NETLINK_CB(skb).dst_pid, MSG_DONTWAIT);
+
+			rtnl_unicast(skb, NETLINK_CB(skb).pid);
 		} else
 			kfree_skb(skb);
 	}
@@ -512,7 +513,6 @@ static void ipmr_cache_resolve(struct mf
 
 	while((skb=__skb_dequeue(&uc->mfc_un.unres.unresolved))) {
 		if (skb->nh.iph->version == 0) {
-			int err;
 			struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr));
 
 			if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) {
@@ -525,7 +525,8 @@ static void ipmr_cache_resolve(struct mf
 				e->error = -EMSGSIZE;
 				memset(&e->msg, 0, sizeof(e->msg));
 			}
-			err = netlink_unicast(rtnl, skb, NETLINK_CB(skb).dst_pid, MSG_DONTWAIT);
+
+			rtnl_unicast(skb, NETLINK_CB(skb).pid);
 		} else
 			ip_mr_forward(skb, c, 0);
 	}
Index: net-2.6.19.git/net/ipv4/route.c
===================================================================
--- net-2.6.19.git.orig/net/ipv4/route.c
+++ net-2.6.19.git/net/ipv4/route.c
@@ -2809,10 +2809,9 @@ int inet_rtm_getroute(struct sk_buff *in
 		goto out_free;
 	}
 
-	err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
-	if (err > 0)
-		err = 0;
-out:	return err;
+	err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
+out:
+	return err;
 
 out_free:
 	kfree_skb(skb);
Index: net-2.6.19.git/net/ipv6/addrconf.c
===================================================================
--- net-2.6.19.git.orig/net/ipv6/addrconf.c
+++ net-2.6.19.git/net/ipv6/addrconf.c
@@ -3268,9 +3268,7 @@ static int inet6_rtm_getaddr(struct sk_b
 		goto out_free;
 	}
 
-	err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
-	if (err > 0)
-		err = 0;
+	err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
 out:
 	in6_ifa_put(ifa);
 	return err;
Index: net-2.6.19.git/net/ipv6/route.c
===================================================================
--- net-2.6.19.git.orig/net/ipv6/route.c
+++ net-2.6.19.git/net/ipv6/route.c
@@ -2040,9 +2040,7 @@ int inet6_rtm_getroute(struct sk_buff *i
 		goto out_free;
 	}
 
-	err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
-	if (err > 0)
-		err = 0;
+	err = rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
 out:
 	return err;
 out_free:
Index: net-2.6.19.git/net/sched/act_api.c
===================================================================
--- net-2.6.19.git.orig/net/sched/act_api.c
+++ net-2.6.19.git/net/sched/act_api.c
@@ -459,7 +459,6 @@ static int
 act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event)
 {
 	struct sk_buff *skb;
-	int err = 0;
 
 	skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!skb)
@@ -468,10 +467,8 @@ act_get_notify(u32 pid, struct nlmsghdr 
 		kfree_skb(skb);
 		return -EINVAL;
 	}
-	err = netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
-	if (err > 0)
-		err = 0;
-	return err;
+
+	return rtnl_unicast(skb, pid);
 }
 
 static struct tc_action *


  reply	other threads:[~2006-08-14 21:44 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 21:37 [PATCHSET] rtnetlink notification rework Thomas Graf
2006-08-13 22:00 ` Thomas Graf [this message]
2006-08-13 22:00 ` [PATCH 02/16] [NETLINK]: Add notification message sending interface Thomas Graf
2006-08-13 22:00 ` [PATCH 03/16] [RTNETLINK]: Add rtnetlink notification interface Thomas Graf
2006-08-13 22:00 ` [PATCH 04/16] [NET] fib_rules: Convert fib rule notification to use rtnl_notify() Thomas Graf
2006-08-13 22:00 ` [PATCH 05/16] [NEIGH]: Convert neighbour notifications ot " Thomas Graf
2006-08-13 22:00 ` [PATCH 06/16] [DECNET]: Convert DECnet notifications to " Thomas Graf
2006-08-13 22:00 ` [PATCH 07/16] [IPv4] address: Convert address notification " Thomas Graf
2006-08-13 22:00 ` [PATCH 08/16] [IPv4] route: Convert route notifications " Thomas Graf
2006-08-13 22:00 ` [PATCH 09/16] [IPv6] address: Convert address notification " Thomas Graf
2006-08-14 23:43   ` jamal
2006-08-14 23:51     ` jamal
2006-08-15  7:20       ` Hasso Tepper
2006-08-15  9:50         ` jamal
2006-08-15  0:07     ` Thomas Graf
2006-08-15  0:12       ` jamal
2006-08-15  0:36     ` Alexey Kuznetsov
2006-08-15  0:56       ` Herbert Xu
2006-08-15  2:46         ` jamal
2006-08-15  3:03           ` jamal
2006-08-15 11:17       ` Thomas Graf
2006-08-15 12:08         ` Hasso Tepper
2006-08-15 12:23           ` Thomas Graf
2006-08-16  2:58             ` Herbert Xu
2006-08-16  3:04               ` Herbert Xu
2006-08-16 10:58               ` Thomas Graf
2006-08-16 11:03                 ` jamal
2006-08-16 11:12                 ` Herbert Xu
2006-08-16 11:39                   ` Herbert Xu
2006-08-16 12:04                     ` jamal
2006-08-16 12:08                       ` Herbert Xu
2006-08-16 12:08                       ` Thomas Graf
2006-08-16 12:36                         ` jamal
2006-08-16 13:04                           ` Alexey Kuznetsov
2006-08-16 13:11                             ` jamal
2006-08-16 12:13                     ` Thomas Graf
2006-08-16 11:40                   ` Thomas Graf
2006-08-16 11:57                     ` Herbert Xu
2006-08-16 12:05                       ` Thomas Graf
2006-08-16 12:08                         ` jamal
2006-08-16 12:54               ` Alexey Kuznetsov
2006-08-13 22:00 ` [PATCH 10/16] [IPv6] route: Convert route notifications " Thomas Graf
2006-08-13 22:00 ` [PATCH 11/16] [IPv6] link: Convert link " Thomas Graf
2006-08-13 22:00 ` [PATCH 12/16] [IPv6] prefix: Convert prefix " Thomas Graf
2006-08-13 22:00 ` [PATCH 13/16] [BRIDGE]: Convert " Thomas Graf
2006-08-13 22:00 ` [PATCH 14/16] [WIRELESS]: " Thomas Graf
2006-08-13 22:00 ` [PATCH 15/16] [NET] link: " Thomas Graf
2006-08-13 22:00 ` [PATCH 16/16] [RTNETLINK]: Unexport rtnl socket Thomas Graf
2006-08-15  7:38 ` [PATCHSET] rtnetlink notification rework David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060814214339.134019023@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).