aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:02:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:02:13 +0000
commit318ce35b49218cb4761c56098a2e79bec330d214 (patch)
tree6eb0369981268c07ff9b815b3fdc0d689761bcbc
parent06d7695f0fbc570a73c435369dcd7781e36d97b2 (diff)
parent367fbcafb56896f8da3bf09581becc6161ae2563 (diff)
downloadmdnsresponder-android12-mainline-media-release.tar.gz
Change-Id: I0cf3475a7dc17a0c282760d41f9b2fb72e7b614e
-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, 52 insertions, 21 deletions
diff --git a/Android.bp b/Android.bp
index bcc742a..30cba16 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,36 @@
+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
new file mode 100644
index 0000000..d97975c
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,3 @@
+third_party {
+ license_type: NOTICE
+}
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index f458904..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,13 +0,0 @@
-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 bdc2ff6..fe287c2 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,5 @@
# 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 88f20eb..637c83c 100644
--- a/mDNSShared/dnssd_clientstub.c
+++ b/mDNSShared/dnssd_clientstub.c
@@ -260,16 +260,23 @@ static int more_bytes(dnssd_sock_t sd)
}
else
{
- // 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));
+ // 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));
if (fs == NULL) { syslog(LOG_WARNING, "dnssd_clientstub more_bytes: malloc failed"); return 0; }
}
- FD_SET(sd, fs);
+
+ #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
ret = select((int)sd+1, fs, (fd_set*)NULL, (fd_set*)NULL, &tv);
if (fs != &readfds) free(fs);
return (ret > 0);