Johannes Berg 670dc2833d netlink: advertise incomplete dumps
Consider the following situation:
 * a dump that would show 8 entries, four in the first
   round, and four in the second
 * between the first and second rounds, 6 entries are
   removed
 * now the second round will not show any entry, and
   even if there is a sequence/generation counter the
   application will not know

To solve this problem, add a new flag NLM_F_DUMP_INTR
to the netlink header that indicates the dump wasn't
consistent, this flag can also be set on the MSG_DONE
message that terminates the dump, and as such above
situation can be detected.

To achieve this, add a sequence counter to the netlink
callback struct. Of course, netlink code still needs
to use this new functionality. The correct way to do
that is to always set cb->seq when a dumpit callback
is invoked and call nl_dump_check_consistent() for
each new message. The core code will also call this
function for the final MSG_DONE message.

To make it usable with generic netlink, a new function
genlmsg_nlhdr() is needed to obtain the netlink header
from the genetlink user header.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-22 16:09:45 -04:00
..
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-06-01 15:12:28 -04:00
2011-05-05 11:10:14 -07:00
2010-12-31 10:47:46 -08:00
2010-06-03 03:21:52 -07:00
2011-05-24 13:50:52 -04:00
2010-10-27 11:37:32 -07:00
2011-03-31 11:26:23 -03:00
2010-10-25 13:09:45 -07:00
2010-10-27 11:37:32 -07:00
2011-05-19 16:21:22 -04:00
2011-03-31 11:26:23 -03:00
2009-12-26 20:46:28 -08:00
2010-06-03 03:21:52 -07:00
2011-06-22 16:09:45 -04:00
2011-05-17 14:16:58 -04:00
2011-03-31 11:26:23 -03:00
2011-01-24 15:32:47 -08:00
2010-11-24 11:16:43 -08:00
2011-05-19 16:21:22 -04:00
2011-03-01 12:35:03 -08:00
2011-03-01 12:35:03 -08:00
2011-03-31 11:26:23 -03:00
2010-11-28 11:12:20 -08:00