[PATCH nft] fix integer type size to be used as a key for sets and maps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Includes the size of the type integer in order to be used
as a key in a map or set.

Without this patch we obtain the following error:

Error: unqualified key type integer specified in map definition
add map nftlb mapa { type integer : ipv4_addr; timeout 5s; }
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

After this patch, we can use an integer as a key for sets
and maps:

table ip nftlb {
	map mapa {
		type integer : ipv4_addr
	}

	set conjunto {
		type integer
	}
}

Signed-off-by: Laura Garcia Liebana <nevola@xxxxxxxxx>
---
 src/datatype.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/datatype.c b/src/datatype.c
index 324ac80..06015bb 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -356,6 +356,7 @@ const struct datatype integer_type = {
 	.type		= TYPE_INTEGER,
 	.name		= "integer",
 	.desc		= "integer",
+	.size		= 4 * BITS_PER_BYTE,
 	.print		= integer_type_print,
 	.parse		= integer_type_parse,
 };
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux