|
|
3730f4 |
From ca4d1604b18abf7189ecfd5e06cb74abc3694076 Mon Sep 17 00:00:00 2001
|
|
|
3730f4 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
3730f4 |
Date: Thu, 16 Jan 2020 18:40:52 +0100
|
|
|
3730f4 |
Subject: [PATCH] xfrm: spi is big-endian
|
|
|
3730f4 |
|
|
|
3730f4 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1790963
|
|
|
3730f4 |
Upstream Status: nftables commit 488356b895024
|
|
|
3730f4 |
|
|
|
3730f4 |
commit 488356b895024d0944b20feb1f930558726e0877
|
|
|
3730f4 |
Author: Florian Westphal <fw@strlen.de>
|
|
|
3730f4 |
Date: Tue Jan 14 13:37:28 2020 +0100
|
|
|
3730f4 |
|
|
|
3730f4 |
xfrm: spi is big-endian
|
|
|
3730f4 |
|
|
|
3730f4 |
the kernel stores spi in a __be32, so fix up the byteorder annotation.
|
|
|
3730f4 |
|
|
|
3730f4 |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
3730f4 |
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
3730f4 |
---
|
|
|
3730f4 |
src/xfrm.c | 2 +-
|
|
|
3730f4 |
tests/py/inet/ipsec.t.payload | 1 -
|
|
|
3730f4 |
2 files changed, 1 insertion(+), 2 deletions(-)
|
|
|
3730f4 |
|
|
|
3730f4 |
diff --git a/src/xfrm.c b/src/xfrm.c
|
|
|
3730f4 |
index 4dd53c3..336e8c9 100644
|
|
|
3730f4 |
--- a/src/xfrm.c
|
|
|
3730f4 |
+++ b/src/xfrm.c
|
|
|
3730f4 |
@@ -39,7 +39,7 @@ const struct xfrm_template xfrm_templates[] = {
|
|
|
3730f4 |
[NFT_XFRM_KEY_DADDR_IP6] = XFRM_TEMPLATE_BE("daddr", &ip6addr_type, 16 * BITS_PER_BYTE),
|
|
|
3730f4 |
[NFT_XFRM_KEY_SADDR_IP6] = XFRM_TEMPLATE_BE("saddr", &ip6addr_type, 16 * BITS_PER_BYTE),
|
|
|
3730f4 |
[NFT_XFRM_KEY_REQID] = XFRM_TEMPLATE_HE("reqid", &integer_type, 4 * BITS_PER_BYTE),
|
|
|
3730f4 |
- [NFT_XFRM_KEY_SPI] = XFRM_TEMPLATE_HE("spi", &integer_type, 4 * BITS_PER_BYTE),
|
|
|
3730f4 |
+ [NFT_XFRM_KEY_SPI] = XFRM_TEMPLATE_BE("spi", &integer_type, 4 * BITS_PER_BYTE),
|
|
|
3730f4 |
};
|
|
|
3730f4 |
|
|
|
3730f4 |
static void xfrm_expr_print(const struct expr *expr, struct output_ctx *octx)
|
|
|
3730f4 |
diff --git a/tests/py/inet/ipsec.t.payload b/tests/py/inet/ipsec.t.payload
|
|
|
3730f4 |
index 6049c66..c46a226 100644
|
|
|
3730f4 |
--- a/tests/py/inet/ipsec.t.payload
|
|
|
3730f4 |
+++ b/tests/py/inet/ipsec.t.payload
|
|
|
3730f4 |
@@ -16,7 +16,6 @@ ip ipsec-ip4 ipsec-input
|
|
|
3730f4 |
# ipsec out spi 1-561
|
|
|
3730f4 |
inet ipsec-inet ipsec-post
|
|
|
3730f4 |
[ xfrm load out 0 spi => reg 1 ]
|
|
|
3730f4 |
- [ byteorder reg 1 = hton(reg 1, 4, 4) ]
|
|
|
3730f4 |
[ cmp gte reg 1 0x01000000 ]
|
|
|
3730f4 |
[ cmp lte reg 1 0x31020000 ]
|
|
|
3730f4 |
|
|
|
3730f4 |
--
|
|
|
3730f4 |
1.8.3.1
|
|
|
3730f4 |
|