On Thu, Nov 14, 2019 at 03:21:22PM +0100, Phil Sutter wrote: > This fixes get element command for interval sets with host byte order > data type, like e.g. mark. During serializing of the range (or element) > to query, data was exported in wrong byteorder and consequently not > found in kernel. > > The mystery part is that code seemed correct: When calling > constant_expr_alloc() from set_elem_add(), the set key's byteorder was > passed with correct value of BYTEORDER_HOST_ENDIAN. > > Comparison with delete/add element code paths though turned out that in > those use-cases, constant_expr_alloc() is called with BYTEORDER_INVALID: > > - seg_tree_init() takes byteorder field value of first element in > init->expressions (i.e., the elements requested on command line) and > assigns that to tree->byteorder > - tree->byteorder is passed to constant_expr_alloc() in > set_insert_interval() > - the elements' byteorder happens to be the default value > > This patch may not fix the right side, but at least it aligns get with > add/delete element codes. > > Fixes: a43cc8d53096d ("src: support for get element command") > Signed-off-by: Phil Sutter <phil@xxxxxx> Acked-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>