OSDN Git Service

netfilter: nft_bitwise: correct uapi header comment.
authorJeremy Sowden <jeremy@azazel.net>
Wed, 1 Jan 2020 13:41:32 +0000 (13:41 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 16 Jan 2020 14:51:14 +0000 (15:51 +0100)
commit4a7faaf4add3108522512c16c9ee08fb2ad4525e
tree665470f16d1aed6807b3ddb5fefa2449ca387259
parent6bc8038035267d12df2bf78a8e1a5f07069fabb8
netfilter: nft_bitwise: correct uapi header comment.

The comment documenting how bitwise expressions work includes a table
which summarizes the mask and xor arguments combined to express the
supported boolean operations.  However, the row for OR:

 mask    xor
 0       x

is incorrect.

  dreg = (sreg & 0) ^ x

is not equivalent to:

  dreg = sreg | x

What the code actually does is:

  dreg = (sreg & ~x) ^ x

Update the documentation to match.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h