datatype: leave DTYPE_F_PREFIX only for IP address datatype
Pablo Neira Ayuso
maintainerPATCH 1/1 datatype: leave DTYPE_F_PREFIX only for IP address datatype
DTYPE_F_PREFIX flag provides a hint to the netlink delinearize path to use prefix notation.
It seems use of prefix notation in meta mark causes confusion, users expect to see prefix in the listing only in IP address datatypes.
Untoggle this flag so (more lengthy) binop output such as:
meta mark & 0xffffff00 == 0xffffff00
is used instead.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/datatype.c | 1 - src/meta.c | 1 - src/rt.c | 1 - tests/py/any/meta.t | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-)
src/datatype.c +0 -1
@@ -1015,7 +1015,6 @@ const struct datatype mark_type = { .print = mark_type_print, .json = mark_type_json, .parse = mark_type_parse, - .flags = DTYPE_F_PREFIX, };static const struct symbol_table icmp_code_tbl = {
src/meta.c +0 -1
@@ -363,7 +363,6 @@ const struct datatype devgroup_type = { .print = devgroup_type_print, .json = devgroup_type_json, .parse = devgroup_type_parse, - .flags = DTYPE_F_PREFIX, };const struct datatype ifname_type = {
src/rt.c +0 -1
@@ -61,7 +61,6 @@ const struct datatype realm_type = { .basetype = &integer_type, .print = realm_type_print, .parse = realm_type_parse, - .flags = DTYPE_F_PREFIX, };const struct rt_template rt_templates[] = {
tests/py/any/meta.t +1 -1
@@ -56,7 +56,7 @@ meta mark and 0x03 == 0x01;ok;meta mark & 0x00000003 == 0x00000001 meta mark and 0x03 != 0x01;ok;meta mark & 0x00000003 != 0x00000001 meta mark 0x10;ok;meta mark 0x00000010 meta mark != 0x10;ok;meta mark != 0x00000010 -meta mark 0xffffff00/24;ok +meta mark 0xffffff00/24;ok;meta mark & 0xffffff00 == 0xffffff00 meta mark or 0x03 == 0x01;ok;meta mark | 0x00000003 == 0x00000001 meta mark or 0x03 != 0x01;ok;meta mark | 0x00000003 != 0x00000001
Signature · 1 line
2.30.2