From: adilger Date: Wed, 18 Feb 2004 20:07:54 +0000 (+0000) Subject: Fix endian conversion of socknal major/minor version. They are __u16 not __u32. X-Git-Tag: v1_7_100~2572 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7ab42dfacc30a8141efaf7c511f964bc879d1731 Fix endian conversion of socknal major/minor version. They are __u16 not __u32. b=2464 --- diff --git a/lnet/klnds/socklnd/socklnd_cb.c b/lnet/klnds/socklnd/socklnd_cb.c index 3ecead1..7c84ec8 100644 --- a/lnet/klnds/socklnd/socklnd_cb.c +++ b/lnet/klnds/socklnd/socklnd_cb.c @@ -2022,7 +2022,8 @@ ksocknal_sock_read (struct socket *sock, void *buffer, int nob) } int -ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, __u64 *incarnation) +ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, + __u64 *incarnation) { int rc; ptl_hdr_t hdr; @@ -2033,14 +2034,14 @@ ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, __u64 *incarnati memset (&hdr, 0, sizeof (hdr)); hmv->magic = __cpu_to_le32 (PORTALS_PROTO_MAGIC); - hmv->version_major = __cpu_to_le32 (PORTALS_PROTO_VERSION_MAJOR); - hmv->version_minor = __cpu_to_le32 (PORTALS_PROTO_VERSION_MINOR); - + hmv->version_major = __cpu_to_le16 (PORTALS_PROTO_VERSION_MAJOR); + hmv->version_minor = __cpu_to_le16 (PORTALS_PROTO_VERSION_MINOR); + hdr.src_nid = __cpu_to_le64 (ksocknal_lib.ni.nid); hdr.type = __cpu_to_le32 (PTL_MSG_HELLO); hdr.msg.hello.type = __cpu_to_le32 (*type); - hdr.msg.hello.incarnation = + hdr.msg.hello.incarnation = __cpu_to_le64 (ksocknal_data.ksnd_incarnation); /* Assume sufficient socket buffering for this message */ diff --git a/lustre/portals/knals/socknal/socknal_cb.c b/lustre/portals/knals/socknal/socknal_cb.c index 3ecead1..7c84ec8 100644 --- a/lustre/portals/knals/socknal/socknal_cb.c +++ b/lustre/portals/knals/socknal/socknal_cb.c @@ -2022,7 +2022,8 @@ ksocknal_sock_read (struct socket *sock, void *buffer, int nob) } int -ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, __u64 *incarnation) +ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, + __u64 *incarnation) { int rc; ptl_hdr_t hdr; @@ -2033,14 +2034,14 @@ ksocknal_hello (struct socket *sock, ptl_nid_t *nid, int *type, __u64 *incarnati memset (&hdr, 0, sizeof (hdr)); hmv->magic = __cpu_to_le32 (PORTALS_PROTO_MAGIC); - hmv->version_major = __cpu_to_le32 (PORTALS_PROTO_VERSION_MAJOR); - hmv->version_minor = __cpu_to_le32 (PORTALS_PROTO_VERSION_MINOR); - + hmv->version_major = __cpu_to_le16 (PORTALS_PROTO_VERSION_MAJOR); + hmv->version_minor = __cpu_to_le16 (PORTALS_PROTO_VERSION_MINOR); + hdr.src_nid = __cpu_to_le64 (ksocknal_lib.ni.nid); hdr.type = __cpu_to_le32 (PTL_MSG_HELLO); hdr.msg.hello.type = __cpu_to_le32 (*type); - hdr.msg.hello.incarnation = + hdr.msg.hello.incarnation = __cpu_to_le64 (ksocknal_data.ksnd_incarnation); /* Assume sufficient socket buffering for this message */