[arch-commits] Commit in dhcpcd/trunk (PKGBUILD udf_validation.patch)
Ronald van Haren
ronald at archlinux.org
Thu May 7 08:00:56 UTC 2009
Date: Thursday, May 7, 2009 @ 04:00:56
Author: ronald
Revision: 38084
upgpkg: dhcpcd 5.0.1-1
Modified:
dhcpcd/trunk/PKGBUILD
Deleted:
dhcpcd/trunk/udf_validation.patch
----------------------+
PKGBUILD | 9 ++--
udf_validation.patch | 96 -------------------------------------------------
2 files changed, 4 insertions(+), 101 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-05-07 05:57:24 UTC (rev 38083)
+++ PKGBUILD 2009-05-07 08:00:56 UTC (rev 38084)
@@ -4,7 +4,7 @@
# Contributor: Judd Vinet <jvinet.zeroflux.org>
pkgname=dhcpcd
-pkgver=5.0.0
+pkgver=5.0.1
pkgrel=1
pkgdesc="RFC2131 compliant DHCP client daemon"
url="http://roy.marples.name/dhcpcd/"
@@ -15,10 +15,9 @@
backup=('etc/conf.d/dhcpcd' 'etc/dhcpcd.conf')
options=('emptydirs') # We Need the Empty /var/lib/dhcpcd Directory
source=("http://roy.marples.name/downloads/$pkgname/$pkgname-$pkgver.tar.bz2" \
- 'dhcpcd.conf.d' 'udf_validation.patch')
-md5sums=('1fc1876132773d868449dd185469de3f'
- '372d33485556982b64a97f301e17c5dd'
- '61353e43f72ee26ee9c9f2457a762b59')
+ 'dhcpcd.conf.d')
+md5sums=('79a886e0814e665cb4e29d9d914b3bcb'
+ '372d33485556982b64a97f301e17c5dd')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
Deleted: udf_validation.patch
===================================================================
--- udf_validation.patch 2009-05-07 05:57:24 UTC (rev 38083)
+++ udf_validation.patch 2009-05-07 08:00:56 UTC (rev 38084)
@@ -1,96 +0,0 @@
-diff -Naur dhcpcd-4.0.12.old/client.c dhcpcd-4.0.12/client.c
---- dhcpcd-4.0.12.old/client.c 2009-03-06 09:31:21.077601089 +0100
-+++ dhcpcd-4.0.12/client.c 2009-03-06 09:29:44.000000000 +0100
-@@ -1548,7 +1548,7 @@
- }
- if (bytes == -1)
- break;
-- if (valid_udp_packet(packet) == -1)
-+ if (valid_udp_packet(packet, bytes) == -1)
- continue;
- bytes = get_udp_data(&pp, packet);
- if ((size_t)bytes > sizeof(*dhcp)) {
-diff -Naur dhcpcd-4.0.12.old/net.c dhcpcd-4.0.12/net.c
---- dhcpcd-4.0.12.old/net.c 2009-03-06 09:31:21.077601089 +0100
-+++ dhcpcd-4.0.12/net.c 2009-03-06 09:29:44.000000000 +0100
-@@ -634,44 +634,42 @@
- }
-
- int
--valid_udp_packet(const uint8_t *data)
-+valid_udp_packet(const uint8_t *data, size_t data_len)
- {
- struct udp_dhcp_packet packet;
-- uint16_t bytes;
-- uint16_t ipsum;
-- uint16_t iplen;
-- uint16_t udpsum;
-- struct in_addr source;
-- struct in_addr dest;
-- int retval = 0;
-+ uint16_t bytes, udpsum;
-
-- memcpy(&packet, data, sizeof(packet));
-- bytes = ntohs(packet.ip.ip_len);
-- ipsum = packet.ip.ip_sum;
-- iplen = packet.ip.ip_len;
-- udpsum = packet.udp.uh_sum;
--
-- if (0 != checksum(&packet.ip, sizeof(packet.ip))) {
-+ if (data_len > sizeof(packet)) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+ memcpy(&packet, data, data_len);
-+ if (checksum(&packet.ip, sizeof(packet.ip)) != 0) {
- errno = EINVAL;
- return -1;
- }
-
-- packet.ip.ip_sum = 0;
-- memcpy(&source, &packet.ip.ip_src, sizeof(packet.ip.ip_src));
-- memcpy(&dest, &packet.ip.ip_dst, sizeof(packet.ip.ip_dst));
-- memset(&packet.ip, 0, sizeof(packet.ip));
-+ bytes = ntohs(packet.ip.ip_len);
-+ if (data_len < bytes) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+ udpsum = packet.udp.uh_sum;
- packet.udp.uh_sum = 0;
--
-- packet.ip.ip_p = IPPROTO_UDP;
-- memcpy(&packet.ip.ip_src, &source, sizeof(packet.ip.ip_src));
-- memcpy(&packet.ip.ip_dst, &dest, sizeof(packet.ip.ip_dst));
-+ packet.ip.ip_hl = 0;
-+ packet.ip.ip_v = 0;
-+ packet.ip.ip_tos = 0;
- packet.ip.ip_len = packet.udp.uh_ulen;
-- if (udpsum && udpsum != checksum(&packet, bytes)) {
-+ packet.ip.ip_id = 0;
-+ packet.ip.ip_off = 0;
-+ packet.ip.ip_ttl = 0;
-+ packet.ip.ip_sum = 0;
-+ if (udpsum && checksum(&packet, bytes) != udpsum) {
- errno = EINVAL;
-- retval = -1;
-+ return -1;
- }
-
-- return retval;
-+ return 0;
- }
-
- int
-diff -Naur dhcpcd-4.0.12.old/net.h dhcpcd-4.0.12/net.h
---- dhcpcd-4.0.12.old/net.h 2009-03-06 09:31:21.080934132 +0100
-+++ dhcpcd-4.0.12/net.h 2009-03-06 09:29:44.000000000 +0100
-@@ -160,7 +160,7 @@
- ssize_t make_udp_packet(uint8_t **, const uint8_t *, size_t,
- struct in_addr, struct in_addr);
- ssize_t get_udp_data(const uint8_t **, const uint8_t *);
--int valid_udp_packet(const uint8_t *);
-+int valid_udp_packet(const uint8_t *, size_t);
-
- int open_socket(struct interface *, int);
- ssize_t send_packet(const struct interface *, struct in_addr,
More information about the arch-commits
mailing list