The kernel expects IFLA_GRE_IKEY and IFLA_GRE_OKEY to be in network byte
order, so convert the values from host byte order.
Fixes ikey/okey on little endian systems.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
nla_put_u16(nlm, IFLA_GRE_IFLAGS, iflags);
if (okey)
- nla_put_u32(nlm, IFLA_GRE_OKEY, okey);
+ nla_put_u32(nlm, IFLA_GRE_OKEY, htonl(okey));
if (ikey)
- nla_put_u32(nlm, IFLA_GRE_IKEY, ikey);
+ nla_put_u32(nlm, IFLA_GRE_IKEY, htonl(ikey));
nla_nest_end(nlm, infodata);
nla_nest_end(nlm, linkinfo);