summaryrefslogtreecommitdiff
path: root/usr.sbin/ldomctl/mdstore.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-07-06 21:20:20 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-07-06 21:20:20 +0000
commitb4c9344b9b3214b7161c492faebc678effcc90f6 (patch)
tree2bba730a0859194c4615b07cfa9ffb1b5e1c8bce /usr.sbin/ldomctl/mdstore.c
parent107d7313ab6e20108311935f6ac411da27c6c8a7 (diff)
Make sure we use the svc_handle for the negotiated major version of the
"mdstore" service.
Diffstat (limited to 'usr.sbin/ldomctl/mdstore.c')
-rw-r--r--usr.sbin/ldomctl/mdstore.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/ldomctl/mdstore.c b/usr.sbin/ldomctl/mdstore.c
index 2dc99a90568..7e86c0e0070 100644
--- a/usr.sbin/ldomctl/mdstore.c
+++ b/usr.sbin/ldomctl/mdstore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdstore.c,v 1.9 2019/07/06 21:12:38 kettenis Exp $ */
+/* $OpenBSD: mdstore.c,v 1.10 2019/07/06 21:20:19 kettenis Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
@@ -340,7 +340,8 @@ mdstore_select(struct ds_conn *dc, const char *name)
size_t len = sizeof(*mr) + strlen(name);
TAILQ_FOREACH(dcs, &dc->services, link)
- if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
+ if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0 &&
+ dcs->svc_handle != 0)
break;
assert(dcs != NULL);
@@ -368,7 +369,8 @@ mdstore_delete(struct ds_conn *dc, const char *name)
size_t len = sizeof(*mr) + strlen(name);
TAILQ_FOREACH(dcs, &dc->services, link)
- if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
+ if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0 &&
+ dcs->svc_handle != 0)
break;
assert(dcs != NULL);
@@ -407,7 +409,8 @@ mdstore_download(struct ds_conn *dc, const char *name)
uint16_t type;
TAILQ_FOREACH(dcs, &dc->services, link)
- if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
+ if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0 &&
+ dcs->svc_handle != 0)
break;
assert(dcs != NULL);