From: Jo-Philipp Wich Date: Fri, 4 Mar 2016 17:43:54 +0000 (+0100) Subject: system-linux: Fix VTI ikey/okey on little endian systems X-Git-Url: http://git.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=e27e23f76437edc7871c03c8c92d69fbe52d30f5 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 --- 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);