diff options
author | Phil Sutter <phil@nwl.cc> | 2019-05-31 16:17:43 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-31 18:09:39 +0200 |
commit | 6d0c815e281c4edc539c535491d6425cf0f8edeb (patch) | |
tree | c641cd3ad080e3f5e423df4bb6ecb47b3099fe09 /include/linux/netfilter/nfnetlink.h | |
parent | 59d301ec80264a907918028c590f7f172003a995 (diff) |
mnl: Simplify mnl_batch_talk()
By mimicking mnl_nft_event_listener() code, mnl_batch_talk() may be
simplified quite a bit:
* Turn the conditional loop into an unconditional one.
* Call select() at loop start, which merges the two call sites.
* Check readfds content after select() returned instead of in loop
condition - if fd is not set, break to return error state stored in
'err' variable.
* Old code checked that select() return code is > 0, but that was
redundant: if FD_ISSET() returns true, select return code was 1.
* Move 'nlh' helper variable definition into error handling block, it is
not used outside of it.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux/netfilter/nfnetlink.h')
0 files changed, 0 insertions, 0 deletions