-/* $OpenBSD: ds.c,v 1.6 2018/07/09 14:46:08 kettenis Exp $ */
+/* $OpenBSD: ds.c,v 1.7 2018/07/13 07:29:08 kettenis Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
DPRINTF(("DS_REG_REQ %s %d.%d 0x%016llx\n", dr->svc_id,
dr->major_vers, dr->minor_vers, dr->svc_handle));
TAILQ_FOREACH(dcs, &dc->services, link) {
- if (strcmp(dr->svc_id, dcs->service->ds_svc_id) == 0) {
+ if (strcmp(dr->svc_id, dcs->service->ds_svc_id) == 0 &&
+ dr->major_vers == dcs->service->ds_major_vers) {
dcs->svc_handle = dr->svc_handle;
dcs->ackid = lc->lc_tx_seqid;
- ds_reg_ack(lc, dcs->svc_handle);
+ ds_reg_ack(lc, dcs->svc_handle,
+ dcs->service->ds_minor_vers);
dcs->service->ds_start(lc, dcs->svc_handle);
return;
}
}
void
-ds_reg_ack(struct ldc_conn *lc, uint64_t svc_handle)
+ds_reg_ack(struct ldc_conn *lc, uint64_t svc_handle, uint16_t minor)
{
struct ds_reg_ack da;
da.msg_type = DS_REG_ACK;
da.payload_len = sizeof(da) - 8;
da.svc_handle = svc_handle;
- da.minor_vers = 0;
+ da.minor_vers = minor;
ds_send_msg(lc, &da, sizeof(da));
}
-/* $OpenBSD: ds.h,v 1.2 2012/11/04 18:57:10 kettenis Exp $ */
+/* $OpenBSD: ds.h,v 1.3 2018/07/13 07:29:08 kettenis Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
void ds_rx_msg(struct ldc_conn *, void *, size_t);
void ds_init_ack(struct ldc_conn *);
-void ds_reg_ack(struct ldc_conn *, uint64_t);
+void ds_reg_ack(struct ldc_conn *, uint64_t, uint16_t);
void ds_reg_nack(struct ldc_conn *, uint64_t);
void ds_unreg_ack(struct ldc_conn *, uint64_t);
void ds_unreg_nack(struct ldc_conn *, uint64_t);