From aaab68d2c50eff828904275279371255e6b82676 Mon Sep 17 00:00:00 2001 From: Niklas Hofmann Date: Sat, 9 Aug 2014 11:46:10 +0200 Subject: [PATCH] fixed port byte order --- src/discovery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discovery.c b/src/discovery.c index dd35bebd..3c26705e 100644 --- a/src/discovery.c +++ b/src/discovery.c @@ -281,7 +281,7 @@ static void discovery_resolve_callback(AvahiSServiceResolver *resolver, AvahiIfI case AVAHI_PROTO_INET: { naddress.in.sin_family = AF_INET; - naddress.in.sin_port = port; + naddress.in.sin_port = htons(port); naddress.in.sin_addr.s_addr = address->data.ipv4.address; } break; @@ -289,7 +289,7 @@ static void discovery_resolve_callback(AvahiSServiceResolver *resolver, AvahiIfI case AVAHI_PROTO_INET6: { naddress.in6.sin6_family = AF_INET6; - naddress.in6.sin6_port = port; + naddress.in6.sin6_port = htons(port); memcpy(naddress.in6.sin6_addr.s6_addr, address->data.ipv6.address, sizeof(naddress.in6.sin6_addr.s6_addr)); } break; -- 2.39.5