diff options
Diffstat (limited to 'net-dns')
-rw-r--r-- | net-dns/Manifest.gz | bin | 7868 -> 7872 bytes | |||
-rw-r--r-- | net-dns/avahi/Manifest | 2 | ||||
-rw-r--r-- | net-dns/avahi/avahi-0.9_rc2.ebuild | 2 | ||||
-rw-r--r-- | net-dns/dnsmasq/Manifest | 2 | ||||
-rw-r--r-- | net-dns/dnsmasq/dnsmasq-2.90-r1.ebuild | 235 | ||||
-rw-r--r-- | net-dns/dnsmasq/files/dnsmasq-2.90-gcc15.patch | 376 |
6 files changed, 615 insertions, 2 deletions
diff --git a/net-dns/Manifest.gz b/net-dns/Manifest.gz Binary files differindex c65375f5a256..dd7ef16f0e32 100644 --- a/net-dns/Manifest.gz +++ b/net-dns/Manifest.gz diff --git a/net-dns/avahi/Manifest b/net-dns/avahi/Manifest index 6949b97e431a..c78363bd27b2 100644 --- a/net-dns/avahi/Manifest +++ b/net-dns/avahi/Manifest @@ -2,5 +2,5 @@ AUX autoipd-openrc.sh 700 BLAKE2B e71e5583db890f8ee1bbe9c03fc42285871089b2ea2d45 AUX autoipd.sh 1271 BLAKE2B 815c5776afff71489826eb8338535df1af6fbf02f3d42eedb6ebb69e5fff181e7252060818dd2dd67141a40c097ded8b7ac4210cb9929bab4b68ea99533bcf26 SHA512 0bff9ca7e32212aef0246db5baf10ee4f7e93a987b7c591b21ed9f116a1c662a84be9d784fc919205c1fecb5cd8421b81a0eb590c3cc066c6b1b9265b98f1ea3 AUX avahi-0.9_rc1-disable-avahi-ui-sharp.patch 1032 BLAKE2B c1dfaf13ccf195ce3b55f951dd3795bf0702676519b5ec0dc1a9cfcc3219a4898d4646fac87283f2ee8ea4e1a5eb88fa4bb77ec4909bcf154a0b04825902aaf8 SHA512 b74df43d15517c7be972e8731cd964b6566009c49559b1c7ccf60022c5ca181d3f49b2b478b08cfa366ac8d8124c95ade0c1c202076f877f5f87515c2f140ec7 DIST avahi-0.9_rc2.tar.gz 1076915 BLAKE2B 0aa72353b3ec9dc3e5c4a729ce81c1dcece5dd11d8a5736887aea63936417d515b91107da6e52f56dee870853d2f3943496da38a7e706e3e174ca84b3ce584c6 SHA512 29d6c9d075d0202b9da2cdf935fa04fad31ba95475ba5de086c9958d25caa405925bbd82ed439a024febf7880325e80c1a032a660284a7708c71dae9076f413b -EBUILD avahi-0.9_rc2.ebuild 4896 BLAKE2B cfbee9ef8a6db473c8f09ffa3037f7f3de68b22e8cea673076442d85c373b7f1acd71613fd6abaa9278b630cca84c36972249a2865ed128c56b464a75abefe72 SHA512 517f780ca9ed11ccaf0f40db5f48b466a34c733a4757464e81ae59d17496b73b77afa376e20eb744841d95cf5c29d2fe581081fa8ea1365e5aa6795dbcc216bf +EBUILD avahi-0.9_rc2.ebuild 4897 BLAKE2B f9021ed24142be52dd6958d5f7f5af34539e2ceefd87f430a160b0cf44100c8b1a6bded3c122082411e7f0aefe18c91c16615216bab662321671f6ee61d7a623 SHA512 f4f36ffd787723ba0510f3fa37f6c7f1573a5bc21a10ff494dbb6d38a1c6f29d7b0dc3cf1b0d73fe6f426382688ebfeb2ad9f1c5d2a8698703f1921979c8a53c MISC metadata.xml 781 BLAKE2B 3cd5c1650ef92da5b2ad262d5fbf1a762af497d6ace24ec7ab3e4759290aa6d552775741e637c3fcd795092374c1de18eb7c55a3ca47a7abc8b576336b50a46c SHA512 5d7b752ef084f7d442cc17e385e35fc1dd1c18eacc77093d3efa398b82c2d69ae4e4183639486ec603081c24fe74ea792aa441225998d2b6c6034ec301ca8831 diff --git a/net-dns/avahi/avahi-0.9_rc2.ebuild b/net-dns/avahi/avahi-0.9_rc2.ebuild index a337c8c61bb9..11afa36104ee 100644 --- a/net-dns/avahi/avahi-0.9_rc2.ebuild +++ b/net-dns/avahi/avahi-0.9_rc2.ebuild @@ -3,7 +3,7 @@ EAPI=8 -PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_COMPAT=( python3_{10..13} ) PYTHON_REQ_USE="gdbm" inherit autotools multilib-minimal python-single-r1 systemd diff --git a/net-dns/dnsmasq/Manifest b/net-dns/dnsmasq/Manifest index cd494b90c160..9b71475701e8 100644 --- a/net-dns/dnsmasq/Manifest +++ b/net-dns/dnsmasq/Manifest @@ -1,3 +1,4 @@ +AUX dnsmasq-2.90-gcc15.patch 16312 BLAKE2B 521f0179de49370c62b79f50d747f8680d2ee6f39bcb52ec26b50bb4f5c055e54e95c94737bca2d7da41fa5f6c74aee302e8cd4ddf37fc38def9b31872069579 SHA512 e980d560160b67d8e4aa7802feeb91a68d9bcdd2ea79a4c1b35e4542fa2215de2c9b4bcf4a20e2ec5a915cd358187dc079b7836346b2b470abf00d6ecc641583 AUX dnsmasq-init-dhcp-r3 721 BLAKE2B 94a7542419e2c931149edbd5a5167c7fcbe0233e48f3ed854dfe26090b596c4f2549e37d2680bfceb1c6d21f475012f81a2102bde85e7cd609979e555dbcfa3d SHA512 f7a64fb84a7877b5ec629f9ed92419799913b8f2f73594c510aedc083d72c5c1862da7e5aed4485102c3b89ca7217bcca88e7cdde82f5a65d4cd4bb19017c2fe AUX dnsmasq-init-r4 613 BLAKE2B 7ea82e879f8770c3f4b764a9044ef585cc6e91de793c56733a6af1d9e138ca6e55813ad1720a70d0a5a61f6815d094574ae04f9761b2e2846c6267c6a4e97780 SHA512 72ae659a62c61495dc575fa590cbf1352c4bd4f374a6e0a56fce9c641c163b882d8b8097d27605d102e47df49eb68c456baf7b11009a7bb7db98e99429bd80a6 AUX dnsmasq.confd-r1 170 BLAKE2B 84d5cdb15236c9e1c83fa53d0e401df90e86c6687cc88f9ebba3e2a0987cad2ccf9bb82ac7b1fcd77a81fa6058a3cd3276fb8a8a76e13983628e92be95b39af1 SHA512 9a401bfc408bf1638645c61b8ca734bea0a09ef79fb36648ec7ef21666257234254bbe6c73c82cc23aa1779ddcdda0e6baa2c041866f16dfb9c4e0ba9133eab8 @@ -6,5 +7,6 @@ AUX dnsmasq.service-r1 278 BLAKE2B 3bfe6a01efd5f8338c3bb134a061f8ecbef850293c4a8 DIST dnsmasq-2.89.tar.xz 562700 BLAKE2B d8be39697ce7d4e7beacf6d94a9ba1842fe0099f7ed7ebb243a7e6e5af8c83195e4723e60841705aee70a43510279be8484a9474191ddcf17eac1ff4edc5389f SHA512 4384ed5b673e10eaf6532e6eaeb5c0a6b817581433cc28c632bdcbadbfc050a0ab73bc5b73c98d708cd39515bb3f72168714b0aa5f16436cebdd18020648d428 DIST dnsmasq-2.90.tar.xz 570672 BLAKE2B e5a7a3f3b1457c94f508a17c32f1f14267ed61009058295e0202bee7a1798a3eb72c70e53c799f25fb6030b389c5eefc5e50845896b71b733c0fc302d730dff7 SHA512 e169de1892f935e219b0f49d90107f95cba42b40bca20bd3c973313c2cd4df58b929af6628cd988419051d81c3b4ccf8e9f816274df7d0840e79f5bf49602442 EBUILD dnsmasq-2.89-r1.ebuild 4837 BLAKE2B 74552b0fcbeb0bf2b0ae42154bdcb1ade2c9a06e2a86616869e2029c7851f0bb2bb5dc198799ff1f481975009529ab309cda5bfe03b5060e771f9202c81f408e SHA512 ad508eb7fec26485dd3c81f147aa32bae5191d0018e45a8ef1e59634f27df4845a7a7c5584c1b93161fa1985ce0b96e16b80d173d2a95d9757f8eab6ea95c569 +EBUILD dnsmasq-2.90-r1.ebuild 4999 BLAKE2B 4f3f3c35d6cbe331bc9b2fbbe92b08f752f37ea257542b8f8a8066a48e67a72aa103fe25cc85ec978d347f8017429f767eac246c6e0ceeb193998234b99d0217 SHA512 a62110a3107dc2cc49f5a169a2b7749e4312071bae699fb7c8d754ddc77645cd8dbac30649b01c82c2f75d4edddb6d07b98c9c47ff272145b282c26862edf197 EBUILD dnsmasq-2.90.ebuild 5060 BLAKE2B b16ee4a91ac2d642f84d45c18431924c573f207c363b133b242fd1a9692b322ec738cfe2f7155efc48648e6176f09d3a980e335ecce99d324d2238b77945d7f4 SHA512 76d9a2deaee75c32dc1e8e9db562ca3be81b10e2274150498e6c03d2bb61c513401c2ed502fdee815d65a574bd2e85c24849a70a63fcd9efe7822f0737bb7935 MISC metadata.xml 1449 BLAKE2B 532b630e5c03652df74dec95bbb6c1c03b0d8a8fbc78ed1b2d40f47fdfbc20ce21172259f630acb5d14eb32b849d1d5b34482ffe77d4b5eee64051e839f17607 SHA512 e58549ceaf7a252f0b8b4c3a678cbc57bca66bf749bffbf8ec5544e79a380af695e3412c8d59d941bd08ed6cb95ab27bc2a13fbc46a4f5368d9e209e3e33bc99 diff --git a/net-dns/dnsmasq/dnsmasq-2.90-r1.ebuild b/net-dns/dnsmasq/dnsmasq-2.90-r1.ebuild new file mode 100644 index 000000000000..85c1b1f6d648 --- /dev/null +++ b/net-dns/dnsmasq/dnsmasq-2.90-r1.ebuild @@ -0,0 +1,235 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit flag-o-matic toolchain-funcs lua-single systemd + +DESCRIPTION="Small forwarding DNS server" +HOMEPAGE="https://thekelleys.org.uk/dnsmasq/doc.html" +SRC_URI="https://thekelleys.org.uk/dnsmasq/${P}.tar.xz" + +LICENSE="|| ( GPL-2 GPL-3 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" +IUSE+=" +loop +inotify ipv6 lua nettlehash nls script selinux static tftp" + +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) + +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig + nls? ( sys-devel/gettext ) +" + +COMMON_DEPEND=" + acct-group/dnsmasq + acct-user/dnsmasq + dbus? ( sys-apps/dbus:= ) + idn? ( + !libidn2? ( net-dns/libidn:0= ) + libidn2? ( >=net-dns/libidn2-2.0:= ) + ) + lua? ( ${LUA_DEPS} ) + conntrack? ( net-libs/libnetfilter_conntrack:= ) + nls? ( sys-devel/gettext ) +" + +DEPEND="${COMMON_DEPEND} + dnssec? ( + dev-libs/nettle:=[gmp] + static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) + ) + nettlehash? ( + static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + dnssec? ( + !static? ( >=dev-libs/nettle-3.4:=[gmp] ) + ) + nettlehash? ( + !static? ( dev-libs/nettle:=[gmp] ) + ) + selinux? ( sec-policy/selinux-dnsmasq ) +" + +REQUIRED_USE=" + dhcp-tools? ( dhcp ) + dnssec? ( !nettlehash ) + lua? ( + script + ${LUA_REQUIRED_USE} + ) + libidn2? ( idn ) +" + +PATCHES=( + "${FILESDIR}/dnsmasq-2.90-gcc15.patch" +) + +use_have() { + local no_only + if [[ ${1} == '-n' ]]; then + no_only=1 + shift + fi + local useflag="${1}" + shift + + local uword="${1:-${useflag}}" + shift + + while [[ ${uword} ]]; do + uword="${uword^^}" + + if ! use "${useflag}"; then + printf -- " -DNO_%s" "${uword}" + elif [[ -z "${no_only}" ]]; then + printf -- " -DHAVE_%s" "${uword}" + fi + uword="${1}" + shift + done +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +pkg_pretend() { + if use static; then + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ + "in this case the static USE flag does nothing." + fi +} + +src_prepare() { + default + + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ + dnsmasq.conf.example || die +} + +src_configure() { + COPTS=( + $(use_have -n auth-dns auth) + $(use_have conntrack) + $(use_have dbus) + $(use libidn2 || use_have idn) + $(use_have libidn2) + $(use_have -n inotify) + $(use_have -n dhcp dhcp dhcp6) + $(use_have -n ipv6 ipv6 dhcp6) + $(use_have -n id id) + $(use_have -n loop) + $(use_have lua luascript) + $(use_have -n script) + $(use_have -n tftp) + $(use_have dnssec) + $(use_have nettlehash) + $(use_have static dnssec_static) + $(use_have -n dumpfile) + ) +} + +src_compile() { + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + COPTS="${COPTS[*]}" \ + CONFFILE="/etc/${PN}.conf" \ + all$(use nls && printf -- "-i18n\n") + + use dhcp-tools && emake -C contrib/lease-tools \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + all +} + +src_install() { + local lingua puid + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + COPTS="${COPTS[*]}" \ + CONFFILE="/etc/${PN}.conf" \ + DESTDIR="${ED}" \ + install$(use nls && printf -- "-i18n\n") + + for lingua in "${DM_LINGUAS[@]}"; do + has ${lingua} ${LINGUAS-${lingua}} \ + || rm -rf "${ED}"/usr/share/locale/${lingua} + done + [[ -d "${D}"/usr/share/locale/ ]] && \ + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ + + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example + dodoc -r logo + + docinto html/ + dodoc *.html + + newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} + + insinto /etc/logrotate.d + newins "${FILESDIR}"/dnsmasq.logrotate ${PN} + + insinto /etc + newins dnsmasq.conf.example dnsmasq.conf + + insinto /usr/share/dnsmasq + doins trust-anchors.conf + + if use dhcp; then + keepdir /var/lib/misc + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} + fi + if use dbus; then + insinto /etc/dbus-1/system.d + doins dbus/dnsmasq.conf + + docinto + dodoc dbus/DBus-interface + fi + + if use dhcp-tools; then + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 + if use ipv6; then + dosbin contrib/lease-tools/dhcp_release6 + doman contrib/lease-tools/dhcp_release6.1 + fi + fi + + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service +} + +pkg_preinst() { + [[ -f /var/lib/misc/dnsmasq.leases ]] && \ + cp /var/lib/misc/dnsmasq.leases "${T}" +} + +pkg_postinst() { + [[ -f "${T}"/dnsmasq.leases ]] && \ + cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases +} diff --git a/net-dns/dnsmasq/files/dnsmasq-2.90-gcc15.patch b/net-dns/dnsmasq/files/dnsmasq-2.90-gcc15.patch new file mode 100644 index 000000000000..a0efca3ab687 --- /dev/null +++ b/net-dns/dnsmasq/files/dnsmasq-2.90-gcc15.patch @@ -0,0 +1,376 @@ +https://bugs.gentoo.org/943671 + +From da2cc84854a01dd08a8bb4161428be20b83a5ec7 Mon Sep 17 00:00:00 2001 +From: gen2dev <gen2dev@qsr.us> +Date: Sun, 1 Dec 2024 22:53:16 +0000 +Subject: [PATCH] Fix GCC-15, C23 compatibility and + -Wincompatible-pointer-types errors + +A bug in gentoo linux https://bugs.gentoo.org/945183 reported that dnsmasq 2.90 fails to compile with GCC 15. + +The issue is that while previous versions of GCC defaulted to the C17 standard and C23 could be selected with +"-std=c23" or "-std=gnu23", GCC 15 defaults to C23. In C23 incompatible pointer types are an error instead of +a warning, so the "int (*callback)()" incomplete prototypes cause errors. + +For example, compiling dnsmasq 2.90 with gcc 14.2.1 and "-std=gnu23" fails with errors such as: + lease.c: In function `lease_find_interfaces': + lease.c:467:34: warning: passing argument 3 of `iface_enumerate' from incompatible pointer type [-Wincompatible-pointer-types[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types]] + 467 | iface_enumerate(AF_INET, &now, find_interface_v4); + | ^~~~~~~~~~~~~~~~~ + | | + | int (*)(struct in_addr, int, char *, struct in_addr, struct in_addr, void *) + In file included from lease.c:17: + dnsmasq.h:1662:50: note: expected `int (*)(void)' but argument is of type `int (*)(struct in_addr, int, char *, struct in_addr, struct in_addr, void *)' + 1662 | int iface_enumerate(int family, void *parm, int (callback)()); + | ~~~~~^~~~~~~~~~~ + +This patch uses a typedef'ed union of pointer types to get type checking of the pointers. If that's too complicated, +another way might be to use (void *) casts to disable type checking. + +Also, some of the IPv6 callbacks had "int preferred, int valid" and some had +"unsigned int preferred, unsigned int valid". This patch changes them all to "unsigned int" +so they're the same and to avoid casting "u32" to "int", eg: + u32 preferred = 0xffffffff; + callback(..., (int)preferred, ...) +Even if those cast values aren't used in the callback, casting u32 to "int" feels bad, especially if "int" is 32 bits. +--- + src/arp.c | 2 +- + src/bpf.c | 14 +++++++------- + src/dhcp.c | 4 ++-- + src/dhcp6.c | 8 ++++---- + src/dnsmasq.h | 8 +++++++- + src/lease.c | 6 +++--- + src/netlink.c | 12 ++++++------ + src/network.c | 6 +++--- + src/radv.c | 14 +++++++------- + 9 files changed, 40 insertions(+), 34 deletions(-) + +diff --git a/src/arp.c b/src/arp.c +index 0a5a9bf..6ff1f01 100644 +--- a/src/arp.c ++++ b/src/arp.c +@@ -152,7 +152,7 @@ int find_mac(union mysockaddr *addr, unsigned char *mac, int lazy, time_t now) + if (arp->status != ARP_EMPTY) + arp->status = ARP_MARK; + +- iface_enumerate(AF_UNSPEC, NULL, filter_mac); ++ iface_enumerate(AF_UNSPEC, NULL, (callback_t){.af_unspec=filter_mac}); + + /* Remove all unconfirmed entries to old list. */ + for (arp = arps, up = &arps; arp; arp = tmp) +diff --git a/src/bpf.c b/src/bpf.c +index 62b589c..82d0125 100644 +--- a/src/bpf.c ++++ b/src/bpf.c +@@ -47,7 +47,7 @@ static union all_addr del_addr; + + #if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) + +-int arp_enumerate(void *parm, int (*callback)()) ++int arp_enumerate(void *parm, callback_t callback) + { + int mib[6]; + size_t needed; +@@ -91,7 +91,7 @@ int arp_enumerate(void *parm, int (*callback)()) + rtm = (struct rt_msghdr *)next; + sin2 = (struct sockaddr_inarp *)(rtm + 1); + sdl = (struct sockaddr_dl *)((char *)sin2 + SA_SIZE(sin2)); +- if (!(*callback)(AF_INET, &sin2->sin_addr, LLADDR(sdl), sdl->sdl_alen, parm)) ++ if (!callback.af_unspec(AF_INET, &sin2->sin_addr, LLADDR(sdl), sdl->sdl_alen, parm)) + return 0; + } + +@@ -107,7 +107,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + + if (family == AF_UNSPEC) + #if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) +- return arp_enumerate(parm, callback); ++ return arp_enumerate(parm, callback.af_unspec); + #else + return 0; /* need code for Solaris and MacOS*/ + #endif +@@ -147,7 +147,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + broadcast = ((struct sockaddr_in *) addrs->ifa_broadaddr)->sin_addr; + else + broadcast.s_addr = 0; +- if (!((*callback)(addr, iface_index, NULL, netmask, broadcast, parm))) ++ if (!callback.af_inet(addr, iface_index, NULL, netmask, broadcast, parm)) + goto err; + } + else if (family == AF_INET6) +@@ -212,8 +212,8 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + addr->s6_addr[3] = 0; + } + +- if (!((*callback)(addr, prefix, scope_id, iface_index, flags, +- (int) preferred, (int)valid, parm))) ++ if (!callback.af_inet6(addr, prefix, scope_id, iface_index, flags, ++ (unsigned int) preferred, (unsigned int)valid, parm)) + goto err; + } + +@@ -223,7 +223,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + /* Assume ethernet again here */ + struct sockaddr_dl *sdl = (struct sockaddr_dl *) addrs->ifa_addr; + if (sdl->sdl_alen != 0 && +- !((*callback)(iface_index, ARPHRD_ETHER, LLADDR(sdl), sdl->sdl_alen, parm))) ++ !callback.af_local(iface_index, ARPHRD_ETHER, LLADDR(sdl), sdl->sdl_alen, parm)) + goto err; + } + #endif +diff --git a/src/dhcp.c b/src/dhcp.c +index 2603c76..009c2a0 100644 +--- a/src/dhcp.c ++++ b/src/dhcp.c +@@ -317,7 +317,7 @@ void dhcp_packet(time_t now, int pxe_fd) + match.ind = iface_index; + + if (!daemon->if_addrs || +- !iface_enumerate(AF_INET, &match, check_listen_addrs) || ++ !iface_enumerate(AF_INET, &match, (callback_t){.af_inet=check_listen_addrs}) || + !match.matched) + return; + +@@ -330,7 +330,7 @@ void dhcp_packet(time_t now, int pxe_fd) + if (relay_upstream4(iface_index, mess, (size_t)sz)) + return; + +- if (!iface_enumerate(AF_INET, &parm, complete_context)) ++ if (!iface_enumerate(AF_INET, &parm, (callback_t){.af_inet=complete_context})) + return; + + /* Check for a relay again after iface_enumerate/complete_context has had +diff --git a/src/dhcp6.c b/src/dhcp6.c +index c9d54dc..303d33c 100644 +--- a/src/dhcp6.c ++++ b/src/dhcp6.c +@@ -239,7 +239,7 @@ void dhcp6_packet(time_t now) + relay_upstream6(if_index, (size_t)sz, &from.sin6_addr, from.sin6_scope_id, now)) + return; + +- if (!iface_enumerate(AF_INET6, &parm, complete_context6)) ++ if (!iface_enumerate(AF_INET6, &parm, (callback_t){.af_inet6=complete_context6})) + return; + + /* Check for a relay again after iface_enumerate/complete_context has had +@@ -617,7 +617,7 @@ void make_duid(time_t now) + newnow = now - 946684800; + #endif + +- iface_enumerate(AF_LOCAL, &newnow, make_duid1); ++ iface_enumerate(AF_LOCAL, &newnow, (callback_t){.af_local=make_duid1}); + + if(!daemon->duid) + die("Cannot create DHCPv6 server DUID: %s", NULL, EC_MISC); +@@ -667,7 +667,7 @@ struct cparam { + + static int construct_worker(struct in6_addr *local, int prefix, + int scope, int if_index, int flags, +- int preferred, int valid, void *vparam) ++ unsigned int preferred, unsigned int valid, void *vparam) + { + char ifrn_name[IFNAMSIZ]; + struct in6_addr start6, end6; +@@ -801,7 +801,7 @@ void dhcp_construct_contexts(time_t now) + if (context->flags & CONTEXT_CONSTRUCTED) + context->flags |= CONTEXT_GC; + +- iface_enumerate(AF_INET6, ¶m, construct_worker); ++ iface_enumerate(AF_INET6, ¶m, (callback_t){.af_inet6=construct_worker}); + + for (up = &daemon->dhcp6, context = daemon->dhcp6; context; context = tmp) + { +diff --git a/src/dnsmasq.h b/src/dnsmasq.h +index a9019ee..abb06c8 100644 +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -1662,7 +1662,13 @@ void route_sock(void); + #endif + + /* bpf.c or netlink.c */ +-int iface_enumerate(int family, void *parm, int (callback)()); ++typedef union { ++ int (*af_unspec)(int family, char *addrp, char *mac, size_t maclen, void *parmv); ++ int (*af_inet)(struct in_addr local, int if_index, char *label, struct in_addr netmask, struct in_addr broadcast, void *vparam); ++ int (*af_inet6)(struct in6_addr *local, int prefix, int scope, int if_index, int flags, unsigned int preferred, unsigned int valid, void *vparam); ++ int (*af_local)(int index, unsigned int type, char *mac, size_t maclen, void *parm); ++} callback_t; ++int iface_enumerate(int family, void *parm, callback_t callback); + + /* dbus.c */ + #ifdef HAVE_DBUS +diff --git a/src/lease.c b/src/lease.c +index a133021..06a6ae4 100644 +--- a/src/lease.c ++++ b/src/lease.c +@@ -411,7 +411,7 @@ static int find_interface_v4(struct in_addr local, int if_index, char *label, + #ifdef HAVE_DHCP6 + static int find_interface_v6(struct in6_addr *local, int prefix, + int scope, int if_index, int flags, +- int preferred, int valid, void *vparam) ++ unsigned int preferred, unsigned int valid, void *vparam) + { + struct dhcp_lease *lease; + +@@ -468,9 +468,9 @@ void lease_find_interfaces(time_t now) + for (lease = leases; lease; lease = lease->next) + lease->new_prefixlen = lease->new_interface = 0; + +- iface_enumerate(AF_INET, &now, find_interface_v4); ++ iface_enumerate(AF_INET, &now, (callback_t){.af_inet=find_interface_v4}); + #ifdef HAVE_DHCP6 +- iface_enumerate(AF_INET6, &now, find_interface_v6); ++ iface_enumerate(AF_INET6, &now, (callback_t){.af_inet6=find_interface_v6}); + #endif + + for (lease = leases; lease; lease = lease->next) +diff --git a/src/netlink.c b/src/netlink.c +index ef4b5fe..c706339 100644 +--- a/src/netlink.c ++++ b/src/netlink.c +@@ -151,7 +151,7 @@ static ssize_t netlink_recv(int flags) + family = AF_LOCAL finds MAC addresses. + returns 0 on failure, 1 on success, -1 when restart is required + */ +-int iface_enumerate(int family, void *parm, int (*callback)()) ++int iface_enumerate(int family, void *parm, callback_t callback) + { + struct sockaddr_nl addr; + struct nlmsghdr *h; +@@ -247,7 +247,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + } + + if (addr.s_addr && callback_ok) +- if (!((*callback)(addr, ifa->ifa_index, label, netmask, broadcast, parm))) ++ if (!callback.af_inet(addr, ifa->ifa_index, label, netmask, broadcast, parm)) + callback_ok = 0; + } + else if (ifa->ifa_family == AF_INET6) +@@ -288,9 +288,9 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + flags |= IFACE_PERMANENT; + + if (addrp && callback_ok) +- if (!((*callback)(addrp, (int)(ifa->ifa_prefixlen), (int)(ifa->ifa_scope), ++ if (!callback.af_inet6(addrp, (int)(ifa->ifa_prefixlen), (int)(ifa->ifa_scope), + (int)(ifa->ifa_index), flags, +- (int) preferred, (int)valid, parm))) ++ (unsigned int)preferred, (unsigned int)valid, parm)) + callback_ok = 0; + } + } +@@ -318,7 +318,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + + if (!(neigh->ndm_state & (NUD_NOARP | NUD_INCOMPLETE | NUD_FAILED)) && + inaddr && mac && callback_ok) +- if (!((*callback)(neigh->ndm_family, inaddr, mac, maclen, parm))) ++ if (!callback.af_unspec(neigh->ndm_family, inaddr, mac, maclen, parm)) + callback_ok = 0; + } + #ifdef HAVE_DHCP6 +@@ -342,7 +342,7 @@ int iface_enumerate(int family, void *parm, int (*callback)()) + } + + if (mac && callback_ok && !((link->ifi_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) && +- !((*callback)((int)link->ifi_index, (unsigned int)link->ifi_type, mac, maclen, parm))) ++ !callback.af_local((int)link->ifi_index, (unsigned int)link->ifi_type, mac, maclen, parm)) + callback_ok = 0; + } + #endif +diff --git a/src/network.c b/src/network.c +index 0e93c4d..36d9262 100644 +--- a/src/network.c ++++ b/src/network.c +@@ -596,7 +596,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label, + + static int iface_allowed_v6(struct in6_addr *local, int prefix, + int scope, int if_index, int flags, +- int preferred, int valid, void *vparam) ++ unsigned int preferred, unsigned int valid, void *vparam) + { + union mysockaddr addr; + struct in_addr netmask; /* dummy */ +@@ -833,12 +833,12 @@ again: + + param.spare = spare; + +- ret = iface_enumerate(AF_INET6, ¶m, iface_allowed_v6); ++ ret = iface_enumerate(AF_INET6, ¶m, (callback_t){.af_inet6=iface_allowed_v6}); + if (ret < 0) + goto again; + else if (ret) + { +- ret = iface_enumerate(AF_INET, ¶m, iface_allowed_v4); ++ ret = iface_enumerate(AF_INET, ¶m, (callback_t){.af_inet=iface_allowed_v4}); + if (ret < 0) + goto again; + } +diff --git a/src/radv.c b/src/radv.c +index d2d3390..f39716c 100644 +--- a/src/radv.c ++++ b/src/radv.c +@@ -58,7 +58,7 @@ static int add_prefixes(struct in6_addr *local, int prefix, + unsigned int preferred, unsigned int valid, void *vparam); + static int iface_search(struct in6_addr *local, int prefix, + int scope, int if_index, int flags, +- int prefered, int valid, void *vparam); ++ unsigned int prefered, unsigned int valid, void *vparam); + static int add_lla(int index, unsigned int type, char *mac, size_t maclen, void *parm); + static void new_timeout(struct dhcp_context *context, char *iface_name, time_t now); + static unsigned int calc_lifetime(struct ra_interface *ra); +@@ -307,7 +307,7 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad + + /* If no link-local address then we can't advertise since source address of + advertisement must be link local address: RFC 4861 para 6.1.2. */ +- if (!iface_enumerate(AF_INET6, &parm, add_prefixes) || ++ if (!iface_enumerate(AF_INET6, &parm, (callback_t){.af_inet6=add_prefixes}) || + parm.link_pref_time == 0) + return; + +@@ -449,7 +449,7 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad + put_opt6_long(mtu); + } + +- iface_enumerate(AF_LOCAL, &send_iface, add_lla); ++ iface_enumerate(AF_LOCAL, &send_iface, (callback_t){.af_local=add_lla}); + + /* RDNSS, RFC 6106, use relevant DHCP6 options */ + (void)option_filter(parm.tags, NULL, daemon->dhcp_opts6); +@@ -823,7 +823,7 @@ time_t periodic_ra(time_t now) + param.iface = context->if_index; + new_timeout(context, param.name, now); + } +- else if (iface_enumerate(AF_INET6, ¶m, iface_search)) ++ else if (iface_enumerate(AF_INET6, ¶m, (callback_t){.af_inet6=iface_search})) + /* There's a context overdue, but we can't find an interface + associated with it, because it's for a subnet we dont + have an interface on. Probably we're doing DHCP on +@@ -856,7 +856,7 @@ time_t periodic_ra(time_t now) + aparam.iface = param.iface; + aparam.alias_ifs = NULL; + aparam.num_alias_ifs = 0; +- iface_enumerate(AF_LOCAL, &aparam, send_ra_to_aliases); ++ iface_enumerate(AF_LOCAL, &aparam, (callback_t){.af_local=send_ra_to_aliases}); + my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => %d alias(es)", + param.name, daemon->addrbuff, aparam.num_alias_ifs); + +@@ -871,7 +871,7 @@ time_t periodic_ra(time_t now) + those. */ + aparam.max_alias_ifs = aparam.num_alias_ifs; + aparam.num_alias_ifs = 0; +- iface_enumerate(AF_LOCAL, &aparam, send_ra_to_aliases); ++ iface_enumerate(AF_LOCAL, &aparam, (callback_t){.af_local=send_ra_to_aliases}); + for (; aparam.num_alias_ifs; aparam.num_alias_ifs--) + { + my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => i/f %d", +@@ -920,7 +920,7 @@ static int send_ra_to_aliases(int index, unsigned int type, char *mac, size_t ma + + static int iface_search(struct in6_addr *local, int prefix, + int scope, int if_index, int flags, +- int preferred, int valid, void *vparam) ++ unsigned int preferred, unsigned int valid, void *vparam) + { + struct search_param *param = vparam; + struct dhcp_context *context; +-- +2.20.1 + |