Github messages for voidlinux
 help / color / mirror / Atom feed
From: lemmi <lemmi@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] dhcpcd: fix dhcpv6-pd for pppoe
Date: Sat, 24 Jun 2023 07:43:04 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44601@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

There is a new pull request by lemmi against master on the void-packages repository

https://github.com/lemmi/void-packages dhcpcd
https://github.com/void-linux/void-packages/pull/44601

dhcpcd: fix dhcpv6-pd for pppoe
<!-- Uncomment relevant sections and delete options which are not applicable -->

Adds https://github.com/NetworkConfiguration/dhcpcd/commit/1a70f1b51c453c66993fab8172e57924059bd34b to solve https://github.com/NetworkConfiguration/dhcpcd/issues/149


#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44601.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dhcpcd-44601.patch --]
[-- Type: text/x-diff, Size: 3126 bytes --]

From 16cc9a0d892e5f972cc595c328633165be13e87a Mon Sep 17 00:00:00 2001
From: lemmi <lemmi@nerd2nerd.org>
Date: Sat, 24 Jun 2023 07:39:24 +0200
Subject: [PATCH] dhcpcd: fix dhcpv6-pd for pppoe

---
 ...-Improve-learning-IPv6-address-flags.patch | 62 +++++++++++++++++++
 srcpkgs/dhcpcd/template                       |  2 +-
 2 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/dhcpcd/patches/Linux-Improve-learning-IPv6-address-flags.patch

diff --git a/srcpkgs/dhcpcd/patches/Linux-Improve-learning-IPv6-address-flags.patch b/srcpkgs/dhcpcd/patches/Linux-Improve-learning-IPv6-address-flags.patch
new file mode 100644
index 000000000000..5fceb5e4f3d5
--- /dev/null
+++ b/srcpkgs/dhcpcd/patches/Linux-Improve-learning-IPv6-address-flags.patch
@@ -0,0 +1,62 @@
+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;
+ }
+ 
diff --git a/srcpkgs/dhcpcd/template b/srcpkgs/dhcpcd/template
index b30bb7c24af4..09a30b9a3c8a 100644
--- a/srcpkgs/dhcpcd/template
+++ b/srcpkgs/dhcpcd/template
@@ -1,7 +1,7 @@
 # Template file for 'dhcpcd'
 pkgname=dhcpcd
 version=10.0.1
-revision=1
+revision=2
 build_style=configure
 make_check_target=test
 configure_args="

             reply	other threads:[~2023-06-24  5:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-24  5:43 lemmi [this message]
2023-06-24  5:45 ` [PR PATCH] [Merged]: " lemmi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44601@inbox.vuxu.org \
    --to=lemmi@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).