// (which is handled below) and in that case it should be freed here.
if (r->resrec.name && cg && r->resrec.name != cg->name)
{
- debugf("ReleaseCacheRecord: freeing %##s (%s)", r->resrec.name->c, DNSTypeName(r->resrec.rrtype));
+ LogMsg("ReleaseCacheRecord: freeing %##s (%s)", r->resrec.name->c, DNSTypeName(r->resrec.rrtype));
mDNSPlatformMemFree((void *)r->resrec.name);
}
r->resrec.name = mDNSNULL;
if (r->resrec.AnonInfo)
{
- debugf("ReleaseCacheRecord: freeing AnonInfo for %##s (%s)", r->resrec.name->c, DNSTypeName(r->resrec.rrtype));
+ LogMsg("ReleaseCacheRecord: freeing AnonInfo for %##s (%s)", r->resrec.name->c, DNSTypeName(r->resrec.rrtype));
FreeAnonInfo((void *)r->resrec.AnonInfo);
}
r->resrec.AnonInfo = mDNSNULL;
CacheRecordRmv(m, rr);
m->rrcache_active--;
}
+ LogMsg("ReleaseCacheRecord rr [%p]", rr);
ReleaseCacheRecord(m, rr);
}
else // else, not expired; see if we need to query
m->rrcache_nextcheck[slot] = m->timenow + FutureTime;
while (*cp)
{
- debugf("m->NextCacheCheck %4d Slot %3d %##s", numchecked, slot, *cp ? (*cp)->name : (domainname*)"\x04NULL");
+ LogMsg("m->NextCacheCheck %4d Slot %3d %##s", numchecked, slot, *cp ? (*cp)->name : (domainname*)"\x04NULL");
numchecked++;
CheckCacheExpiration(m, slot, *cp);
if ((*cp)->members) cp=&(*cp)->next;
if (m->NextCacheCheck - m->rrcache_nextcheck[slot] > 0)
m->NextCacheCheck = m->rrcache_nextcheck[slot];
}
- debugf("m->NextCacheCheck %4d checked, next in %d", numchecked, m->NextCacheCheck - m->timenow);
+ LogMsg("m->NextCacheCheck %4d checked, next in %d", numchecked, m->NextCacheCheck - m->timenow);
}
if (m->timenow - m->NextScheduledSPS >= 0)
#define NO_WCF 1
#endif // APPLE_OSX_mDNSResponder
+#if defined TIZEN_EXT
+#include <systemd/sd-daemon.h>
+#endif
+
// User IDs 0-500 are system-wide processes, not actual users in the usual sense
// User IDs for real user accounts start at 501 and count up from there
#define SystemUID(X) ((X) <= 500)
mDNSu32 interfaceIndex = get_uint32(&request->msgptr, request->msgend);
mDNSInterfaceID InterfaceID;
- // Map kDNSServiceInterfaceIndexP2P to kDNSServiceInterfaceIndexAny with the
+ // Map kDNSServiceInterfaceIndexP2P to kDNSServiceInterfaceIndexAny with the
// kDNSServiceFlagsIncludeP2P flag set.
if (interfaceIndex == kDNSServiceInterfaceIndexP2P)
{
InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex);
- // The registration is scoped to a specific interface index, but the
+ // The registration is scoped to a specific interface index, but the
// interface is not currently in our list.
if (interfaceIndex && !InterfaceID)
{
request->terminate = regservice_termination_callback;
err = register_service_instance(request, &d);
-
+
#if TARGET_OS_EMBEDDED
++curr_num_regservices;
if (curr_num_regservices > max_num_regservices)
q->euid = req->uid;
// The policy is either based on pid or UUID. Pass a zero pid
// to the "core" if the UUID is valid. If we always pass the pid,
- // then the "core" needs to determine whether the uuid is valid
+ // then the "core" needs to determine whether the uuid is valid
// by examining all the 16 bytes at the time of the policy
// check and also when setting the delegate socket option. Also, it
// requires that we zero out the uuid wherever the question is
mDNSu32 interfaceIndex = get_uint32(&request->msgptr, request->msgend);
mDNSInterfaceID InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex);
- // The browse is scoped to a specific interface index, but the
+ // The browse is scoped to a specific interface index, but the
// interface is not currently in our list.
if (interfaceIndex && !InterfaceID)
{
(answer->RecordType == kDNSRecordTypePacketNegative) ? kDNSServiceErr_NoSuchRecord : kDNSServiceErr_NoError;
(void)m; // Unused
- LogOperation("%3d: DNSServiceResolve(%##s) %s interface %d: %s",
+ LogOperation("%3d: DNSServiceResolve(%##s) %s interface %d: %s",
req->sd, question->qname.c, AddRecord ? "ADD" : "RMV",
mDNSPlatformInterfaceIndexfromInterfaceID(m, answer->InterfaceID, mDNSfalse), RRDisplayString(m, answer));
InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex);
- // The operation is scoped to a specific interface index, but the
+ // The operation is scoped to a specific interface index, but the
// interface is not currently in our list.
if (interfaceIndex && !InterfaceID)
{
{
flags |= (kDNSServiceFlagsAutoTrigger | kDNSServiceFlagsIncludeAWDL);
LogInfo("handle_resolve_request: request promoted to use kDNSServiceFlagsAutoTrigger");
- }
+ }
#endif // APPLE_OSX_mDNSResponder && ENABLE_BLE_TRIGGERED_BONJOUR
request->flags = flags;
mDNSu32 interfaceIndex = get_uint32(&request->msgptr, request->msgend);
mDNSInterfaceID InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex);
- // The request is scoped to a specific interface index, but the
+ // The request is scoped to a specific interface index, but the
// interface is not currently in our list.
if (interfaceIndex && !InterfaceID)
{
LogMsg("handle_queryrecord_request: interfaceIndex %d is currently inactive requested by client[%d][%s]",
interfaceIndex, request->process_id, request->pid_name);
// If it's one of the specially defined inteface index values, just return an error.
- // Also, caller should return an error immediately if lo0 (index 1) is not configured
+ // Also, caller should return an error immediately if lo0 (index 1) is not configured
// into the current active interfaces. See background in Radar 21967160.
if (PreDefinedInterfaceIndex(interfaceIndex) || interfaceIndex == 1)
{
// we only deal with FQDNs. Hence, we cannot look at qname to figure out whether we should
// append search domains or not. So, we record that information in AppendSearchDomains.
//
- // We append search domains only for queries that are a single label. If overriden using command line
+ // We append search domains only for queries that are a single label. If overriden using command line
// argument "AlwaysAppendSearchDomains", then we do it for any query which is not fully qualified.
// For DNSSEC questions, append search domains only if kDNSServiceFlagsValidateOptional is set.
"%3d: DNSServiceReconfirmRecord(%s) interface %d initiated PID[%d](%s)" :
"%3d: DNSServiceReconfirmRecord(%s) interface %d failed PID[%d](%s) status %d",
request->sd, RRDisplayString(&mDNSStorage, &rr->resrec),
- mDNSPlatformInterfaceIndexfromInterfaceID(&mDNSStorage, rr->resrec.InterfaceID, mDNSfalse),
+ mDNSPlatformInterfaceIndexfromInterfaceID(&mDNSStorage, rr->resrec.InterfaceID, mDNSfalse),
request->process_id, request->pid_name, status);
freeL("AuthRecord/handle_reconfirm_request", rr);
}
InterfaceID = mDNSPlatformInterfaceIDfromInterfaceIndex(&mDNSStorage, interfaceIndex);
- // The request is scoped to a specific interface index, but the
+ // The request is scoped to a specific interface index, but the
// interface is not currently in our list.
if (interfaceIndex && !InterfaceID)
{
hostnameLen = strlen(hostname);
- LogOperation("%3d: DNSServiceGetAddrInfo(%X, %d, %d, %##s) START PID[%d](%s)",
+ LogOperation("%3d: DNSServiceGetAddrInfo(%X, %d, %d, %##s) START PID[%d](%s)",
request->sd, flags, interfaceIndex, request->u.addrinfo.protocol, d.c, request->process_id, request->pid_name);
if (request->u.addrinfo.protocol & kDNSServiceProtocol_IPv6)
}
else
{
+#if defined TIZEN_EXT
+ int fds = sd_listen_fds(1);
+ if (fds <= 0) {
+ my_perror("ERROR: no listen sockets");
+ goto error;
+ }
+ for (i = 0; i < fds; i++) {
+ if (sd_is_socket_unix(i + SD_LISTEN_FDS_START, SOCK_STREAM, 1, boundPath, 0) >= 0) {
+ listenfd = i + SD_LISTEN_FDS_START;
+ break;
+ }
+ }
+#else
listenfd = socket(AF_DNSSD, SOCK_STREAM, 0);
+#endif
if (!dnssd_SocketValid(listenfd))
{
my_perror("ERROR: socket(AF_DNSSD, SOCK_STREAM, 0); failed");
}
#else
{
+#ifndef TIZEN_EXT
mode_t mask = umask(0);
unlink(boundPath); // OK if this fails
laddr.sun_family = AF_LOCAL;
my_perror("ERROR: bind(listenfd, (struct sockaddr *) &laddr, sizeof(laddr)); failed");
goto error;
}
+#endif
}
#endif
if (dnssd_SocketValid(listenfd))
{
dnssd_close(listenfd);
-#if !defined(USE_TCP_LOOPBACK)
+#if !defined(USE_TCP_LOOPBACK) && !defined(TIZEN_EXT)
// Currently, we're unable to remove /var/run/mdnsd because we've changed to userid "nobody"
// to give up unnecessary privilege, but we need to be root to remove this Unix Domain Socket.
// It would be nice if we could find a solution to this problem
foundparent:;
}
}
-
+
LogMsgNoIdent("-------- NAT Traversals --------");
LogMsgNoIdent("ExtAddress %.4a Retry %d Interval %d",
&m->ExtAddress,
Name: mdnsresponder
Summary: DNS Service Discovery service with dns-sd library
Version: 878.70.2
-Release: 1
+Release: 2
Group: System/Network
License: Apache-2.0 or BSD-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: mdnsresponder.manifest
Source1002: libdns_sd.manifest
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libsystemd)
BuildRequires: bison
BuildRequires: flex
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%endif
cd mDNSPosix
+#You should check below before change make flags or Makefile
+mkdir -p objects/prod
+mkdir -p build/prod
+make os=tizen %{?_smp_mflags}
+
+cd ../Clients
make os=tizen %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
-#mkdir -p %{buildroot}%{_libdir}/systemd/system/
-#cp mdnsd.service %{buildroot}%{_libdir}/systemd/system/mdnsd.service
-#mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
-#ln -s mdnsd.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/mdnsd.service
-
-cp mdnsresponder-server.sh.in %{buildroot}%{_bindir}/mdnsresponder-server.sh
+cp Clients/build/dns-sd %{buildroot}%{_bindir}/dns-sd
mkdir -p %{buildroot}%{_includedir}/
%if "%{?_lib}" == "lib64"
%endif
cd mDNSPosix
make install os=tizen DESTDIR=%{buildroot} LIBDIR=/%{?_lib}
-ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.765
+strip --strip-unneeded %{buildroot}%{_libdir}/libdns_sd.so.%{version}
+ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so.878
ln -sf %{_libdir}/libdns_sd.so.%{version} %{buildroot}%{_libdir}/libdns_sd.so
-%post
-chmod 755 %{_bindir}/mdnsresponder-server.sh
-#systemctl daemon-reload
-
-#if [ $1 = 1 ]; then
-# systemctl enable mdnsd.service
-#fi
+cd ..
+mkdir -p %{buildroot}%{_unitdir}
+cp mdnsd.service %{buildroot}%{_unitdir}
+mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
+ln -s ../mdnsd.socket %{buildroot}%{_unitdir}/sockets.target.wants/
+cp mdnsd.socket %{buildroot}%{_unitdir}
-#systemctl restart mdnsd.service
-
-#%preun
-#if [ $1 = 0 ]; then
-# # unistall
-# systemctl stop mdnsd.service
-#fi
+%post
%post -n libdns_sd -p /sbin/ldconfig
%manifest mdnsresponder.manifest
%license LICENSE
%attr(755,root,root) %{_sbindir}/mdnsd
-%attr(-,root,root) %{_bindir}/mdnsresponder-server.sh
-#%attr(-,root,root) %{_libdir}/systemd/system/mdnsd.service
-#%attr(-,root,root) %{_libdir}/systemd/system/multi-user.target.wants/mdnsd.service
+%attr(-,root,root) %{_bindir}/dns-sd
+%{_unitdir}/mdnsd.service
+%{_unitdir}/mdnsd.socket
+%{_unitdir}/sockets.target.wants/mdnsd.socket
%files devel
%{_includedir}/*.h