diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 30cd78dfa8399f77b6e34a7675e754d81580a9a0..294154684730943f09e795a9221174ce8da2c0a3 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -508,6 +508,11 @@ Details    : Use fsfilt_sync() for both the whole filesystem sync and
              individual file sync to eliminate dangerous inode locking
              with I_LOCK that can lead to a deadlock.
 
+Severity   : minor
+Bugzilla   : 15566
+Description: Update an obsolete wirecheck.c generator
+Details    : Update wirecheck.c/wirehdr.c and regenerate wiretest.c
+
 --------------------------------------------------------------------------------
 
 2007-12-07         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/ptlrpc/wirehdr.c b/lustre/ptlrpc/wirehdr.c
index d287ba3214ad9d031861b6f3af58cdf9bc8bed9d..a674953085d8dfbb5a2b60f2144649fd90d009b4 100644
--- a/lustre/ptlrpc/wirehdr.c
+++ b/lustre/ptlrpc/wirehdr.c
@@ -3,6 +3,24 @@
 # include <liblustre.h>
 #endif
 
+#ifdef __KERNEL__
+# ifndef AUTOCONF_INCLUDED
+#  include <linux/config.h>
+# endif
+# ifdef CONFIG_FS_POSIX_ACL
+#  include <linux/fs.h>
+#  ifdef HAVE_XATTR_ACL
+#   include <linux/xattr_acl.h>
+#  else
+#   define xattr_acl_entry  posix_acl_xattr_entry
+#   define xattr_acl_header posix_acl_xattr_header
+#  endif
+#  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+#   include <linux/posix_acl_xattr.h>
+#  endif
+# endif
+#endif
+
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c
index 7a1633efeb7af72d425b8605b4d0ce66f731d684..25c7b7ddf22da58a109e219189292646dbb8394a 100644
--- a/lustre/ptlrpc/wiretest.c
+++ b/lustre/ptlrpc/wiretest.c
@@ -3,6 +3,24 @@
 # include <liblustre.h>
 #endif
 
+#ifdef __KERNEL__
+# ifndef AUTOCONF_INCLUDED
+#  include <linux/config.h>
+# endif
+# ifdef CONFIG_FS_POSIX_ACL
+#  include <linux/fs.h>
+#  ifdef HAVE_XATTR_ACL
+#   include <linux/xattr_acl.h>
+#  else
+#   define xattr_acl_entry  posix_acl_xattr_entry
+#   define xattr_acl_header posix_acl_xattr_header
+#  endif
+#  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+#   include <linux/posix_acl_xattr.h>
+#  endif
+# endif
+#endif
+
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
@@ -11,9 +29,9 @@
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwirecheck)
-         * running on Linux vmbuild 2.6.9-build #1 SMP Sat Apr 7 11:21:22 MDT 2007 i686 i686 i386 GNU
-         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-4) */
+         * (make -C lustre/utils newwiretest)
+         * running on Linux xlab.hostel 2.6.23.12-52.fc7 #1 SMP Tue Dec 18 21:18:02 EST 2007 i686 i68
+         * with gcc версия 3.4.6 20060404 (Red Hat 3.4.6-7) */
 
 
         /* Constants... */
@@ -434,7 +452,7 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllg) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllg));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
-	         (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_group) == 48, " found %lld\n",
@@ -628,8 +646,8 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
         CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
         CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
-        CLASSERT(OBD_CKSUM_CRC32 == (0x00000001));
-        CLASSERT(OBD_CKSUM_ADLER == (0x00000002));
+        CLASSERT(OBD_CKSUM_CRC32 == 1);
+        CLASSERT(OBD_CKSUM_ADLER == 2);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
@@ -2182,5 +2200,35 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_disk_data, ldd_params));
         LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
