diff options
author | Matt Hoosier <matt.hoosier@garmin.com> | 2020-02-05 16:04:49 -0600 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-02-06 07:20:03 -0800 |
commit | a44430fe9115f58aa72f211cb114a2e1f63bf4c5 (patch) | |
tree | 8e7fe886e280dfe9e92a554b474fa32924ec85ef /meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch | |
parent | fd2765bb16d6a895d3d6d4886add4b8b6a1baa20 (diff) | |
download | meta-openembedded-a44430fe9115f58aa72f211cb114a2e1f63bf4c5.tar.gz |
mdns: improve numerous aspects of Posix backend
Apple's default implementation of the Posix backend for mDNSResponder
has a number of weaknesses. Address several of them, most notably:
* Improve interface tracking, preventing confusion to mdns's state
machine. Prevents spurious removal/republication cycles whenever
network interfaces are added or removed.
* Support network interfaces whose indeces are great than 31. Indices
grow past that range surprisingly quickly, especially with multi-
homed, mobile, wifi, Bluetooth, VPN, VLANs, or other interfaces
present.
* Correctly handle edge cases during removal of a network interface.
The fixes are kept as a patch series for clarity.
Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch')
-rw-r--r-- | meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch b/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch new file mode 100644 index 0000000000..362d69768e --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/files/0009-Fix-possible-NULL-dereference.patch @@ -0,0 +1,45 @@ +From 38cff19781f81586926b02f0fd1cb36c040395e0 Mon Sep 17 00:00:00 2001 +From: Nate Karstens <nate.karstens@garmin.com> +Date: Thu, 10 Aug 2017 08:21:53 -0500 +Subject: [PATCH 09/11] Fix possible NULL dereference + +Fixes a possible NULL dereference if memory for +the PosixNetworkInterface could not be allocated. +Other logic seems to prevent dereferencing this +variable if NULL, but this instance seems to have +been overlooked. + +Upstream-Status: Submitted [dts@apple.com] + +Signed-off-by: Nate Karstens <nate.karstens@garmin.com> +--- + mDNSPosix/mDNSPosix.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c +index a8a57df..3243ed4 100644 +--- a/mDNSPosix/mDNSPosix.c ++++ b/mDNSPosix/mDNSPosix.c +@@ -951,12 +951,15 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct ifi_info *const ifi) + + // If interface is a direct link, address record will be marked as kDNSRecordTypeKnownUnique + // and skip the probe phase of the probe/announce packet sequence. +- intf->coreIntf.DirectLink = mDNSfalse; ++ if (err == 0) ++ { ++ intf->coreIntf.DirectLink = mDNSfalse; + #ifdef DIRECTLINK_INTERFACE_NAME +- if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0) +- intf->coreIntf.DirectLink = mDNStrue; ++ if (strcmp(intfName, STRINGIFY(DIRECTLINK_INTERFACE_NAME)) == 0) ++ intf->coreIntf.DirectLink = mDNStrue; + #endif +- intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue; ++ intf->coreIntf.SupportsUnicastMDNSResponse = mDNStrue; ++ } + + // The interface is all ready to go, let's register it with the mDNS core. + if (err == 0) +-- +2.17.1 + |