summaryrefslogtreecommitdiff
path: root/src/modules/macosx
diff options
context:
space:
mode:
authorKenneth Perry <thothonegan@gmail.com>2013-12-05 11:19:08 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-12-05 11:21:51 +0200
commit2ff195aaa4238105a6a426e927efb8f81e94b9c5 (patch)
treea959ccee80f205ec3b4164f8370f4942d7ff1057 /src/modules/macosx
parent3d425a3315122eb2db8f826549b54a302d3c153a (diff)
bonjour-publish: Return ports in network byteorder
For DNS-SD (Bonjour) discovery, all ports should be set in network byteorder instead of host byteorder. Without this, all ports on little-endian systems (intel) are incorrect. Documentation: https://developer.apple.com/library/mac/documentation/networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html#//apple_ref/c/func/DNSServiceRegister
Diffstat (limited to 'src/modules/macosx')
-rw-r--r--src/modules/macosx/module-bonjour-publish.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/macosx/module-bonjour-publish.c b/src/modules/macosx/module-bonjour-publish.c
index f0b8b8248..ac8854523 100644
--- a/src/modules/macosx/module-bonjour-publish.c
+++ b/src/modules/macosx/module-bonjour-publish.c
@@ -183,13 +183,13 @@ static uint16_t compute_port(struct userdata *u) {
a.port > 0) {
pa_xfree(a.path_or_host);
- return a.port;
+ return htons(a.port);
}
pa_xfree(a.path_or_host);
}
- return PA_NATIVE_DEFAULT_PORT;
+ return htons(PA_NATIVE_DEFAULT_PORT);
}
static int publish_service(struct service *s) {