mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +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
@ -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…
Reference in New Issue
Block a user