Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Commit

Permalink
wg-quick: android: no need to destroy network cache
Browse files Browse the repository at this point in the history
It's implied when the networkid is destroyed.
  • Loading branch information
zx2c4 committed Oct 12, 2019
1 parent 0d44096 commit a19c6b6
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/tools/wg-quick/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,36 +523,6 @@ static int32_t dnsresolver_create_network_cache(void *handle, int32_t netid)
return STATUS_OK;
}

static int32_t dnsresolver_destroy_network_cache(void *handle, int32_t netid)
{
AIBinder *const binder = handle;
binder_status_t status;
_cleanup_parcel_ AParcel *parcel_in = NULL;
_cleanup_parcel_ AParcel *parcel_out = NULL;
_cleanup_status_ AStatus *status_out = NULL;

status = AIBinder_prepareTransaction(binder, &parcel_in);
if (status != STATUS_OK)
return status;

status = AParcel_writeInt32(parcel_in, netid);
if (status != STATUS_OK)
return status;

status = AIBinder_transact(binder, FIRST_CALL_TRANSACTION + 8 /* destroyNetworkCache */, &parcel_in, &parcel_out, 0);
if (status != STATUS_OK)
return status;

status = AParcel_readStatusHeader(parcel_out, &status_out);
if (status != STATUS_OK)
return status;

if (!AStatus_isOk(status_out))
return meaningful_binder_status(status_out);

return STATUS_OK;
}

static int32_t dnsresolver_set_resolver_configuration(void *handle, const struct dnsresolver_params *params)
{
AIBinder *const binder = handle;
Expand Down Expand Up @@ -904,8 +874,6 @@ static void set_dnses(unsigned int netid, const char *dnses)

if (status != 0) {
fprintf(stderr, "Error: unable to set DNS servers through Binder: %d\n", status);
printf("[#] <binder>::dnsResolver->destroyNetworkCache(%u)\n", netid);
dnsresolver_destroy_network_cache(handle, netid);
exit(ENONET);
}
} else
Expand Down

0 comments on commit a19c6b6

Please sign in to comment.