Subject: [alpine-aports] [PATCH] main/dhcpcd: Fixes link local addresses being deleted on VLAN interfaces.

From: Tyler A <[email-masked]>
Date: Sun, 24 Jun 2018 05:55:32 +0930

Patch from upstream, will appear in next release. Written by Roy Marples.
---
 main/dhcpcd/dhcpcd-slaac-vlanid.patch | 43 +++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 main/dhcpcd/dhcpcd-slaac-vlanid.patch

diff --git a/main/dhcpcd/dhcpcd-slaac-vlanid.patch b/main/dhcpcd/dhcpcd-slaac-vlanid.patch
new file mode 100644
index 0000000000..57390a9448
--- /dev/null
+++ b/main/dhcpcd/dhcpcd-slaac-vlanid.patch
@@ -0,0 +1,43 @@
+diff --git a/src/ipv6.c b/src/ipv6.c
+index b3b026b3..2d516d99 100644
+--- a/src/ipv6.c
++++ b/src/ipv6.c
+@@ -253,6 +253,7 @@ ipv6_makestableprivate1(struct in6_addr *addr,
+     const struct in6_addr *prefix, int prefix_len,
+     const unsigned char *netiface, size_t netiface_len,
+     const unsigned char *netid, size_t netid_len,
++    unsigned short vlanid,
+     uint32_t *dad_counter,
+     const unsigned char *secret, size_t secret_len)
+ {
+@@ -267,6 +268,8 @@ ipv6_makestableprivate1(struct in6_addr *addr,
+ 
+ 	l = (size_t)(ROUNDUP8(prefix_len) / NBBY);
+ 	len = l + netiface_len + netid_len + sizeof(*dad_counter) + secret_len;
++	if (vlanid != 0)
++		len += sizeof(vlanid);
+ 	if (len > sizeof(buf)) {
+ 		errno = ENOBUFS;
+ 		return -1;
+@@ -281,6 +284,12 @@ ipv6_makestableprivate1(struct in6_addr *addr,
+ 		p += netiface_len;
+ 		memcpy(p, netid, netid_len);
+ 		p += netid_len;
++		/* Don't use a vlanid if not set.
++		 * This ensures prior versions have the same unique address. */
++		if (vlanid != 0) {
++			memcpy(p, &vlanid, sizeof(vlanid));
++			p += sizeof(vlanid);
++		}
+ 		memcpy(p, dad_counter, sizeof(*dad_counter));
+ 		p += sizeof(*dad_counter);
+ 		memcpy(p, secret, secret_len);
+@@ -333,7 +342,7 @@ ipv6_makestableprivate(struct in6_addr *addr,
+ 	r = ipv6_makestableprivate1(addr, prefix, prefix_len,
+ 	    ifp->hwaddr, ifp->hwlen,
+ 	    ifp->ssid, ifp->ssid_len,
+-	    &dad,
++	    ifp->vlanid, &dad,
+ 	    ifp->ctx->secret, ifp->ctx->secret_len);
+ 
+ 	if (r == 0)
-- 
2.18.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 26 Jun 2018 11:50:30 +0200

We need update the APKBUILD and bump pkgrel too or builders will not
pick this up.

-nc

On Sun, 24 Jun 2018 05:55:32 +0930

---

---

From: Tyler <[email-masked]>
Date: Tue, 26 Jun 2018 21:38:20 +0930

> We need update the APKBUILD and bump pkgrel too or builders will not

Oh, I forgot to add that.

-- 
Tyler

---

From: Tyler <[email-masked]>
Date: Tue, 26 Jun 2018 21:44:02 +0930

> Oh, I forgot to add that.

Seems the attachment got scrubbed

# Contributor: Michael Mason <[email-masked]>
# Contributor: Sören Tempel <[email-masked]>
# Maintainer: Natanael Copa <[email-masked]>
pkgname=dhcpcd
pkgver=7.0.6
pkgrel=1
pkgdesc="RFC2131 compliant DHCP client"
url="https://roy.marples.name/projects/dhcpcd"
arch="all"
license="BSD-2-Clause"
makedepends="linux-headers bsd-compat-headers dbus-dev"
install="$pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://roy.marples.name/downloads/dhcpcd/$pkgname-$pkgver.tar.xz
	busybox-logger.patch
	fix-chrony-conf-location.patch
	dhcpcd-slaac-vlanid.patch
	dhcpcd.initd
	"
builddir="$srcdir/$pkgname-$pkgver"
build() {
	cd "$builddir"

	CFLAGS="$CFLAGS -D_GNU_SOURCE -DHAVE_PRINTF_M"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--libexecdir=/usr/lib/$pkgname \
		--dbdir=/var/lib/$pkgname \
		--rundir=/run \
		--enable-ipv6 \
		--without-dev \
		--without-udev
	make
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install
	install -Dm755 "$srcdir"/dhcpcd.initd \
		"$pkgdir"/etc/init.d/dhcpcd
}

sha512sums="5885739e60d6eb4fded117cb87f59a073ae6e8da8454dee56d8e7c5d33778e413e121d28a22163ebf31e4508a21d3a21c1d17ee6d4551081db2ee8e5384d44c9  dhcpcd-7.0.6.tar.xz
692b2c8c75166fabd512a7cc69c650f9391e0f682ce9cbe1771bfa44e82dcf09e322c46493c45ca75000f479d3cddde306754ba31d28a798a15e2b79a56045f0  busybox-logger.patch
1c19eed0f7a008ee96ea392beb327169ff8c83fc27fed20f65f05c9125f60629ebe3474c5e6a7cf4aeeea448fde4264c9b84916efacd67d47ab908c47b1fc3a5  fix-chrony-conf-location.patch
a7c9a9d689e0f74610fcb5c902dc6e64e76f9551cbb8eae194259dcd88c8c70a39bf78560459c8239e73638337428d8e76f0bf0c236d9c38dee2bf8a8763ca65  dhcpcd-slaac-vlanid.patch
e777432c2efc84285b41e63a4687f3bd543f6864218d037529ab78b5ad934de154f28f478bd9facb56628f2953aad8a932bc2eb8b1dfffa0ce2278ffcfc4d880  dhcpcd.initd"

-- 
Tyler

---