diff options
author | Phil Sutter <phil@nwl.cc> | 2019-11-14 14:41:50 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2019-11-15 10:50:58 +0100 |
commit | 4a8831b52b1c83322e288078120d834b78ff489a (patch) | |
tree | 2a10d927e3e86664a46216b3467b080ba0dabcfa /src/print.c | |
parent | decc12ec2dc319a9bb1fb5f629258c6c3a087db1 (diff) |
segtree: Fix get element for little endian ranges
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@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/print.c')
0 files changed, 0 insertions, 0 deletions