Patch fixes evt service. Main problem is in hdb_handle_* functions,
which expect 64bits handle number, but request has 32bits. So using
hdb_nocheck_convert in service/evt.c makes test/testevt works again.
Regards,
Honza
Index: services/evt.c
===================================================================
--- services/evt.c (revision 1851)
+++ services/evt.c (working copy)
@@ -2418,7 +2418,7 @@
* look up the channel handle
*/
ret = hdb_handle_get(&esip->esi_hdb,
- req->icc_channel_handle, &ptr);
+ hdb_nocheck_convert(req->icc_channel_handle), &ptr);
if (ret != 0) {
goto chan_close_done;
}
@@ -2426,8 +2426,8 @@
printf ("close1\n");
common_chan_close(eco, esip, conn);
- hdb_handle_destroy(&esip->esi_hdb, req->icc_channel_handle);
- hdb_handle_put(&esip->esi_hdb, req->icc_channel_handle);
+ hdb_handle_destroy(&esip->esi_hdb, hdb_nocheck_convert(req->icc_channel_handle));
+ hdb_handle_put(&esip->esi_hdb, hdb_nocheck_convert(req->icc_channel_handle));
chan_close_done:
res.icc_head.size = sizeof(res);
@@ -2553,7 +2553,7 @@
/*
* look up the channel handle
*/
- ret = hdb_handle_get(&esip->esi_hdb, req->ics_channel_handle, &ptr);
+ ret = hdb_handle_get(&esip->esi_hdb, hdb_nocheck_convert(req->ics_channel_handle), &ptr);
if (ret != 0) {
error = SA_AIS_ERR_BAD_HANDLE;
goto subr_done;
@@ -2629,11 +2629,11 @@
}
}
}
- hdb_handle_put(&esip->esi_hdb, req->ics_channel_handle);
+ hdb_handle_put(&esip->esi_hdb, hdb_nocheck_convert(req->ics_channel_handle));
return;
subr_put:
- hdb_handle_put(&esip->esi_hdb, req->ics_channel_handle);
+ hdb_handle_put(&esip->esi_hdb, hdb_nocheck_convert(req->ics_channel_handle));
subr_done:
res.ics_head.size = sizeof(res);
res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE;
@@ -2668,7 +2668,7 @@
* data.
*/
ret = hdb_handle_get(&esip->esi_hdb,
- req->icu_channel_handle, &ptr);
+ hdb_nocheck_convert(req->icu_channel_handle), &ptr);
if (ret != 0) {
error = SA_AIS_ERR_BAD_HANDLE;
goto unsubr_done;
@@ -2698,7 +2698,7 @@
free(ecs);
unsubr_put:
- hdb_handle_put(&esip->esi_hdb, req->icu_channel_handle);
+ hdb_handle_put(&esip->esi_hdb, hdb_nocheck_convert(req->icu_channel_handle));
unsubr_done:
res.icu_head.size = sizeof(res);
res.icu_head.id = MESSAGE_RES_EVT_UNSUBSCRIBE;
@@ -2734,7 +2734,7 @@
* look up and validate open channel info
*/
ret = hdb_handle_get(&esip->esi_hdb,
- req->led_svr_channel_handle, &ptr);
+ hdb_nocheck_convert(req->led_svr_channel_handle), &ptr);
if (ret != 0) {
error = SA_AIS_ERR_BAD_HANDLE;
goto pub_done;
@@ -2766,7 +2766,7 @@
error = SA_AIS_ERR_LIBRARY;
}
- hdb_handle_put(&esip->esi_hdb, req->led_svr_channel_handle);
+ hdb_handle_put(&esip->esi_hdb, hdb_nocheck_convert(req->led_svr_channel_handle));
pub_done:
res.iep_head.size = sizeof(res);
res.iep_head.id = MESSAGE_RES_EVT_PUBLISH;
@@ -3055,7 +3055,7 @@
printf ("close2\n");
common_chan_close(eco, esip, conn);
printf ("handle destroy %p %d\n", &esip->esi_hdb, eco->eco_my_handle);
- hdb_handle_destroy(&esip->esi_hdb, eco->eco_my_handle);
+ hdb_handle_destroy(&esip->esi_hdb, hdb_nocheck_convert(eco->eco_my_handle));
}
/*
_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais