Spotted by Arnaldo.
Signed-off-by: David S. Miller <davem@davemloft.net>
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);
static inline size_t dn_fib_nlmsg_size(struct dn_fib_info *fi)
{
- size_t payload = NLMSG_ALIGN(struct rtmsg)
+ size_t payload = NLMSG_ALIGN(sizeof(struct rtmsg))
+ nla_total_size(4) /* RTA_TABLE */
+ nla_total_size(2) /* RTA_DST */
+ nla_total_size(4); /* RTA_PRIORITY */
u32 pid = req ? req->pid : 0;
int err = -ENOBUFS;
- skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f), GFP_KERNEL));
+ skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL);
if (skb == NULL)
goto errout;