aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:31:41 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:50 -0400
commit97676b6b5538b3e059d33b8338e7d5cc41c5f1f1 (patch)
tree76e41eb58bd86a96e204dacbb6746da387e67452 /net/core/rtnetlink.c
parentd387f6ad10764fc2174373b4a1cca443adee36e3 (diff)
[RTNETLINK]: Add rtnetlink notification interface
Adds rtnl_notify() to send rtnetlink notification messages and rtnl_set_sk_err() to report notification errors as socket errors in order to indicate the need of a resync due to loss of events. nlmsg_report() is added to properly document the meaning of NLM_F_ECHO. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e02fa6a33f42..2b1af17e6389 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -171,6 +171,22 @@ int rtnl_unicast(struct sk_buff *skb, u32 pid)
171 return nlmsg_unicast(rtnl, skb, pid); 171 return nlmsg_unicast(rtnl, skb, pid);
172} 172}
173 173
174int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
175 struct nlmsghdr *nlh, gfp_t flags)
176{
177 int report = 0;
178
179 if (nlh)
180 report = nlmsg_report(nlh);
181
182 return nlmsg_notify(rtnl, skb, pid, group, report, flags);
183}
184
185void rtnl_set_sk_err(u32 group, int error)
186{
187 netlink_set_err(rtnl, 0, group, error);
188}
189
174int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics) 190int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
175{ 191{
176 struct rtattr *mx = (struct rtattr*)skb->tail; 192 struct rtattr *mx = (struct rtattr*)skb->tail;
@@ -829,3 +845,5 @@ EXPORT_SYMBOL(rtnl_lock);
829EXPORT_SYMBOL(rtnl_trylock); 845EXPORT_SYMBOL(rtnl_trylock);
830EXPORT_SYMBOL(rtnl_unlock); 846EXPORT_SYMBOL(rtnl_unlock);
831EXPORT_SYMBOL(rtnl_unicast); 847EXPORT_SYMBOL(rtnl_unicast);
848EXPORT_SYMBOL(rtnl_notify);
849EXPORT_SYMBOL(rtnl_set_sk_err);