[PATCH 1/2] Revert "macsec: fix endianness of 'sci' parameter"

Beniamino Galvani bgalvani at redhat.com
Thu Dec 15 05:41:54 PST 2016


The commit changed the API from libnl 3.2.28: restore the old
behavior.

This reverts commit cd758fbfee07768ff200f46d7090fa8d0e6b300f.

Signed-off-by: Beniamino Galvani <bgalvani at redhat.com>
---
 lib/route/link/macsec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/route/link/macsec.c b/lib/route/link/macsec.c
index 186e8d1..eccfbfa 100644
--- a/lib/route/link/macsec.c
+++ b/lib/route/link/macsec.c
@@ -104,7 +104,7 @@ static int macsec_parse(struct rtnl_link *link, struct nlattr *data,
 	info = link->l_info;
 
 	if (tb[IFLA_MACSEC_SCI]) {
-		info->sci = ntohll(nla_get_u64(tb[IFLA_MACSEC_SCI]));
+		info->sci = nla_get_u64(tb[IFLA_MACSEC_SCI]);
 		info->ce_mask |= MACSEC_ATTR_SCI;
 	}
 
@@ -277,7 +277,7 @@ static int macsec_put_attrs(struct nl_msg *msg, struct rtnl_link *link)
 		return -NLE_MSGSIZE;
 
 	if (info->ce_mask & MACSEC_ATTR_SCI)
-		NLA_PUT_U64(msg, IFLA_MACSEC_SCI, htonll(info->sci));
+		NLA_PUT_U64(msg, IFLA_MACSEC_SCI, info->sci);
 	else if (info->ce_mask & MACSEC_ATTR_PORT)
 		NLA_PUT_U16(msg, IFLA_MACSEC_PORT, htons(info->port));
 
-- 
2.7.4




More information about the libnl mailing list