diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-21 14:51:09 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-21 14:51:09 +0000 |
commit | c0303046ffda5c7366cd448bf43e3ca937d6b8d5 (patch) | |
tree | 6eb0369981268c07ff9b815b3fdc0d689761bcbc | |
parent | 06d7695f0fbc570a73c435369dcd7781e36d97b2 (diff) | |
parent | 367fbcafb56896f8da3bf09581becc6161ae2563 (diff) | |
download | mdnsresponder-android12-mainline-cellbroadcast-release.tar.gz |
Snap for 7478067 from 367fbcafb56896f8da3bf09581becc6161ae2563 to mainline-cellbroadcast-releaseandroid-mainline-12.0.0_r86android-mainline-12.0.0_r71android-mainline-12.0.0_r7android-mainline-12.0.0_r60android-mainline-12.0.0_r43android-mainline-12.0.0_r24android-mainline-12.0.0_r116android-mainline-12.0.0_r101android12-mainline-cellbroadcast-release
Change-Id: I5bbcaa9f4091169e97ea4d8f6cd8c2cb66720eae
-rw-r--r-- | Android.bp | 33 | ||||
-rw-r--r-- | METADATA | 3 | ||||
-rw-r--r-- | NOTICE | 13 | ||||
-rw-r--r-- | OWNERS | 1 | ||||
-rw-r--r-- | mDNSShared/dnssd_clientstub.c | 23 |
5 files changed, 52 insertions, 21 deletions
@@ -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 +} @@ -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). @@ -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); |