From e27e23f76437edc7871c03c8c92d69fbe52d30f5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 4 Mar 2016 18:43:54 +0100 Subject: [PATCH] system-linux: Fix VTI ikey/okey on little endian systems The kernel expects the IFLA_VTI_IKEY and IFLA_VTI_OKEY netlink attributes to be in network byte order, so ensure that the values are stored accordingly. Signed-off-by: Jo-Philipp Wich --- system-linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-linux.c b/system-linux.c index 86e373c..2d56808 100644 --- a/system-linux.c +++ b/system-linux.c @@ -2224,10 +2224,10 @@ static int system_add_vti_tunnel(const char *name, const char *kind, } if (okey) - nla_put_u32(nlm, IFLA_VTI_OKEY, okey); + nla_put_be32(nlm, IFLA_VTI_OKEY, okey); if (ikey) - nla_put_u32(nlm, IFLA_VTI_IKEY, ikey); + nla_put_be32(nlm, IFLA_VTI_IKEY, ikey); nla_nest_end(nlm, infodata); nla_nest_end(nlm, linkinfo); -- 2.30.2