+#ifdef LIBLUSTRE_POSIX_ACL
+
+        /* Checks for type posix_acl_xattr_entry */
+        LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
+                 (long long)(int)sizeof(xattr_acl_entry));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_tag) == 0, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_tag));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_tag) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_tag));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_perm) == 2, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_perm));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_perm) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_perm));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_id) == 4, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_id));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_id) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_id));
+
+        /* Checks for type posix_acl_xattr_header */
+        LASSERTF((int)sizeof(xattr_acl_header) == 4, " found %lld\n",
+                 (long long)(int)sizeof(xattr_acl_header));
+        LASSERTF((int)offsetof(xattr_acl_header, a_version) == 0, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_header, a_version));
+        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_version) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_version));
+        LASSERTF((int)offsetof(xattr_acl_header, a_entries) == 4, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_header, a_entries));
+        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_entries) == 0, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_entries));
+#endif
 }
 
diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c
index 1b0d20371cd0588715fcaeca4cfa90735af1dcbb..5a731089d5d36d291dce4990ef3b6681be3897f6 100644
--- a/lustre/utils/wirecheck.c
+++ b/lustre/utils/wirecheck.c
@@ -289,8 +289,8 @@ check_obdo(void)
         CHECK_CDEFINE(OBD_FL_TRUNCLOCK);
         CHECK_CDEFINE(OBD_FL_CKSUM_CRC32);
         CHECK_CDEFINE(OBD_FL_CKSUM_ADLER);
-        CHECK_CDEFINE(OBD_CKSUM_CRC32);
-        CHECK_CDEFINE(OBD_CKSUM_ADLER);
+        CHECK_CVALUE(OBD_CKSUM_CRC32);
+        CHECK_CVALUE(OBD_CKSUM_ADLER);
 }
 
 static void
@@ -1139,7 +1139,7 @@ main(int argc, char **argv)
         printf ("void lustre_assert_wire_constants(void)\n"
                 "{\n"
                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
-                "         * (make -C lustre/utils newwirecheck)\n"
+                "         * (make -C lustre/utils newwiretest)\n"
                 "         * running on %s\n"
                 "         * with %s */\n"
                 "\n", unameinfo, gccinfo);
@@ -1245,6 +1245,7 @@ main(int argc, char **argv)
         CHECK_VALUE(LCK_NL);
         CHECK_VALUE(LCK_GROUP);
         CHECK_VALUE(LCK_MAXMODE);
+        CHECK_VALUE(LCK_MODE_NUM);
 
         CHECK_CVALUE(LDLM_PLAIN);
         CHECK_CVALUE(LDLM_EXTENT);
@@ -1328,10 +1329,10 @@ main(int argc, char **argv)
         check_quota_adjust_qunit();
         check_mgs_target_info();
         check_lustre_disk_data();
-#ifdef LIBLUSTRE_POSIX_ACL
+        printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
         check_posix_acl_xattr_entry();
         check_posix_acl_xattr_header();
-#endif
+        printf("#endif\n");
 
 
         printf("}\n\n");
diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c
index 36d09dec14e0eca9d93adcaa969bed6c414de624..869180777c77be779e93b4ddfa76764c8bd9b087 100644
--- a/lustre/utils/wiretest.c
+++ b/lustre/utils/wiretest.c
@@ -27,9 +27,9 @@ int main()
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwirecheck)
-         * running on Linux vmbuild 2.6.9-build #1 SMP Sat Apr 7 11:21:22 MDT 2007 i686 i686 i386 GNU
-         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-4) */
+         * (make -C lustre/utils newwiretest)
+         * running on Linux xlab.hostel 2.6.23.12-52.fc7 #1 SMP Tue Dec 18 21:18:02 EST 2007 i686 i68
+         * with gcc версия 3.4.6 20060404 (Red Hat 3.4.6-7) */
 
 
         /* Constants... */
@@ -450,7 +450,7 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllg) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllg));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
-	         (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_group) == 48, " found %lld\n",
@@ -644,8 +644,8 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
         CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
         CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
-        CLASSERT(OBD_CKSUM_CRC32 == (0x00000001));
-        CLASSERT(OBD_CKSUM_ADLER == (0x00000002));
+        CLASSERT(OBD_CKSUM_CRC32 == 1);
+        CLASSERT(OBD_CKSUM_ADLER == 2);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
@@ -2198,8 +2198,8 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_disk_data, ldd_params));
         LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
-
 #ifdef LIBLUSTRE_POSIX_ACL
+
         /* Checks for type posix_acl_xattr_entry */
         LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
                  (long long)(int)sizeof(xattr_acl_entry));