diff options
Diffstat (limited to 'meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch')
-rw-r--r-- | meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch b/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch new file mode 100644 index 0000000000..21ba318499 --- /dev/null +++ b/meta-networking/recipes-protocols/mdns/files/0002-Create-subroutine-for-tearing-down-an-interface.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From a2148df99ddcd122247f95c4cbcce5c4118581a1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nate Karstens <nate.karstens@garmin.com> | ||
3 | Date: Wed, 28 Jun 2017 17:30:00 -0500 | ||
4 | Subject: [PATCH 02/11] Create subroutine for tearing down an interface | ||
5 | |||
6 | Creates a subroutine for tearing down an interface. | ||
7 | |||
8 | Upstream-Status: Submitted [dts@apple.com] | ||
9 | |||
10 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> | ||
11 | --- | ||
12 | mDNSPosix/mDNSPosix.c | 22 ++++++++++++++++------ | ||
13 | 1 file changed, 16 insertions(+), 6 deletions(-) | ||
14 | |||
15 | diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c | ||
16 | index ffc9696..5e5b2cd 100644 | ||
17 | --- a/mDNSPosix/mDNSPosix.c | ||
18 | +++ b/mDNSPosix/mDNSPosix.c | ||
19 | @@ -591,6 +591,19 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf) | ||
20 | gRecentInterfaces = intf; | ||
21 | } | ||
22 | |||
23 | +mDNSlocal void TearDownInterface(mDNS *const m, PosixNetworkInterface *intf) | ||
24 | +{ | ||
25 | + mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation); | ||
26 | + if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName); | ||
27 | + FreePosixNetworkInterface(intf); | ||
28 | + | ||
29 | + num_registered_interfaces--; | ||
30 | + if (num_registered_interfaces == 0) { | ||
31 | + num_pkts_accepted = 0; | ||
32 | + num_pkts_rejected = 0; | ||
33 | + } | ||
34 | +} | ||
35 | + | ||
36 | // Grab the first interface, deregister it, free it, and repeat until done. | ||
37 | mDNSlocal void ClearInterfaceList(mDNS *const m) | ||
38 | { | ||
39 | @@ -599,13 +612,10 @@ mDNSlocal void ClearInterfaceList(mDNS *const m) | ||
40 | while (m->HostInterfaces) | ||
41 | { | ||
42 | PosixNetworkInterface *intf = (PosixNetworkInterface*)(m->HostInterfaces); | ||
43 | - mDNS_DeregisterInterface(m, &intf->coreIntf, NormalActivation); | ||
44 | - if (gMDNSPlatformPosixVerboseLevel > 0) fprintf(stderr, "Deregistered interface %s\n", intf->intfName); | ||
45 | - FreePosixNetworkInterface(intf); | ||
46 | + TearDownInterface(m, intf); | ||
47 | } | ||
48 | - num_registered_interfaces = 0; | ||
49 | - num_pkts_accepted = 0; | ||
50 | - num_pkts_rejected = 0; | ||
51 | + | ||
52 | + assert(num_registered_interfaces == 0); | ||
53 | } | ||
54 | |||
55 | // Sets up a send/receive socket. | ||
56 | -- | ||
57 | 2.17.1 | ||
58 | |||