--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(dnsmasq C)
+
+SET(SRCS
+ src/arp.c
+ src/auth.c
+ src/blockdata.c
+ src/bpf.c
+ src/cache.c
+ src/conntrack.c
+ src/crypto.c
+ src/dbus.c
+ src/dhcp6.c
+ src/dhcp.c
+ src/dhcp-common.c
+ src/dnsmasq.c
+ src/dnssec.c
+ src/domain.c
++ src/dump.c
+ src/edns0.c
+ src/forward.c
+ src/helper.c
+ src/inotify.c
+ src/ipset.c
+ src/lease.c
+ src/log.c
+ src/loop.c
++ src/metrics.c
+ src/netlink.c
+ src/network.c
+ src/option.c
+ src/outpacket.c
+ src/poll.c
+ src/radv.c
+ src/rfc1035.c
+ src/rfc2131.c
+ src/rfc3315.c
+ src/rrfilter.c
+ src/slaac.c
+ src/tables.c
+ src/tftp.c
++ src/ubus.c
+ src/util.c
+)
+
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME ${PACKAGE})
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED dbus-1)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+#IF("${ARCH}" STREQUAL "arm")
+# ADD_DEFINITIONS("-D_MMICHECK_ARM_CODE_")
+#ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
--- /dev/null
- Version: 2.79
+Name: dnsmasq
+Summary: dnsmasq, DNS forwarder.
++Version: 2.82
+Release: 1
+Group: System/Network
+License: GPL-2.0+
+Source0: %{name}-%{version}.tar.gz
+Source1001: packaging/dnsmasq.manifest
+BuildRequires: cmake
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(libtzplatform-config)
+
+%description
+Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP server.
+It is designed to provide DNS and, optionally, DHCP, to a small network.
+It can serve the names of local machines that are not in the global DNS.
+The DHCP server integrates with the DNS server and allows machines with
+DHCP-allocated addresses to appear in DNS with names configured either
+in each host or in a central configuration file. Dnsmasq supports static
+and dynamic DHCP leases and BOOTP for network booting of diskless machines.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+make %{?jobs:-j%jobs}
+
+%post
+mkdir -p %{TZ_SYS_VAR}/lib/misc
+
+%install
+%make_install
+mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
+cp dbus/dnsmasq.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/dnsmasq.conf
+
+%files
+%manifest %{name}.manifest
+%{_bindir}/dnsmasq
+%license COPYING
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
- #define VERSION "2.79"
++#define VERSION "2.82"
+
#define FTABSIZ 150 /* max number of outstanding requests (default) */
#define MAX_PROCS 20 /* max no children for TCP requests */
#define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
if (lease)
{
- lease->addr6 = *addrp;
+ memcpy(&lease->addr6, addrp, sizeof(struct in6_addr));
lease->flags |= lease_type;
lease->iaid = 0;
+
+ daemon->metrics[METRIC_LEASES_ALLOCATED_6]++;
}
+ my_syslog(MS_DHCP | LOG_INFO, "lease6_allocate(): -");
return lease;
}
#endif