mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
netlink: fix netlink_diag_dump() return value
__netlink_diag_dump() returns 1 if the dump is not complete, zero if no error occurred. If err variable is zero, this means the dump is complete: We should not return skb->len in this case, but 0. This allows NLMSG_DONE to be appended to the skb. User space does not have to call us again only to get NLMSG_DONE. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ac14ad9755
commit
6647b338fc
1 changed files with 1 additions and 1 deletions
|
@ -207,7 +207,7 @@ static int netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
err = __netlink_diag_dump(skb, cb, req->sdiag_protocol, s_num);
|
||||
}
|
||||
|
||||
return err < 0 ? err : skb->len;
|
||||
return err <= 0 ? err : skb->len;
|
||||
}
|
||||
|
||||
static int netlink_diag_dump_done(struct netlink_callback *cb)
|
||||
|
|
Loading…
Add table
Reference in a new issue