From 265dbe5dbc14c199299496c6db8fce3f76647015 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 21 Sep 2018 18:00:10 +0100 Subject: gentoo resync : 21.09.2018 --- .../files/libnftnl-1.1.1-big-endian-3.patch | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 net-libs/libnftnl/files/libnftnl-1.1.1-big-endian-3.patch (limited to 'net-libs/libnftnl/files/libnftnl-1.1.1-big-endian-3.patch') diff --git a/net-libs/libnftnl/files/libnftnl-1.1.1-big-endian-3.patch b/net-libs/libnftnl/files/libnftnl-1.1.1-big-endian-3.patch new file mode 100644 index 000000000000..d726ccfdc2d9 --- /dev/null +++ b/net-libs/libnftnl/files/libnftnl-1.1.1-big-endian-3.patch @@ -0,0 +1,33 @@ +From 043060b18d27f24fe723e39bc2c9e5f50dde60dd Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Fri, 22 Jun 2018 14:18:59 +0200 +Subject: expr/exthdr: Fix JSON parsing on big endian + +When setting NFTNL_EXPR_EXTHDR_TYPE, one needs to call +nftnl_expr_set_u8() and not nftnl_expr_set_u32(). Otherwise 'type' +variable is assigned to uint32_t parameter before being passed to +nftnl_expr_exthdr_set() as void pointer which casts it to uint8_t. +On big endian systems, the latter would only consider the most +significant byte instead of the least significant one. + +Signed-off-by: Phil Sutter +--- + src/expr/exthdr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c +index 75cafbc..a351835 100644 +--- a/src/expr/exthdr.c ++++ b/src/expr/exthdr.c +@@ -270,7 +270,7 @@ nftnl_expr_exthdr_json_parse(struct nftnl_expr *e, json_t *root, + type = str2exthdr_type(exthdr_type); + if (type < 0) + return -1; +- nftnl_expr_set_u32(e, NFTNL_EXPR_EXTHDR_TYPE, type); ++ nftnl_expr_set_u8(e, NFTNL_EXPR_EXTHDR_TYPE, type); + } + + if (nftnl_jansson_parse_val(root, "offset", NFTNL_TYPE_U32, &uval32, +-- +cgit v1.2.1 + -- cgit v1.2.3