]> git.meshlink.io Git - meshlink/commitdiff
fixed port byte order
authorNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 09:46:10 +0000 (11:46 +0200)
committerNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 09:46:10 +0000 (11:46 +0200)
src/discovery.c

index dd35bebdf6a73332e6d5f2e05a7dd219f30b99f0..3c26705efeeeadbe2394a4859a7ccd0480d7c808 100644 (file)
@@ -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;