diff options
author | Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> | 2019-01-28 12:29:07 +0000 |
---|---|---|
committer | Simon Horman <simon.horman@netronome.com> | 2019-01-31 10:53:10 +0100 |
commit | f8b63e59301fda6211e8ab69bd2e32c3f98325c9 (patch) | |
tree | e980c9969b3c169ff8f1d6aef9462ad18e53060d /include/sparse/automake.mk | |
parent | 68c00e3eed72a58e4b9e29a0fd1cafbcf6fff3a8 (diff) | |
download | openvswitch-f8b63e59301fda6211e8ab69bd2e32c3f98325c9.tar.gz |
lib/tc: make pedit mask calculations byte order agnostic
pedit allows setting entire words with an optional mask and OVS
makes use of such masks to allow setting fields that do not span
entire words.
The struct tc_pedit_key structure, which is part of the kernel
ABI, uses host byte order fields to store the mask and value for
a pedit action, however, these fields contain values in network
byte order.
In order to allow static analysis tools to check for endianness
problems this patch adds a local version of struct tc_pedit_key
which uses big endian types and refactors the relevant code as
appropriate.
In the course of making this change it became apparent that the
calculation of masks was occurring using host byte order although
the values are in network byte order. This patch also fixes that
problem by shifting values in host byte order and then converting
them to network byte order. It is believe this fixes a bug on big
endian systems although we are not in a position to test that.
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Diffstat (limited to 'include/sparse/automake.mk')
-rw-r--r-- | include/sparse/automake.mk | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index 985ee6a2f..4c7b17783 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -26,4 +26,5 @@ noinst_HEADERS += \ include/sparse/sys/sysmacros.h \ include/sparse/sys/types.h \ include/sparse/sys/wait.h \ - include/sparse/threads.h + include/sparse/threads.h \ + include/sparse/linux/tc_act/tc_pedit.h |