diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-07-22 00:23:47 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-07-22 00:24:15 -0400 |
commit | 01f61d331bb5038f0c877ac03c54333328b6ea28 (patch) | |
tree | 57764b5690b2089fbc378bcb0090238aa4395dc6 /src/udev/ata_id/ata_id.c | |
parent | 899c4195c68943dfc6b0323e912077abfef73e7a (diff) |
ata_id: unreverse WWN identifier
An endianness conversion was lost in 6024a6e302bad6bcf073fa84a41a6123305dc845.
Restore it. Now ata_id and scsi_id output match.
https://bugzilla.redhat.com/show_bug.cgi?id=1227503
Diffstat (limited to 'src/udev/ata_id/ata_id.c')
-rw-r--r-- | src/udev/ata_id/ata_id.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c index 7ba0b7fc8f..a59d4c6d50 100644 --- a/src/udev/ata_id/ata_id.c +++ b/src/udev/ata_id/ata_id.c @@ -638,10 +638,20 @@ int main(int argc, char *argv[]) * All other values are reserved. */ word = identify.wyde[108]; - if ((word & 0xf000) == 0x5000) + if ((word & 0xf000) == 0x5000) { + uint64_t wwwn; + + wwwn = identify.wyde[108]; + wwwn <<= 16; + wwwn |= identify.wyde[109]; + wwwn <<= 16; + wwwn |= identify.wyde[110]; + wwwn <<= 16; + wwwn |= identify.wyde[111]; printf("ID_WWN=0x%1$" PRIx64 "\n" "ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n", - identify.octa[108/4]); + wwwn); + } /* from Linux's include/linux/ata.h */ if (identify.wyde[0] == 0x848a || |