- Upgrade to ISC dhcp-3.0.6

- Remove the -TERM option from killproc command (#245317)
This commit is contained in:
David Cantrell 2007-07-10 18:59:53 +00:00
parent 434d4dfee7
commit 0713d0cdcc
8 changed files with 156 additions and 174 deletions

View File

@ -1 +1 @@
dhcp-3.0.5.tar.gz
dhcp-3.0.6.tar.gz

View File

@ -1,52 +0,0 @@
--- dhcp-3.0.5/common/packet.c.memory 2005-03-03 11:55:23.000000000 -0500
+++ dhcp-3.0.5/common/packet.c 2007-03-30 17:11:06.000000000 -0400
@@ -140,6 +140,7 @@
struct ip ip;
struct udphdr udp;
+ memset( &ip, '\0', sizeof ip);
/* Fill out the IP header */
IP_V_SET (&ip, 4);
IP_HL_SET (&ip, 20);
@@ -219,7 +220,7 @@
{
unsigned char *data;
struct ip ip;
- struct udphdr *udp;
+ struct udphdr udph, *udp=&udph;
u_int32_t ip_len = (buf [bufix] & 0xf) << 2;
u_int32_t sum, usum;
static int ip_packets_seen;
@@ -233,7 +234,7 @@
int ignore = 0;
memcpy(&ip, buf + bufix, sizeof (struct ip));
- udp = (struct udphdr *)(buf + bufix + ip_len);
+ memcpy(udp, buf + bufix + ip_len, sizeof(struct udphdr));
#ifdef USERLAND_FILTER
/* Is it a UDP packet? */
--- dhcp-3.0.5/common/lpf.c.memory 2007-03-30 17:11:06.000000000 -0400
+++ dhcp-3.0.5/common/lpf.c 2007-03-30 17:11:55.000000000 -0400
@@ -246,6 +246,7 @@
struct interface_info *info;
{
struct sock_fprog p;
+ memset(&p,'\0', sizeof(struct sock_fprog));
/* Set up the bpf filter program structure. This is defined in
bpf.c */
--- dhcp-3.0.5/minires/ns_name.c.memory 2004-06-10 13:59:40.000000000 -0400
+++ dhcp-3.0.5/minires/ns_name.c 2007-03-30 17:11:06.000000000 -0400
@@ -71,6 +71,11 @@
dn = dst;
eom = dst + dstsiz;
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) != 0) {
/* Some kind of compression pointer. */

View File

@ -1,7 +0,0 @@
--- dhcp-3.0.5/includes/version.h.version 2006-10-26 18:19:38.000000000 -0400
+++ dhcp-3.0.5/includes/version.h 2006-11-10 11:16:04.000000000 -0500
@@ -1,3 +1,3 @@
/* Current version of ISC DHCP Distribution. */
-#define DHCP_VERSION "V3.0.5"
+#define DHCP_VERSION "V3.0.5-RedHat"

37
dhcp-3.0.6-memory.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up dhcp-3.0.6/minires/ns_name.c.memory dhcp-3.0.6/minires/ns_name.c
--- dhcp-3.0.6/minires/ns_name.c.memory 2004-06-10 13:59:40.000000000 -0400
+++ dhcp-3.0.6/minires/ns_name.c 2007-07-10 11:43:29.000000000 -0400
@@ -71,6 +71,11 @@ ns_name_ntop(const u_char *src, char *ds
dn = dst;
eom = dst + dstsiz;
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) != 0) {
/* Some kind of compression pointer. */
diff -up dhcp-3.0.6/common/packet.c.memory dhcp-3.0.6/common/packet.c
--- dhcp-3.0.6/common/packet.c.memory 2007-05-01 16:42:55.000000000 -0400
+++ dhcp-3.0.6/common/packet.c 2007-07-10 11:43:29.000000000 -0400
@@ -140,6 +140,7 @@ void assemble_udp_ip_header (interface,
struct ip ip;
struct udphdr udp;
+ memset( &ip, '\0', sizeof ip);
/* Fill out the IP header */
IP_V_SET (&ip, 4);
IP_HL_SET (&ip, 20);
diff -up dhcp-3.0.6/common/lpf.c.memory dhcp-3.0.6/common/lpf.c
--- dhcp-3.0.6/common/lpf.c.memory 2007-07-10 11:43:29.000000000 -0400
+++ dhcp-3.0.6/common/lpf.c 2007-07-10 11:43:29.000000000 -0400
@@ -246,6 +246,7 @@ static void lpf_tr_filter_setup (info)
struct interface_info *info;
{
struct sock_fprog p;
+ memset(&p,'\0', sizeof(struct sock_fprog));
/* Set up the bpf filter program structure. This is defined in
bpf.c */

View File

@ -1,29 +1,43 @@
--- dhcp-3.0.5/common/bpf.c.xen 2004-11-24 12:39:15.000000000 -0500
+++ dhcp-3.0.5/common/bpf.c 2007-03-30 16:34:45.000000000 -0400
@@ -478,7 +478,8 @@
diff -up dhcp-3.0.6/includes/dhcpd.h.xen dhcp-3.0.6/includes/dhcpd.h
--- dhcp-3.0.6/includes/dhcpd.h.xen 2007-07-10 11:50:22.000000000 -0400
+++ dhcp-3.0.6/includes/dhcpd.h 2007-07-10 14:03:52.000000000 -0400
@@ -1985,7 +1985,7 @@ ssize_t decode_hw_header PROTO ((struct
unsigned, struct hardware *));
ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *,
unsigned, struct sockaddr_in *,
- unsigned, unsigned *));
+ unsigned, unsigned *, int));
/* ethernet.c */
void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *,
diff -up dhcp-3.0.6/common/bpf.c.xen dhcp-3.0.6/common/bpf.c
--- dhcp-3.0.6/common/bpf.c.xen 2007-05-01 16:42:55.000000000 -0400
+++ dhcp-3.0.6/common/bpf.c 2007-07-10 14:04:24.000000000 -0400
@@ -478,7 +478,7 @@ ssize_t receive_packet (interface, buf,
offset = decode_udp_ip_header (interface,
interface -> rbuf,
interface -> rbuf_offset,
from,
- hdr.bh_caplen);
+ hdr.bh_caplen,
+ 0);
- from, hdr.bh_caplen, &paylen);
+ from, hdr.bh_caplen, &paylen, 0);
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) {
--- dhcp-3.0.5/common/dlpi.c.xen 2004-11-24 12:39:15.000000000 -0500
+++ dhcp-3.0.5/common/dlpi.c 2007-03-30 16:34:45.000000000 -0400
@@ -679,7 +679,7 @@
diff -up dhcp-3.0.6/common/dlpi.c.xen dhcp-3.0.6/common/dlpi.c
--- dhcp-3.0.6/common/dlpi.c.xen 2007-05-01 16:42:55.000000000 -0400
+++ dhcp-3.0.6/common/dlpi.c 2007-07-10 14:04:36.000000000 -0400
@@ -680,7 +680,7 @@ ssize_t receive_packet (interface, buf,
length -= offset;
#endif
offset = decode_udp_ip_header (interface, dbuf, bufix,
- from, length);
+ from, length, 0);
- from, length, &paylen);
+ from, length, &paylen, 0);
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) {
--- dhcp-3.0.5/common/lpf.c.xen 2007-03-30 16:34:26.000000000 -0400
+++ dhcp-3.0.5/common/lpf.c 2007-03-30 16:34:45.000000000 -0400
@@ -34,16 +34,31 @@
diff -up dhcp-3.0.6/common/lpf.c.xen dhcp-3.0.6/common/lpf.c
--- dhcp-3.0.6/common/lpf.c.xen 2007-07-10 11:50:22.000000000 -0400
+++ dhcp-3.0.6/common/lpf.c 2007-07-10 14:09:29.000000000 -0400
@@ -34,16 +34,31 @@ static char copyright[] =
#include "dhcpd.h"
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
#include <sys/ioctl.h>
@ -55,7 +69,7 @@
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */
@@ -69,10 +84,14 @@
@@ -69,10 +84,14 @@ int if_register_lpf (info)
struct interface_info *info;
{
int sock;
@ -72,7 +86,7 @@
htons((short)ETH_P_ALL))) < 0) {
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
@@ -87,11 +106,16 @@
@@ -87,11 +106,16 @@ int if_register_lpf (info)
log_fatal ("Open a socket for LPF: %m");
}
@ -92,7 +106,7 @@
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
errno == EAFNOSUPPORT || errno == EINVAL) {
@@ -171,9 +195,18 @@
@@ -171,9 +195,18 @@ static void lpf_gen_filter_setup (struct
void if_register_receive (info)
struct interface_info *info;
{
@ -111,7 +125,7 @@
#if defined (HAVE_TR_SUPPORT)
if (info -> hw_address.hbuf [0] == HTYPE_IEEE802)
lpf_tr_filter_setup (info);
@@ -291,7 +324,6 @@
@@ -292,7 +325,6 @@ ssize_t send_packet (interface, packet,
double hh [16];
double ih [1536 / sizeof (double)];
unsigned char *buf = (unsigned char *)ih;
@ -119,7 +133,7 @@
int result;
int fudge;
@@ -309,15 +341,7 @@
@@ -310,15 +342,7 @@ ssize_t send_packet (interface, packet,
(unsigned char *)raw, len);
memcpy (buf + ibufp, raw, len);
@ -136,13 +150,14 @@
if (result < 0)
log_error ("send_packet: %m");
return result;
@@ -334,13 +358,34 @@
@@ -335,14 +359,35 @@ ssize_t receive_packet (interface, buf,
{
int length = 0;
int offset = 0;
+ int nocsum = 0;
unsigned char ibuf [1536];
unsigned bufix = 0;
unsigned paylen;
+ unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
+ struct iovec iov = {
+ .iov_base = ibuf,
@ -172,45 +187,41 @@
bufix = 0;
/* Decode the physical header... */
offset = decode_hw_header (interface, ibuf, bufix, hfrom);
@@ -357,7 +402,7 @@
@@ -359,7 +404,7 @@ ssize_t receive_packet (interface, buf,
/* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix, from,
- (unsigned)length);
+ (unsigned)length, nocsum);
- (unsigned)length, &paylen);
+ (unsigned)length, &paylen, nocsum);
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0)
--- dhcp-3.0.5/common/nit.c.xen 2004-11-24 12:39:15.000000000 -0500
+++ dhcp-3.0.5/common/nit.c 2007-03-30 16:34:45.000000000 -0400
@@ -370,7 +370,7 @@
diff -up dhcp-3.0.6/common/nit.c.xen dhcp-3.0.6/common/nit.c
--- dhcp-3.0.6/common/nit.c.xen 2007-05-01 16:42:55.000000000 -0400
+++ dhcp-3.0.6/common/nit.c 2007-07-10 14:05:16.000000000 -0400
@@ -371,7 +371,7 @@ ssize_t receive_packet (interface, buf,
/* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix,
- from, length);
+ from, length, 0);
- from, length, &paylen);
+ from, length, &paylen, 0);
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0)
--- dhcp-3.0.5/common/packet.c.xen 2007-03-30 16:34:26.000000000 -0400
+++ dhcp-3.0.5/common/packet.c 2007-03-30 16:34:45.000000000 -0400
@@ -211,12 +211,13 @@
/* UDP header and IP header decoded together for convenience. */
-ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen)
+ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen, nocsum)
struct interface_info *interface;
unsigned char *buf;
unsigned bufix;
struct sockaddr_in *from;
unsigned buflen;
+ int nocsum;
diff -up dhcp-3.0.6/common/packet.c.xen dhcp-3.0.6/common/packet.c
--- dhcp-3.0.6/common/packet.c.xen 2007-07-10 11:50:22.000000000 -0400
+++ dhcp-3.0.6/common/packet.c 2007-07-10 14:06:24.000000000 -0400
@@ -215,7 +215,7 @@ ssize_t
decode_udp_ip_header(struct interface_info *interface,
unsigned char *buf, unsigned bufix,
struct sockaddr_in *from, unsigned buflen,
- unsigned *rbuflen)
+ unsigned *rbuflen, int nocsum)
{
unsigned char *data;
struct ip ip;
@@ -319,7 +320,7 @@
(u_int32_t)ulen))));
@@ -326,7 +326,7 @@ decode_udp_ip_header(struct interface_in
8, IPPROTO_UDP + ulen))));
udp_packets_seen++;
- if (usum && usum != sum) {
@ -218,25 +229,15 @@
udp_packets_bad_checksum++;
if (udp_packets_seen > 4 &&
(udp_packets_seen / udp_packets_bad_checksum) < 2) {
--- dhcp-3.0.5/common/upf.c.xen 2004-11-24 12:39:16.000000000 -0500
+++ dhcp-3.0.5/common/upf.c 2007-03-30 16:34:45.000000000 -0400
@@ -321,7 +321,7 @@
diff -up dhcp-3.0.6/common/upf.c.xen dhcp-3.0.6/common/upf.c
--- dhcp-3.0.6/common/upf.c.xen 2007-05-01 16:42:56.000000000 -0400
+++ dhcp-3.0.6/common/upf.c 2007-07-10 14:06:37.000000000 -0400
@@ -322,7 +322,7 @@ ssize_t receive_packet (interface, buf,
/* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix,
- from, length);
+ from, length, 0);
- from, length, &paylen);
+ from, length, &paylen, 0);
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0)
--- dhcp-3.0.5/includes/dhcpd.h.xen 2007-03-30 16:34:26.000000000 -0400
+++ dhcp-3.0.5/includes/dhcpd.h 2007-03-30 16:34:45.000000000 -0400
@@ -1988,7 +1988,7 @@
unsigned, struct hardware *));
ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *,
unsigned, struct sockaddr_in *,
- unsigned));
+ unsigned, int));
/* ethernet.c */
void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *,

105
dhcp.spec
View File

@ -7,10 +7,13 @@
# value to avoid any problems guessing what it might be during installation.
%define workdir work.linux-2.2
# The vendor name to append to the version number
%define vendor Fedora
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
Name: dhcp
Version: 3.0.5
Release: 37%{?dist}
Version: 3.0.6
Release: 1%{?dist}
Epoch: 12
License: ISC
Group: System Environment/Daemons
@ -30,29 +33,27 @@ Source11: Makefile.dist
Source12: dhcp4client.h
Source13: libdhcp_control.h
Patch0: %{name}-3.0.5-version.patch
Patch1: %{name}-3.0.5-Makefile.patch
Patch2: %{name}-3.0.5-warnings.patch
Patch3: %{name}-3.0.5-extended-new-option-info.patch
Patch4: %{name}-3.0.5-errwarn-message.patch
Patch5: %{name}-3.0.5-ldap-configuration.patch
Patch6: %{name}-3.0.5-memory.patch
Patch7: %{name}-3.0.5-options.patch
Patch8: %{name}-3.0.5-release-by-ifup.patch
Patch9: %{name}-3.0.5-dhclient-decline-backoff.patch
Patch10: %{name}-3.0.5-enable-timeout-functions.patch
Patch11: %{name}-3.0.5-inherit-leases.patch
Patch12: %{name}-3.0.5-selinux.patch
Patch13: %{name}-3.0.5-unicast-bootp.patch
Patch14: %{name}-3.0.5-fast-timeout.patch
Patch15: %{name}-3.0.5-failover-ports.patch
Patch16: %{name}-3.0.5-dhclient-usage.patch
Patch17: %{name}-3.0.5-default-requested-options.patch
Patch18: %{name}-3.0.5-prototypes.patch
Patch19: %{name}-3.0.5-manpages.patch
Patch20: %{name}-3.0.5-libdhcp4client.patch
Patch21: %{name}-3.0.5-xen-checksum.patch
Patch22: %{name}-3.0.5-dhclient-anycast.patch
Patch0: %{name}-3.0.5-Makefile.patch
Patch5: %{name}-3.0.5-warnings.patch
Patch10: %{name}-3.0.5-extended-new-option-info.patch
Patch15: %{name}-3.0.5-errwarn-message.patch
Patch20: %{name}-3.0.5-ldap-configuration.patch
Patch25: %{name}-3.0.6-memory.patch
Patch30: %{name}-3.0.5-options.patch
Patch35: %{name}-3.0.5-release-by-ifup.patch
Patch40: %{name}-3.0.5-dhclient-decline-backoff.patch
Patch45: %{name}-3.0.5-enable-timeout-functions.patch
Patch50: %{name}-3.0.5-inherit-leases.patch
Patch55: %{name}-3.0.5-unicast-bootp.patch
Patch60: %{name}-3.0.5-fast-timeout.patch
Patch65: %{name}-3.0.5-failover-ports.patch
Patch70: %{name}-3.0.5-dhclient-usage.patch
Patch75: %{name}-3.0.5-default-requested-options.patch
Patch80: %{name}-3.0.5-prototypes.patch
Patch85: %{name}-3.0.5-manpages.patch
Patch90: %{name}-3.0.5-libdhcp4client.patch
Patch95: %{name}-3.0.6-xen-checksum.patch
Patch100: %{name}-3.0.5-dhclient-anycast.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: groff openldap-devel
@ -141,74 +142,72 @@ libdhcp4client.
%prep
%setup -q
# Add -RedHat to the version number
%patch0 -p1 -b .version
# Add vendor to the version number
%{__sed} -e 's|V%{version}|V%{version}-%{vendor}|g' includes/version.h > includes/version.h.new
%{__mv} includes/version.h.new includes/version.h
# Use $(MAKE) and $(CC) in the Makefiles
%patch1 -p1 -b .Makefile
%patch0 -p1 -b .Makefile
# Fix up anything that fails -Wall -Werror
%patch2 -p1 -b .warnings
%patch5 -p1 -b .warnings
# Extended new option info patch. Adds the -x option to dhclient, which is
# needed for dhcdbd and NetworkManager
%patch3 -p1 -b .enoi
%patch10 -p1 -b .enoi
# Replace the standard ISC warning message about requesting help with an
# explanation that this is a patched build of ISC DHCP and bugs should be
# reported through bugzilla.redhat.com
%patch4 -p1 -b .message
%patch15 -p1 -b .message
# Add support for dhcpd.conf data in LDAP
%patch5 -p1 -b .ldap
%patch20 -p1 -b .ldap
# Fix memory alignment and initialization problems in common/packet.c
# Fix buffer overflow in minires library
# Init struct sock_prog in common/lpf.c to NULL
%patch6 -p1 -b .memory
%patch25 -p1 -b .memory
# Add more dhclient options (-I, -B, -H, -F, -T, -V, and -R)
%patch7 -p1 -b .options
%patch30 -p1 -b .options
# Handle releasing interfaces requested by /sbin/ifup
# pid file is assumed to be /var/run/dhclient-$interface.pid
%patch8 -p1 -b .release
%patch35 -p1 -b .release
# If we receive a DHCP offer in dhclient and it's DECLINEd in dhclient-script,
# backoff for an amount of time before trying again
%patch9 -p1 -b .decline
%patch40 -p1 -b .decline
# Enable cancel_all_timeouts() and relinquish_timeouts() regardless of
# the DEBUG_MEMORY_LEAKAGE_ON_EXIT macro
%patch10 -p1 -b .etf
%patch45 -p1 -b .etf
# Inherit active leases
%patch11 -p1 -b .inherit
# Close lease file before exec to fix SELinux error message
%patch12 -p1 -b .selinux
%patch50 -p1 -b .inherit
# Support unicast BOOTP for IBM pSeries systems (and maybe others)
%patch13 -p1 -b .unicast
%patch55 -p1 -b .unicast
# Fast timeout for dhclient
%patch14 -p1 -b .fast
%patch60 -p1 -b .fast
# Use the following IANA-registered failover ports:
# dhcp-failover 647/tcp
# dhcp-failover 647/udp
# dhcp-failover 847/tcp
# dhcp-failover 847/udp
%patch15 -p1 -b .failover
%patch65 -p1 -b .failover
# Update the usage screen for dhclient(8) indicating new options
# Use printf() rather than log_info() to display the information
# Also, return EXIT_FAILURE when the usage() screen is displayed (stop parsing)
%patch16 -p1 -b .usage
%patch70 -p1 -b .usage
# Add NIS domain, NIS servers, and NTP servers to the list of default
# requested DHCP options
%patch17 -p1 -b .dho
%patch75 -p1 -b .dho
# Add missing prototypes to take care of gcc warnings
# in dst/dst_api.c: add b64_pton() and b64_ntop()
@ -217,7 +216,7 @@ libdhcp4client.
# in minires/res_comp.c: add ns_name_uncompress(), ns_name_compress(), and
# ns_name_skip()
# in minires/res_init.c: add res_randomid()
%patch18 -p1 -b .prototypes
%patch80 -p1 -b .prototypes
# Man page updates explaining new features added from the above patches.
# Normally these man page changes would be included in the feature patch,
@ -227,16 +226,16 @@ libdhcp4client.
# and not affect the code changes in the other patches. It's actually
# pretty common to update or alter these man pages independent of the code
# changes.
%patch19 -p1 -b .manpages
%patch85 -p1 -b .manpages
# Add the libdhcp4client target (library version of dhclient)
%patch20 -p1 -b .libdhcp4client
%patch90 -p1 -b .libdhcp4client
# Handle Xen partial UDP checksums
%patch21 -p1 -b .xen
%patch95 -p1 -b .xen
# Add anycast support to dhclient (for OLPC)
%patch22 -p1 -b .anycast
%patch100 -p1 -b .anycast
# Copy in documentation and example scripts for LDAP patch to dhcpd
%{__install} -p -m 0644 %SOURCE6 .
@ -434,6 +433,10 @@ fi
%{_libdir}/libdhcp4client.a
%changelog
* Tue Jul 10 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.6-1
- Upgrade to ISC dhcp-3.0.6
- Remove the -TERM option from killproc command (#245317)
* Wed Jun 20 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-37
- For init script functions, echo new line after OK or FAIL msg (#244956)

View File

@ -60,7 +60,7 @@ start() {
stop() {
echo -n $"Shutting down $prog: "
killproc $prog -TERM
killproc $prog
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $lockfile

View File

@ -1 +1 @@
ce5d30d4645e4eab1f54561b487d1ec7 dhcp-3.0.5.tar.gz
724bad21ad8b638abadd5fcc07df1a0f dhcp-3.0.6.tar.gz