dhcpcd: update to 10.0.2, orphan.

Orphaned at request of maintainer: https://github.com/void-linux/void-packages/pull/45761#issuecomment-1694052787
This commit is contained in:
triallax 2023-08-25 18:57:29 +01:00 committed by Leah Neukirchen
parent 92f297437b
commit 6fd4ffcfe4
2 changed files with 5 additions and 66 deletions

View File

@ -1,62 +0,0 @@
From 45e441ada6d3ea4355d623cf12d9a559a5c2afde Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Tue, 23 May 2023 22:14:57 +0100
Subject: [PATCH] Linux: Improve learning IPv6 address flags
Rather than matching addresses during netlink message processing,
extract the local, address and flag parts.
Once done, then match local and address to the address we are
looking for and if equal apply the flags.
Fixes #201 and maybe #149.
---
src/if-linux.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/if-linux.c b/src/if-linux.c
index f2f609ed..212ed5df 100644
--- a/src/if-linux.c
+++ b/src/if-linux.c
@@ -1996,7 +1996,8 @@ _if_addrflags6(__unused struct dhcpcd_ctx *ctx,
size_t len;
struct rtattr *rta;
struct ifaddrmsg *ifa;
- bool matches_addr = false;
+ struct in6_addr *local = NULL, *address = NULL;
+ uint32_t *flags = NULL;
ifa = NLMSG_DATA(nlm);
if (ifa->ifa_index != ia->ifa_ifindex || ifa->ifa_family != AF_INET6)
@@ -2007,17 +2008,26 @@ _if_addrflags6(__unused struct dhcpcd_ctx *ctx,
for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
switch (rta->rta_type) {
case IFA_ADDRESS:
- if (IN6_ARE_ADDR_EQUAL(&ia->ifa_addr, (struct in6_addr *)RTA_DATA(rta)))
- ia->ifa_found = matches_addr = true;
- else
- matches_addr = false;
+ address = (struct in6_addr *)RTA_DATA(rta);
+ break;
+ case IFA_LOCAL:
+ local = (struct in6_addr *)RTA_DATA(rta);
break;
case IFA_FLAGS:
- if (matches_addr)
- memcpy(&ia->ifa_flags, RTA_DATA(rta), sizeof(ia->ifa_flags));
+ flags = (uint32_t *)RTA_DATA(rta);
break;
}
}
+
+ if (local) {
+ if (IN6_ARE_ADDR_EQUAL(&ia->ifa_addr, local))
+ ia->ifa_found = true;
+ } else if (address) {
+ if (IN6_ARE_ADDR_EQUAL(&ia->ifa_addr, address))
+ ia->ifa_found = true;
+ }
+ if (flags && ia->ifa_found)
+ memcpy(&ia->ifa_flags, flags, sizeof(ia->ifa_flags));
return 0;
}

View File

@ -1,7 +1,7 @@
# Template file for 'dhcpcd'
pkgname=dhcpcd
version=10.0.1
revision=2
version=10.0.2
revision=1
build_style=configure
make_check_target=test
configure_args="
@ -10,11 +10,12 @@ configure_args="
hostmakedepends="ntp pkg-config"
makedepends="eudev-libudev-devel"
short_desc="RFC2131 compliant DHCP client"
maintainer="Cameron Nemo <cam@nohom.org>"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-2-Clause"
homepage="https://roy.marples.name/projects/dhcpcd"
changelog="https://github.com/NetworkConfiguration/dhcpcd/releases"
distfiles="https://github.com/NetworkConfiguration/dhcpcd/archive/refs/tags/v${version}.tar.gz"
checksum=2bd3480bc93e6bff530872b8bc80cbcaa821449f7bf6aaf202fa12fb8c2e6f55
checksum=608d01d3246671c0c8b0ac2ce4109c263779a7742bfdffee988c6c6c1d997042
lib32disabled=yes
conf_files=/etc/dhcpcd.conf