]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Set the remote handle when updating or requesting a refresh of an object.
authorTed Lemon <source@isc.org>
Sun, 1 Oct 2000 21:40:40 +0000 (21:40 +0000)
committerTed Lemon <source@isc.org>
Sun, 1 Oct 2000 21:40:40 +0000 (21:40 +0000)
dhcpctl/dhcpctl.c

index 2bc6550e0f3aede01816ed4729209c08323df207..60d6e065ceadb83f914f12a909b02ba05545f553 100644 (file)
@@ -393,6 +393,11 @@ dhcpctl_status dhcpctl_object_update (dhcpctl_handle connection,
 {
        isc_result_t status;
        omapi_object_t *message = (omapi_object_t *)0;
+       dhcpctl_remote_object_t *ro;
+
+       if (h -> type != dhcpctl_remote_type)
+               return ISC_R_INVALIDARG;
+       ro = (dhcpctl_remote_object_t *)h;
 
        status = omapi_message_new (&message, MDL);
        if (status != ISC_R_SUCCESS) {
@@ -405,6 +410,7 @@ dhcpctl_status dhcpctl_object_update (dhcpctl_handle connection,
                omapi_object_dereference (&message, MDL);
                return status;
        }
+
        status = omapi_set_object_value (message, (omapi_object_t *)0,
                                         "object", h);
        if (status != ISC_R_SUCCESS) {
@@ -412,6 +418,13 @@ dhcpctl_status dhcpctl_object_update (dhcpctl_handle connection,
                return status;
        }
 
+       status = omapi_set_int_value (message, (omapi_object_t *)0, "handle",
+                                     (int)(ro -> remote_handle));
+       if (status != ISC_R_SUCCESS) {
+               omapi_object_dereference (&message, MDL);
+               return status;
+       }
+
        omapi_message_register (message);
        status = omapi_protocol_send_message (connection -> outer,
                                              (omapi_object_t *)0,
@@ -429,6 +442,11 @@ dhcpctl_status dhcpctl_object_refresh (dhcpctl_handle connection,
 {
        isc_result_t status;
        omapi_object_t *message = (omapi_object_t *)0;
+       dhcpctl_remote_object_t *ro;
+
+       if (h -> type != dhcpctl_remote_type)
+               return ISC_R_INVALIDARG;
+       ro = (dhcpctl_remote_object_t *)h;
 
        status = omapi_message_new (&message, MDL);
        if (status != ISC_R_SUCCESS) {
@@ -442,7 +460,7 @@ dhcpctl_status dhcpctl_object_refresh (dhcpctl_handle connection,
                return status;
        }
        status = omapi_set_int_value (message, (omapi_object_t *)0,
-                                     "handle", (int)(h -> handle));
+                                     "handle", (int)(ro -> remote_handle));
        if (status != ISC_R_SUCCESS) {
                omapi_object_dereference (&message, MDL);
                return status;