]> git.ipfire.org Git - thirdparty/nftables.git/commit
expression: fix constant expression allocation on big endian
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Sat, 12 Apr 2014 08:40:08 +0000 (10:40 +0200)
committerPatrick McHardy <kaber@trash.net>
Sat, 12 Apr 2014 08:40:08 +0000 (10:40 +0200)
commit5259feeb7cda089523a2196248baa5395bce4b50
tree852618a136d08c5ea37f1183aee5861d37af221e
parent062cea3bbeabd616acc8c44eab6fd1165320cfd1
expression: fix constant expression allocation on big endian

When allocating a constant expression, a pointer to the data is passed
to the allocation function. When the variable used to store the data
is larger than the size of the data type, this fails on big endian since
the most significant bytes (being zero) come first.

Add a helper function to calculate the proper address for the cases
where this is needed.

This currently affects symbolic tables for values < u64 and payload
dependency generation for protocol values < u32.

Signed-off-by: Patrick McHardy <kaber@trash.net>
include/utils.h
src/datatype.c
src/payload.c