From ccbfd1d5fad943f03753fe26813e7c0e091fc95e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Thu, 19 May 2016 21:23:34 +0300
Subject: [PATCH] Revert "main/dhcpcd: upgrade to 6.11.0"

This reverts commit 0587d55d6aa9feb987f9a3fed1e56cc007d96267.

The new release seems to have major changes, and is buggy. See:
http://roy.marples.name/projects/dhcpcd/info/05a4883e1efe588e
http://roy.marples.name/projects/dhcpcd/info/3f10c9b871b78236

Reverting for now until the above bugs are fixed.
---
 main/dhcpcd/APKBUILD             | 13 ++----
 main/dhcpcd/fix-3f10c9b871.patch | 79 --------------------------------
 2 files changed, 5 insertions(+), 87 deletions(-)
 delete mode 100644 main/dhcpcd/fix-3f10c9b871.patch

diff --git a/main/dhcpcd/APKBUILD b/main/dhcpcd/APKBUILD
index 533c3ec9451b..b72c8cd9c0f1 100644
--- a/main/dhcpcd/APKBUILD
+++ b/main/dhcpcd/APKBUILD
@@ -2,7 +2,7 @@
 # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=dhcpcd
-pkgver=6.11.0
+pkgver=6.10.3
 pkgrel=1
 pkgdesc="RFC2131 compliant DHCP client"
 url="http://roy.marples.name/projects/dhcpcd/"
@@ -15,7 +15,6 @@ install=""
 subpackages="$pkgname-doc"
 source="http://roy.marples.name/downloads/dhcpcd/$pkgname-$pkgver.tar.xz
 	busybox-logger.patch
-	fix-3f10c9b871.patch
 	dhcpcd.initd
 	"
 
