| 51 return (ZERR_NONE); |
51 return (ZERR_NONE); |
| 52 |
52 |
| 53 if ((retval = ZParseNotice(packet, len, ¬ice)) != ZERR_NONE) |
53 if ((retval = ZParseNotice(packet, len, ¬ice)) != ZERR_NONE) |
| 54 return (retval); |
54 return (retval); |
| 55 |
55 |
| 56 retval = Z_WaitForNotice (&acknotice, wait_for_ack, ¬ice.z_uid, |
56 retval = Z_WaitForNotice (&acknotice, wait_for_hmack, ¬ice.z_uid, |
| 57 HM_TIMEOUT); |
57 HM_TIMEOUT); |
| 58 if (retval == ETIMEDOUT) |
58 if (retval == ETIMEDOUT) |
| 59 return ZERR_HMDEAD; |
59 return ZERR_HMDEAD; |
| 60 if (retval == ZERR_NONE) |
60 if (retval == ZERR_NONE) |
| 61 ZFreeNotice (&acknotice); |
61 ZFreeNotice (&acknotice); |
| 62 return retval; |
62 return retval; |
| 63 } |
63 } |
| 64 |
64 |
| 65 static int wait_for_ack(notice, uid) |
65 static int wait_for_hmack(notice, uid) |
| 66 ZNotice_t *notice; |
66 ZNotice_t *notice; |
| 67 ZUnique_Id_t *uid; |
67 ZUnique_Id_t *uid; |
| 68 { |
68 { |
| 69 return (ZCompareUID(¬ice->z_uid, uid) && |
69 return (notice->z_kind == HMACK && ZCompareUID(¬ice->z_uid, uid)); |
| 70 (notice->z_kind == HMACK || |
|
| 71 notice->z_kind == SERVACK || |
|
| 72 notice->z_kind == CLIENTACK )); |
|
| 73 } |
70 } |