X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_mdns.c;h=1dc6cbbb768714637f89e5077f1769abef9cd72b;hb=d202fc4ee109f920ec222cb8fd723f48f3803754;hp=e14791fee2dd93c4db6b8deef1c65f92ba168b77;hpb=33c70ce1349f3e7fcbc5776785f34f3bd89f1d92;p=netatalk.git diff --git a/etc/afpd/afp_mdns.c b/etc/afpd/afp_mdns.c index e14791fe..1dc6cbbb 100644 --- a/etc/afpd/afp_mdns.c +++ b/etc/afpd/afp_mdns.c @@ -232,7 +232,7 @@ static void register_stuff(const AFPObj *obj) { LOG(log_info, logtype_afpd, "Registering server '%s' with model '%s'", dsi->bonjourname, obj->options.mimicmodel); TXTRecordCreate(&txt_devinfo, 0, NULL); - TXTRecordPrintf(&txt_devinfo, "model=%s", obj->options.mimicmodel); + TXTRecordPrintf(&txt_devinfo, "model", obj->options.mimicmodel); error = DNSServiceRegister(&svc_refs[svc_ref_count++], 0, // no flags 0, // all network interfaces @@ -240,7 +240,14 @@ static void register_stuff(const AFPObj *obj) { DEV_INFO_SERVICE_TYPE, "", // default domains NULL, // default host name - 0, + /* + * We would probably use port 0 zero, but we can't, from man DNSServiceRegister: + * "A value of 0 for a port is passed to register placeholder services. + * Place holder services are not found when browsing, but other + * clients cannot register with the same name as the placeholder service." + * We therefor use port 9 which is used by the adisk service type. + */ + htons(9), TXTRecordGetLength(&txt_devinfo), TXTRecordGetBytesPtr(&txt_devinfo), RegisterReply, // callback