Re: [iproute PATCH v3 1/2] libnetlink: add a variant of rtnl_send_check that consumes ACKs

Stephen Hemminger
2015-12-23T21:17:48Z

On Tue, 22 Dec 2015 17:31:33 +0900
Lorenzo Colitti <lorenzo@google.com> wrote:

> The new variant is identical to rtnl_send_check, except it also
> consumes the kernel response instead of using MSG_PEEK. This is
> useful for callers that send simple commands that never cause a
> response but only ACKs, and that expect to receive and deal
> with errors without printing them to stderr like rtnl_talk does.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>

Originally, iproute2 used netlink so that every request had an ACK and
this is the API in rtnl_talk. Then as an optimization it was observed
that ACK from kernel is not necessary (all error reports are handled in
send), but that for some asynchronous errors a check was necessary.

Therefore, I wonder why you need this, either:
* don't ask kernel for ACK's (like most other ip commands),
* or use rtnl_talk() and expect ACK.