@@ -26,6 +25,7 @@ prepare() {
 		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
 		esac
 	done
+
 }
 
 build() {
@@ -47,15 +47,12 @@ package() {
 		"$pkgdir"/etc/init.d/dhcpcd || return 1
 }
 
-md5sums="8c1340a53fd7e56d32bb6fef6e1354ee  dhcpcd-6.11.0.tar.xz
+md5sums="818c284742908e26af4a3a5c6d1e5297  dhcpcd-6.10.3.tar.xz
 231d2b03e7e93fa6cc7406889e9945e3  busybox-logger.patch
-67f0447fdd3bf5338f42d397fcc6e823  fix-3f10c9b871.patch
 5cd5809d11b77b30f21df8418729d70b  dhcpcd.initd"
-sha256sums="31c2cd327657f11c427fe5044f74c5b942e70450fa43ceabf4b25f3fd4999959  dhcpcd-6.11.0.tar.xz
+sha256sums="b586c1f770373f83e3f574c683c66bea217a6d6c89b8e91dbdb6f75aa654c8d5  dhcpcd-6.10.3.tar.xz
 aec6c5d7a41551ca7cd3849a53621692ee0a1a6d259892beaf448eb1f2d4af01  busybox-logger.patch
-4fef5e963ec2624da944cd5c3ea3f7682a04a85b7d545cf66245be4b057ac9cd  fix-3f10c9b871.patch
 6bb9b8b0075e45e63e898ed043f3c5951dc3e95c1fa62d22cc6e0616c792ecd1  dhcpcd.initd"
-sha512sums="ee46f28b046752e80839c229e074cb87aea93695c1347ba852a026828a34b47f66990c9ce863f7de02ad81cc922c0ae000ab8fbb23ed9f2d1f97b720020db166  dhcpcd-6.11.0.tar.xz
+sha512sums="6ebcb720909f4d167d064d5e8ed961c331470762e89f4e5c145f048424ef170ffc218e9a9dcc94e3a8dce6ccc147710ec2ef17627a708918203858f3dcdca43d  dhcpcd-6.10.3.tar.xz
 83dc7bfd36b6b416c931775bb35a0d2951ed04c421195c45bfed80a11a7adbed7c80ade1c1246847c2fb1bf15a7b6e83100f16605ee84f750440d7bc9f7f5ef3  busybox-logger.patch
-0cef580ffa60059d45964d0b3a5e39b3d4b9956fc9fa9840e1070ef58945827721607df75ac11d4c7e29d47a76326b066c6f404c6f4310658fbfb103a3b030ff  fix-3f10c9b871.patch
 6d3220155f2d9ed3e3a00afd378eeb70d435e19804201f8bb35498f1f7f3dfdaeaa2f4a01a18f5e96b457d9c173bc6a206b3e67ebf6d95da7e7b350dcd153fde  dhcpcd.initd"
diff --git a/main/dhcpcd/fix-3f10c9b871.patch b/main/dhcpcd/fix-3f10c9b871.patch
deleted file mode 100644
index 903d843a2ed1..000000000000
--- a/main/dhcpcd/fix-3f10c9b871.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-http://roy.marples.name/projects/dhcpcd/tktview?name=3f10c9b871
-
-Index: dhcp.c
-==================================================================
---- a/dhcp.c
-+++ b/dhcp.c
-@@ -1082,13 +1082,16 @@
- 	}
- 
- 	*p++ = DHO_END;
- 	len = (size_t)(p - (uint8_t *)bootp);
- 
--	/* Pad out to the BOOTP minimum message length.
--	 * Some DHCP servers incorrectly require this. */
--	while (len < BOOTP_MESSAGE_LENTH_MIN) {
-+	/* Pad out to the BOOTP message length.
-+	 * Even if we send a DHCP packet with a variable length vendor area,
-+	 * some servers / relay agents don't like packets smaller than
-+	 * a BOOTP message which is fine because that's stipulated
-+	 * in RFC1542 section 2.1. */
-+	while (len < sizeof(*bootp)) {
- 		*p++ = DHO_PAD;
- 		len++;
- 	}
- 
- 	if (ifo->auth.options & DHCPCD_AUTH_SEND && auth_len != 0)
-@@ -3134,18 +3137,30 @@
- 		{
- 			logger(ifp->ctx, LOG_WARNING,
- 			    "%s: server %s is not destination",
- 			    ifp->name, inet_ntoa(from));
- 		}
--
-+		/*
-+		 * DHCP has a variable option area rather than a fixed
-+		 * vendor area.
-+		 * Because DHCP uses the BOOTP protocol it should
-+		 * still send BOOTP sized packets to be RFC compliant.
-+		 * However some servers send a truncated vendor area.
-+		 * dhcpcd can work fine without the vendor area being sent.
-+		 */
- 		bytes = get_udp_data(&bootp, buf);
--		if (bytes < sizeof(struct bootp)) {
-+		if (bytes < offsetof(struct bootp, vend)) {
- 			logger(ifp->ctx, LOG_ERR,
- 			    "%s: truncated packet (%zu) from %s",
- 			    ifp->name, bytes, inet_ntoa(from));
- 			continue;
- 		}
-+		/* But to make our IS_DHCP macro easy, ensure the vendor
-+		 * area has at least 4 octets. */
-+		while (bytes < offsetof(struct bootp, vend) + 4)
-+			bootp[bytes++] = '\0';
-+
- 		dhcp_handledhcp(ifp, (struct bootp *)bootp, bytes, &from);
- 		if (state->raw_fd == -1)
- 			break;
- 	}
- }
-
-Index: dhcp.h
-==================================================================
---- a/dhcp.h
-+++ b/dhcp.h
-@@ -129,13 +129,10 @@
- 	FQDN_NONE       = 0x18,
- 	FQDN_PTR        = 0x20,
- 	FQDN_BOTH       = 0x31
- };
- 
--/* Some crappy DHCP servers require the BOOTP minimum length */
--#define BOOTP_MESSAGE_LENTH_MIN 300
--
- /* Don't import common.h as that defines __unused which causes problems
-  * on some Linux systems which define it as part of a structure */
- #if __GNUC__ > 2 || defined(__INTEL_COMPILER)
- # ifndef __packed
- #  define __packed   __attribute__((__packed__))
-
-- 
GitLab