int min_len;
int family;
int type;
- int err;
type = nlh->nlmsg_type;
if (type > RTM_MAX)
if (dumpit == NULL)
return -EINVAL;
- err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
}
memset(rta_buf, 0, (rtattr_max * sizeof(struct rtattr *)));
return -ENOENT;
if (nlh->nlmsg_flags & NLM_F_DUMP) {
- int err;
-
if (nlmsg_attrlen(nlh, hdrlen)) {
struct nlattr *attr;
return -EINVAL;
}
- err = netlink_dump_start(idiagnl, skb, nlh,
- inet_diag_dump, NULL);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(idiagnl, skb, nlh,
+ inet_diag_dump, NULL);
}
return inet_diag_get_exact(skb, nlh);
if (NFNL_MSG_TYPE(nlh->nlmsg_type) == IPCTNL_MSG_CT_GET_CTRZERO)
return -ENOTSUPP;
#endif
- err = netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,
- ctnetlink_done);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,
+ ctnetlink_done);
}
if (nfattr_bad_size(cda, CTA_MAX, cta_min))
return -EINVAL;
if (nlh->nlmsg_flags & NLM_F_DUMP) {
- err = netlink_dump_start(ctnl, skb, nlh,
- ctnetlink_exp_dump_table,
- ctnetlink_done);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(ctnl, skb, nlh,
+ ctnetlink_exp_dump_table,
+ ctnetlink_done);
}
if (cda[CTA_EXPECT_MASTER-1])
netlink_dump(sk);
sock_put(sk);
- return 0;
+
+ /* We successfully started a dump, by returning -EINTR we
+ * signal the queue mangement to interrupt processing of
+ * any netlink messages so userspace gets a chance to read
+ * the results. */
+ return -EINTR;
}
void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
if (ops->dumpit == NULL)
return -EOPNOTSUPP;
- err = netlink_dump_start(genl_sock, skb, nlh,
- ops->dumpit, ops->done);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(genl_sock, skb, nlh,
+ ops->dumpit, ops->done);
}
if (ops->doit == NULL)
{
struct rtattr *xfrma[XFRMA_MAX];
struct xfrm_link *link;
- int type, min_len, err;
+ int type, min_len;
type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX)
if (link->dump == NULL)
return -EINVAL;
- err = netlink_dump_start(xfrm_nl, skb, nlh, link->dump, NULL);
- if (err == 0)
- err = -EINTR;
- return err;
+ return netlink_dump_start(xfrm_nl, skb, nlh, link->dump, NULL);
}
memset(xfrma, 0, sizeof(xfrma));