From: Kenneth Perry Date: Thu, 5 Dec 2013 09:19:08 +0000 (+0200) Subject: bonjour-publish: Return ports in network byteorder X-Git-Tag: v4.99.1~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ff195aaa4238105a6a426e927efb8f81e94b9c5;p=platform%2Fupstream%2Fpulseaudio.git 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 --- 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) {