commit 344d2bade53f42086e3ddc0054a7a82b2a2efe9a from: Omar Polo date: Sat Jan 22 15:45:27 2022 UTC 9pclib: fix qid serialization twstat was serializing the qid in the wrong order. While here, add a comment before the qid definition too. commit - 16f1f3bfff8671ebbfd9b69928b9427a7fe1fc8a commit + 344d2bade53f42086e3ddc0054a7a82b2a2efe9a blob - 9394060b085ba279ba8f71506678bfb00c437df6 blob + ed070718b0c80689f8e83e13ec1eec4c88631f13 --- lib/9pclib.c +++ lib/9pclib.c @@ -273,9 +273,9 @@ twstat(uint32_t fid, const struct np_stat *st) write_16(st->type); write_32(st->dev); - write_64(st->qid.path); - write_32(st->qid.vers); write_8(st->qid.type); + write_32(st->qid.vers); + write_64(st->qid.path); write_32(st->mode); write_32(st->atime); blob - 3fb6ef84d6a0767820124adec82e8ff307458353 blob + 32883661a561e80c423f155b5ffa2f4011110141 --- lib/kami.h +++ lib/kami.h @@ -29,6 +29,10 @@ struct np_msg_header { uint16_t tag; }; +/* + * The qid represents the server unique identification for the file. + * NOTE: the struct fields don't reflect the layout on the wire! + */ struct qid { uint64_t path; uint32_t vers;