summaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_rules.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-11-10 14:10:15 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:22:11 -0800
commit339bf98ffc6a8d8eb16fc532ac57ffbced2f8a68 (patch)
tree499ad948863d2753ca10283dcf006ad28954538e /net/decnet/dn_rules.c
parenta94f723d595ee085f81b1788d18e031af7eeba91 (diff)
downloadop-kernel-dev-339bf98ffc6a8d8eb16fc532ac57ffbced2f8a68.zip
op-kernel-dev-339bf98ffc6a8d8eb16fc532ac57ffbced2f8a68.tar.gz
[NETLINK]: Do precise netlink message allocations where possible
Account for the netlink message header size directly in nlmsg_new() instead of relying on the caller calculate it correctly. Replaces error handling of message construction functions when constructing notifications with bug traps since a failure implies a bug in calculating the size of the skb. Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_rules.c')
-rw-r--r--net/decnet/dn_rules.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index e32d0c3..b7dfd04 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -241,6 +241,12 @@ static u32 dn_fib_rule_default_pref(void)
return 0;
}
+static size_t dn_fib_rule_nlmsg_payload(struct fib_rule *rule)
+{
+ return nla_total_size(2) /* dst */
+ + nla_total_size(2); /* src */
+}
+
int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
{
return fib_rules_dump(skb, cb, AF_DECnet);
OpenPOWER on IntegriCloud