aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-08 16:01:20 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-08 16:01:20 +0000
commit0edc945c112edd451fa7d333ee9cbbb66bd62461 (patch)
tree5ea04458c04b76124b5bfa8738b0b8553afe62a4
parent4af2f234548b7f2083a8e03278bed4b99a021e53 (diff)
parent06d7695f0fbc570a73c435369dcd7781e36d97b2 (diff)
downloadmdnsresponder-aml_tz2_305400100.tar.gz
Change-Id: If65421f86fd4877fc8cddb815b7d2f6284c6ae4c
-rw-r--r--Android.bp33
-rw-r--r--METADATA3
-rw-r--r--NOTICE13
-rw-r--r--OWNERS1
-rw-r--r--mDNSShared/dnssd_clientstub.c23
5 files changed, 21 insertions, 52 deletions
diff --git a/Android.bp b/Android.bp
index 30cba16..bcc742a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,36 +1,3 @@
-package {
- default_applicable_licenses: ["external_mdnsresponder_license"],
-}
-
-// Added automatically by a large-scale-change that took the approach of
-// 'apply every license found to every target'. While this makes sure we respect
-// every license restriction, it may not be entirely correct.
-//
-// e.g. GPL in an MIT project might only apply to the contrib/ directory.
-//
-// Please consider splitting the single license below into multiple licenses,
-// taking care not to lose any license_kind information, and overriding the
-// default license using the 'licenses: [...]' property on targets as needed.
-//
-// For unused files, consider creating a 'fileGroup' with "//visibility:private"
-// to attach the license to, and including a comment whether the files may be
-// used in the current project.
-// See: http://go/android-license-faq
-license {
- name: "external_mdnsresponder_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-Apache-2.0",
- "SPDX-license-identifier-BSD",
- "SPDX-license-identifier-NCSA",
- "SPDX-license-identifier-OpenSSL",
- "legacy_notice",
- ],
- license_text: [
- "LICENSE",
- ],
-}
-
cc_defaults {
name: "mdnsresponder_default_cflags",
diff --git a/METADATA b/METADATA
deleted file mode 100644
index d97975c..0000000
--- a/METADATA
+++ /dev/null
@@ -1,3 +0,0 @@
-third_party {
- license_type: NOTICE
-}
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..f458904
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,13 @@
+The majority of the source code in the mDNSResponder project is licensed
+under the terms of the Apache License, Version 2.0, available from:
+ <http://www.apache.org/licenses/LICENSE-2.0>
+
+To accommodate license compatibility with the widest possible range
+of client code licenses, the shared library code, which is linked
+at runtime into the same address space as the client using it, is
+licensed under the terms of the "Three-Clause BSD License".
+
+The Linux Name Service Switch code, contributed by National ICT
+Australia Ltd (NICTA) is licensed under the terms of the NICTA Public
+Software Licence (which is substantially similar to the "Three-Clause
+BSD License", with some additional language pertaining to Australian law).
diff --git a/OWNERS b/OWNERS
index fe287c2..bdc2ff6 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,5 +1,4 @@
# Default code reviewers picked from top 3 or more developers.
# Please update this list if you find better candidates.
sadmac@google.com
-include platform/packages/modules/adb:/OWNERS
include platform/system/netd:/OWNERS
diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c
index 637c83c..88f20eb 100644
--- a/mDNSShared/dnssd_clientstub.c
+++ b/mDNSShared/dnssd_clientstub.c
@@ -260,23 +260,16 @@ static int more_bytes(dnssd_sock_t sd)
}
else
{
- // Compute the number of longs needed for storing "sd". Internally fd_set is stored
- // as an array of longs with one bit for each fd and hence we need to compute
- // the number of longs needed rather than the number of bytes. If "sd" is 64, we need
- // two longs and not just one.
- int nfdbits = sizeof (unsigned long) * 8;
- int nlongs = (sd/nfdbits) + 1;
- fs = (fd_set *)calloc(nlongs, sizeof(unsigned long));
+ // Compute the number of integers needed for storing "sd". Internally fd_set is stored
+ // as an array of ints with one bit for each fd and hence we need to compute
+ // the number of ints needed rather than the number of bytes. If "sd" is 32, we need
+ // two ints and not just one.
+ int nfdbits = sizeof (int) * 8;
+ int nints = (sd/nfdbits) + 1;
+ fs = (fd_set *)calloc(nints, sizeof(int));
if (fs == NULL) { syslog(LOG_WARNING, "dnssd_clientstub more_bytes: malloc failed"); return 0; }
}
-
- #ifdef __BIONIC__
- // The regular FD_SET() macro in Bionic is unaware of the above workaround,
- // and would abort on sd >= 1024. Use the unchecked __FD_SET() instead.
- __FD_SET(sd, fs);
- #else
- FD_SET(sd, fs);
- #endif
+ FD_SET(sd, fs);
ret = select((int)sd+1, fs, (fd_set*)NULL, (fd_set*)NULL, &tv);
if (fs != &readfds) free(fs);
return (ret > 0);