[OpenAFS-devel] Patch for check_sysid

Harald Barth haba@pdc.kth.se
Sat, 26 Mar 2005 12:18:11 +0100 (MET)


> this patch just masks the problem on little-endian machines. the
> contents of the sysid file are stored in NBO.  the original code is
> (mostly) correct; there should be an ntohl before the printf.

You are so right. I should sleep more and hack less. No wait,
that is wrong, too.

--- src/viced/check_sysid.c.~1.6.~      2003-07-16 01:17:30.000000000 +0200
+++ src/viced/check_sysid.c     2005-03-26 12:14:52.000000000 +0100
@@ -103,6 +103,7 @@
                   i + 1, size, errno);
            exit(5);
        }
+       addr = ntohl(addr);
        printf("Address              = %d.%d.%d.%d (0x%x)\n",
               (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff,
               (addr) & 0xff, addr);

Harald.