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)
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

index e237ecb..dd46117 100644 (file)
@@ -501,7 +501,7 @@ enum nft_immediate_attributes {
  *
  *             mask    xor
  * NOT:                1       1
- * OR:               x
+ * OR:         ~x      x
  * XOR:                1       x
  * AND:                x       0
  */