Mail archive
alpine-aports

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

From: Tyler A <tylera_at_privatedemail.net>
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
_at_@ -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
+_at_@ -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)
+ {
+_at_@ -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;
+_at_@ -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);
+_at_@ -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:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Jun 24 2018 - 05:55:32 GMT