LynxOs port patch
K. Richard Pixley
rpixley at sj.symbol.com
Thu Sep 2 20:10:11 UTC 2004
What follows is the patch I use to build dhcp-3.0.1 on LynxOs. The
tree compiles, though I've only had occasion to run dhclient and that
only superficially so far. I have seen dhclient configure two
interfaces concurrently and properly.
To use this port, you will also need all of my earlier patches which
are included as a shar file after the port patch as a convenience.
--rich
diff -u -r -N dhcp-3.0.1/includes/cf/lynxos.h dhcp-work2/includes/cf/lynxos.h
--- dhcp-3.0.1/includes/cf/lynxos.h 1969-12-31 16:00:00.000000000 -0800
+++ dhcp-work2/includes/cf/lynxos.h 2004-08-27 09:45:08.000000000 -0700
@@ -0,0 +1,102 @@
+/*
+ * Lynxos port by K. Richard Pixley
+ */
+
+#include <ar.h>
+#include <ranlib.h>
+#include <a.out.h>
+#include <byteorder.h>
+
+#include <time.h>
+#define TIME time_t
+
+#define HAVE_BROKEN_WRITEV
+#define HAVE_ANCIENT_BERKELEY_PACKET_MUNGING_BUG
+
+/* Varargs stuff... */
+#include <stdarg.h>
+#define VA_DOTDOTDOT ...
+#define va_dcl
+#define VA_start(list, last) va_start (list, last)
+
+#define VOIDPTR void *
+
+#include <net/if.h>
+
+#include <setjmp.h>
+
+#include <syslog.h>
+
+#include <sys/socket.h>
+
+#include <errno.h>
+
+#include <signal.h>
+
+#include <bsd/if_dl.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define EOL '\n'
+#define INADDR_LOOPBACK ((u_int32_t)0x7f000001)
+#define GET_HOST_ID_MISSING
+
+typedef int socklen_t;
+
+#include <time.h>
+
+#define TIME time_t
+#define GET_TIME(x) time ((x))
+
+/* #define USE_SOCKETS */
+#define USE_BPF
+#define HAVE_SA_LEN
+
+#ifdef _PATH_DHCLIENT_SCRIPT
+#undef _PATH_DHCLIENT_SCRIPT
+#endif
+#define _PATH_DHCLIENT_SCRIPT "/etc/dhclient-script"
+
+#ifndef _PATH_DHCLIENT_PID
+#undef _PATH_DHCLIENT_PID
+#endif
+#define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
+
+
+#ifdef NEED_PRAND_CONF
+/* these may have no meaning on any particular lynxos system */
+const char *cmds[] = {
+ "/bin/ps -axlw 2>&1",
+ "/sbin/arp -an 2>&1",
+ "/bin/netstat -an 2>&1",
+ "/bin/df 2>&1",
+ "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1",
+ "/usr/bin/uptime 2>&1",
+ "/bin/netstat -s 2>&1",
+ "/usr/bin/dig . soa +ti=1 +retry=0 2>&1",
+ "/usr/bin/vmstat 2>&1",
+ "/usr/bin/w 2>&1",
+ NULL
+};
+
+const char *dirs[] = {
+ "/tmp",
+ ".",
+ "/",
+ "/etc",
+ NULL
+};
+
+const char *files[] = {
+ "/proc/stat",
+ "/proc/rtc",
+ "/proc/meminfo",
+ "/proc/interrupts",
+ "/proc/self/status",
+ "/var/log/messages",
+ "/var/log/wtmp",
+ "/var/log/lastlog",
+ NULL
+};
+#endif /* NEED_PRAND_CONF */
diff -u -r -N dhcp-3.0.1/includes/osdep.h dhcp-work2/includes/osdep.h
--- dhcp-3.0.1/includes/osdep.h 2004-06-14 14:08:44.000000000 -0700
+++ dhcp-work2/includes/osdep.h 2004-08-27 09:04:14.000000000 -0700
@@ -133,6 +133,10 @@
# endif
#endif
+#ifdef __Lynx__
+# include "cf/lynxos.h"
+#endif
+
/* snprintf/vsnprintf hacks. for systems with no libc versions only. */
#ifdef NO_SNPRINTF
extern int isc_print_snprintf(char *, size_t, const char *, ...);
diff -u -r -N dhcp-3.0.1/Makefile.conf dhcp-work2/Makefile.conf
--- dhcp-3.0.1/Makefile.conf 2004-06-10 10:59:10.000000000 -0700
+++ dhcp-work2/Makefile.conf 2004-08-27 09:21:13.000000000 -0700
@@ -501,3 +501,14 @@
#FFMANEXT = .5
#MANINSTALL = install -i -m 444
##--hpux-gcc--
+
+## lynxos-3.1.0 cross from linux
+##--lynxos--
+#CC = ENV_PREFIX=/vobs/bf_devtools/lynx/3.1.0/x86 /vobs/bf_devtools/lynx/3.1.0/x86/cdk/linux-coff-x86/usr/bin/gcc
+#AR = ENV_PREFIX=/vobs/bf_devtools/lynx/3.1.0/x86 /vobs/bf_devtools/lynx/3.1.0/x86/cdk/linux-coff-x86/usr/bin/ar
+#RANLIB = ENV_PREFIX=/vobs/bf_devtools/lynx/3.1.0/x86 /vobs/bf_devtools/lynx/3.1.0/x86/cdk/linux-coff-x86/usr/bin/ranlib
+#CF = cf/lynxos.h
+#COPTS = -D__NO_INCLUDE_WARN__
+## I'm not sure about these
+#LIBS = -ldb -lbsd
+##--lynxos--
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2004-09-02 13:04 PDT by <rpixley at lotus>.
# Source directory was `/vobs/bf_3rd_party'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 4422 -rw------- dhcp-patch.01
# 6084 -rw------- dhcp-patch.02
# 11234 -rw------- dhcp-patch.03
# 5219 -rw------- dhcp-patch.04
# 4984 -rw------- dhcp-patch.05
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh24557; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= dhcp-patch.01 ==============
if test -f 'dhcp-patch.01' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dhcp-patch.01' '(file already exists)'
else
$echo 'x -' extracting 'dhcp-patch.01' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dhcp-patch.01' &&
Return-Path: <dhcp-hackers-bounce at isc.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
X by daffodil.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGI6h3031556
X for <rpixley at localhost>; Fri, 27 Aug 2004 09:18:06 -0700
Received: from gwianameserver.sj.symbol.com [157.235.95.252]
X by localhost with IMAP (fetchmail-6.2.0)
X for rpixley at localhost (single-drop); Fri, 27 Aug 2004 09:18:06 -0700 (PDT)
Received: from proxy.symbol.com
X ([157.235.5.10])
X by RUNABOUT; Fri, 27 Aug 2004 09:16:09 -0700
Received: from mx2.symbol.com (mx2.symbol.com [167.206.235.72])
X by proxy.symbol.com (8.12.11/8.12.8) with ESMTP id i7RGGFH3009020
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:16:15 -0400
Received: from mail20.messagelabs.com (mail20.messagelabs.com [66.28.8.211])
X by mx2.symbol.com (8.12.8/8.12.8) with SMTP id i7RGGEn6029501
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:16:14 -0400
XX-VirusChecked: Checked
XX-Env-Sender: dhcp-hackers-bounce at isc.org
XX-Msg-Ref: server-23.tower-20.messagelabs.com!1093623368!10099788
XX-StarScan-Version: 5.2.10; banners=sj.symbol.com,-,sj.symbol.com
XX-Originating-IP: [204.152.184.167]
XX-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 9508 invoked from network); 27 Aug 2004 16:16:08 -0000
Received: from mx-1.isc.org (HELO sf1.isc.org) (204.152.184.167)
X by server-23.tower-20.messagelabs.com with SMTP; 27 Aug 2004 16:16:08 -0000
Received: from rc3.isc.org (rc3.isc.org [IPv6:2001:4f8:3:bb:209:5bff:fe05:1b9c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP
X id 50FF72885E; Fri, 27 Aug 2004 16:16:00 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: from rc3.isc.org (rc3.isc.org [204.152.187.25])
X by rc3.isc.org (Postfix) with ESMTP id 7E1B75C8D9;
X Fri, 27 Aug 2004 16:15:24 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: with ECARTIS (v1.0.0; list dhcp-hackers); Fri, 27 Aug 2004 16:15:22 +0000 (UTC)
XX-Original-To: dhcp-hackers at rc3.isc.org
Received: from sf1.isc.org (mx-1.isc.org [IPv6:2001:4f8:0:2::1c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (Client did not present a certificate)
X by rc3.isc.org (Postfix) with ESMTP id 8DFF95C8CA
X for <dhcp-hackers at rc3.isc.org>; Fri, 27 Aug 2004 16:15:21 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (unknown [65.115.69.133])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP id CC5052885E
X for <dhcp-hackers at isc.org>; Fri, 27 Aug 2004 16:15:20 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (localhost.localdomain [127.0.0.1])
X by lotus.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGFKRf010617;
X Fri, 27 Aug 2004 09:15:20 -0700
Date: Fri, 27 Aug 2004 09:15:20 -0700
Message-Id: <200408271615.i7RGFKRf010617 at lotus.isw1.symbol.com>
XFrom: "K. Richard Pixley" <rpixley at symbol.com>
To: dhcp-hackers at isc.org
Subject: cross configure patch
XX-ecartis-version: Ecartis v1.0.0
Sender: dhcp-hackers-bounce at isc.org
Errors-To: dhcp-hackers-bounce at isc.org
XX-original-sender: rpixley at sj.symbol.com
Precedence: bulk
Reply-To: dhcp-hackers at isc.org
List-unsubscribe: <mailto:dhcp-hackers-request at isc.org?Subject=unsubscribe>
List-Id: <dhcp-hackers.isc.org>
XX-List-ID: <dhcp-hackers.isc.org>
XX-Scanned-By: MIMEDefang 2.39
XX-Spam-Status: No, hits=0.0 required=5.0
X tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS
X version=2.55
XX-Spam-Level:
XX-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X
The following patch makes it possible to configure the dhcp tree for
some target other than our current host using the syntax "./configure
othertarget".
X
It looks as though this were once possible but the code has
regressed. This patch restores this ability.
X
--rich
X
--- dhcp-3.0.1/configure 2002-04-20 14:44:13.000000000 -0700
+++ dhcp-work2/configure 2004-08-27 08:57:15.000000000 -0700
@@ -253,7 +253,7 @@
X
X # Make the link tree in which to actually build.
X if [ x$nolinks = x ]; then
- make links
+ make links sysname=${sysname}
X fi
X
X exit 0
X
X
X
________________________________________________________________________
This email has been scanned for computer viruses.
X
________________________________________________________________________
This email has been scanned for computer viruses.
SHAR_EOF
(set 20 04 09 02 12 17 31 'dhcp-patch.01'; eval "$shar_touch") &&
chmod 0600 'dhcp-patch.01' ||
$echo 'restore of' 'dhcp-patch.01' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dhcp-patch.01:' 'MD5 check failed'
48ea7ecfba704c2896664372cca728c5 dhcp-patch.01
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dhcp-patch.01'`"
test 4422 -eq "$shar_count" ||
$echo 'dhcp-patch.01:' 'original size' '4422,' 'current size' "$shar_count!"
fi
fi
# ============= dhcp-patch.02 ==============
if test -f 'dhcp-patch.02' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dhcp-patch.02' '(file already exists)'
else
$echo 'x -' extracting 'dhcp-patch.02' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dhcp-patch.02' &&
Return-Path: <dhcp-hackers-bounce at isc.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
X by daffodil.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGS7Uw031599
X for <rpixley at localhost>; Fri, 27 Aug 2004 09:28:07 -0700
Received: from gwianameserver.sj.symbol.com [157.235.95.252]
X by localhost with IMAP (fetchmail-6.2.0)
X for rpixley at localhost (single-drop); Fri, 27 Aug 2004 09:28:07 -0700 (PDT)
Received: from proxy.symbol.com
X ([157.235.5.10])
X by RUNABOUT; Fri, 27 Aug 2004 09:26:32 -0700
Received: from mx2.symbol.com (mx2.symbol.com [167.206.235.72])
X by proxy.symbol.com (8.12.11/8.12.8) with ESMTP id i7RGQbVJ011129
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:26:37 -0400
Received: from mail20.messagelabs.com (mail20.messagelabs.com [66.28.8.211])
X by mx2.symbol.com (8.12.8/8.12.8) with SMTP id i7RGQbn6031311
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:26:37 -0400
XX-VirusChecked: Checked
XX-Env-Sender: dhcp-hackers-bounce at isc.org
XX-Msg-Ref: server-23.tower-20.messagelabs.com!1093623990!10100214
XX-StarScan-Version: 5.2.10; banners=sj.symbol.com,-,sj.symbol.com
XX-Originating-IP: [204.152.184.167]
XX-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 21098 invoked from network); 27 Aug 2004 16:26:30 -0000
Received: from mx-1.isc.org (HELO sf1.isc.org) (204.152.184.167)
X by server-23.tower-20.messagelabs.com with SMTP; 27 Aug 2004 16:26:30 -0000
Received: from rc3.isc.org (rc3.isc.org [IPv6:2001:4f8:3:bb:209:5bff:fe05:1b9c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP
X id 60FBE28822; Fri, 27 Aug 2004 16:26:29 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: from rc3.isc.org (rc3.isc.org [204.152.187.25])
X by rc3.isc.org (Postfix) with ESMTP id 231F25C8DD;
X Fri, 27 Aug 2004 16:26:21 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: with ECARTIS (v1.0.0; list dhcp-hackers); Fri, 27 Aug 2004 16:26:20 +0000 (UTC)
XX-Original-To: dhcp-hackers at rc3.isc.org
Received: from sf1.isc.org (mx-1.isc.org [IPv6:2001:4f8:0:2::1c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (Client did not present a certificate)
X by rc3.isc.org (Postfix) with ESMTP id E64BE5C8DA
X for <dhcp-hackers at rc3.isc.org>; Fri, 27 Aug 2004 16:26:19 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (unknown [65.115.69.133])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP id 8BC1928811
X for <dhcp-hackers at isc.org>; Fri, 27 Aug 2004 16:26:19 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (localhost.localdomain [127.0.0.1])
X by lotus.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGQJh3011536;
X Fri, 27 Aug 2004 09:26:19 -0700
Date: Fri, 27 Aug 2004 09:26:19 -0700
Message-Id: <200408271626.i7RGQJh3011536 at lotus.isw1.symbol.com>
XFrom: "K. Richard Pixley" <rpixley at symbol.com>
To: dhcp-hackers at isc.org
Subject: patch - ar -> $(AR)
XX-ecartis-version: Ecartis v1.0.0
Sender: dhcp-hackers-bounce at isc.org
Errors-To: dhcp-hackers-bounce at isc.org
XX-original-sender: rpixley at sj.symbol.com
Precedence: bulk
Reply-To: dhcp-hackers at isc.org
List-unsubscribe: <mailto:dhcp-hackers-request at isc.org?Subject=unsubscribe>
List-Id: <dhcp-hackers.isc.org>
XX-List-ID: <dhcp-hackers.isc.org>
XX-Scanned-By: MIMEDefang 2.39
XX-Spam-Status: No, hits=0.0 required=5.0
X tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS
X version=2.55
XX-Spam-Level:
XX-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X
Calling ar from the path is just plain wrong in the general case as it
makes it impossible to override the default toolchain. One would want
to override the default toolchain if one were, say, testing a freshly
built toolchain, using a toolchain other than the vendor supplied
toolchain (say, GNU), or using a cross compilation toolchain.
X
Patch follows.
X
--rich
X
diff -u -r dhcp-3.0.1/common/Makefile.dist dhcp-work/common/Makefile.dist
--- dhcp-3.0.1/common/Makefile.dist 2004-06-14 14:08:42.000000000 -0700
+++ dhcp-work/common/Makefile.dist 2004-07-08 15:37:15.000000000 -0700
@@ -39,7 +39,7 @@
X
X libdhcp.a: $(OBJ)
X rm -f libdhcp.a
- ar cruv libdhcp.a $(OBJ)
+ $(AR) cruv libdhcp.a $(OBJ)
X $(RANLIB) libdhcp.a
X
X install: all
diff -u -r dhcp-3.0.1/dhcpctl/Makefile.dist dhcp-work/dhcpctl/Makefile.dist
--- dhcp-3.0.1/dhcpctl/Makefile.dist 2004-06-10 10:59:23.000000000 -0700
+++ dhcp-work/dhcpctl/Makefile.dist 2004-07-08 15:37:15.000000000 -0700
@@ -44,7 +44,7 @@
X
X libdhcpctl.a: $(OBJ)
X rm -f libdhcpctl.a
- ar cruv libdhcpctl.a $(OBJ)
+ $(AR) cruv libdhcpctl.a $(OBJ)
X $(RANLIB) libdhcpctl.a
X
X install: all $(CATMANPAGES)
diff -u -r dhcp-3.0.1/dst/Makefile.dist dhcp-work/dst/Makefile.dist
--- dhcp-3.0.1/dst/Makefile.dist 2004-06-10 10:59:28.000000000 -0700
+++ dhcp-work/dst/Makefile.dist 2004-07-08 15:37:15.000000000 -0700
@@ -34,7 +34,7 @@
X
X libdst.a: $(OBJ)
X rm -f dst.a
- ar cruv libdst.a $(OBJ)
+ $(AR) cruv libdst.a $(OBJ)
X $(RANLIB) libdst.a
X
X depend:
diff -u -r dhcp-3.0.1/minires/Makefile.dist dhcp-work/minires/Makefile.dist
--- dhcp-3.0.1/minires/Makefile.dist 2004-06-10 10:59:40.000000000 -0700
+++ dhcp-work/minires/Makefile.dist 2004-07-08 15:37:15.000000000 -0700
@@ -40,7 +40,7 @@
X
X libres.a: $(OBJ)
X rm -f res.a
- ar cruv libres.a $(OBJ)
+ $(AR) cruv libres.a $(OBJ)
X $(RANLIB) libres.a
X
X depend:
diff -u -r dhcp-3.0.1/omapip/Makefile.dist dhcp-work/omapip/Makefile.dist
--- dhcp-3.0.1/omapip/Makefile.dist 2004-06-14 14:08:50.000000000 -0700
+++ dhcp-work/omapip/Makefile.dist 2004-07-08 15:37:15.000000000 -0700
@@ -48,7 +48,7 @@
X
X libomapi.a: $(OBJ)
X rm -f libomapi.a
- ar cruv libomapi.a $(OBJ)
+ $(AR) cruv libomapi.a $(OBJ)
X $(RANLIB) libomapi.a
X
X install: all
X
X
X
________________________________________________________________________
This email has been scanned for computer viruses.
X
________________________________________________________________________
This email has been scanned for computer viruses.
SHAR_EOF
(set 20 04 09 02 12 17 47 'dhcp-patch.02'; eval "$shar_touch") &&
chmod 0600 'dhcp-patch.02' ||
$echo 'restore of' 'dhcp-patch.02' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dhcp-patch.02:' 'MD5 check failed'
29a1afdaf9f6dffc672d47d0a05ffb08 dhcp-patch.02
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dhcp-patch.02'`"
test 6084 -eq "$shar_count" ||
$echo 'dhcp-patch.02:' 'original size' '6084,' 'current size' "$shar_count!"
fi
fi
# ============= dhcp-patch.03 ==============
if test -f 'dhcp-patch.03' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dhcp-patch.03' '(file already exists)'
else
$echo 'x -' extracting 'dhcp-patch.03' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dhcp-patch.03' &&
Return-Path: <dhcp-hackers-bounce at isc.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
X by daffodil.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGh9vw031641
X for <rpixley at localhost>; Fri, 27 Aug 2004 09:43:09 -0700
Received: from gwianameserver.sj.symbol.com [157.235.95.252]
X by localhost with IMAP (fetchmail-6.2.0)
X for rpixley at localhost (single-drop); Fri, 27 Aug 2004 09:43:09 -0700 (PDT)
Received: from proxy.symbol.com
X ([157.235.5.10])
X by RUNABOUT; Fri, 27 Aug 2004 09:40:53 -0700
Received: from mx2.symbol.com (mx2.symbol.com [167.206.235.72])
X by proxy.symbol.com (8.12.11/8.12.8) with ESMTP id i7RGetfj014016
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:40:55 -0400
Received: from mail20.messagelabs.com (mail20.messagelabs.com [66.28.8.211])
X by mx2.symbol.com (8.12.8/8.12.8) with SMTP id i7RGetn6001574
X for <rpixley at sj.symbol.com>; Fri, 27 Aug 2004 12:40:55 -0400
XX-VirusChecked: Checked
XX-Env-Sender: dhcp-hackers-bounce at isc.org
XX-Msg-Ref: server-6.tower-20.messagelabs.com!1093624848!9535775
XX-StarScan-Version: 5.2.10; banners=sj.symbol.com,-,sj.symbol.com
XX-Originating-IP: [204.152.184.167]
XX-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 31846 invoked from network); 27 Aug 2004 16:40:49 -0000
Received: from mx-1.isc.org (HELO sf1.isc.org) (204.152.184.167)
X by server-6.tower-20.messagelabs.com with SMTP; 27 Aug 2004 16:40:49 -0000
Received: from rc3.isc.org (rc3.isc.org [IPv6:2001:4f8:3:bb:209:5bff:fe05:1b9c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP
X id D42912885D; Fri, 27 Aug 2004 16:40:47 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: from rc3.isc.org (rc3.isc.org [204.152.187.25])
X by rc3.isc.org (Postfix) with ESMTP id 58DE45C8D9;
X Fri, 27 Aug 2004 16:40:39 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: with ECARTIS (v1.0.0; list dhcp-hackers); Fri, 27 Aug 2004 16:40:38 +0000 (UTC)
XX-Original-To: dhcp-hackers at rc3.isc.org
Received: from sf1.isc.org (mx-1.isc.org [IPv6:2001:4f8:0:2::1c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (Client did not present a certificate)
X by rc3.isc.org (Postfix) with ESMTP id 076C15C8CA
X for <dhcp-hackers at rc3.isc.org>; Fri, 27 Aug 2004 16:40:37 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (unknown [65.115.69.133])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP id 6CE1628862
X for <dhcp-hackers at isc.org>; Fri, 27 Aug 2004 16:40:33 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (localhost.localdomain [127.0.0.1])
X by lotus.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i7RGeWqD011991;
X Fri, 27 Aug 2004 09:40:32 -0700
Date: Fri, 27 Aug 2004 09:40:32 -0700
Message-Id: <200408271640.i7RGeWqD011991 at lotus.isw1.symbol.com>
XFrom: "K. Richard Pixley" <rpixley at symbol.com>
To: dhcp-hackers at isc.org
Subject: patch - berkeley commons not portable
XX-ecartis-version: Ecartis v1.0.0
Sender: dhcp-hackers-bounce at isc.org
Errors-To: dhcp-hackers-bounce at isc.org
XX-original-sender: rpixley at sj.symbol.com
Precedence: bulk
Reply-To: dhcp-hackers at isc.org
List-unsubscribe: <mailto:dhcp-hackers-request at isc.org?Subject=unsubscribe>
List-Id: <dhcp-hackers.isc.org>
XX-List-ID: <dhcp-hackers.isc.org>
XX-Scanned-By: MIMEDefang 2.39
XX-Spam-Status: No, hits=0.0 required=5.0
X tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS
X version=2.55
XX-Spam-Level:
XX-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X
Not all toolchains use the berkeley style of commons definitions or
resolutions. On some toolchains, multiple definitions result in
linkage errors due to collisions. The more portable technique is to
declare commons exactly once and to declare references in the other
places where such commons are used.
X
The following patch uses externs, changes in declaration scope, and
some code motion to correct a number of these collisions.
X
--rich
X
--- dhcp-3.0.1/client/dhclient.c 2004-07-09 17:11:16.000000000 -0700
+++ dhcp-work2/client/dhclient.c 2004-08-27 09:29:22.000000000 -0700
@@ -66,8 +66,6 @@
X static char message [] = "Internet Systems Consortium DHCP Client";
X static char url [] = "For info, please visit http://www.isc.org/products/DHCP";
X
-u_int16_t local_port=0;
-u_int16_t remote_port=0;
X int no_daemon=0;
X struct string_list *client_env=NULL;
X int client_env_count=0;
diff -u -r dhcp-3.0.1/common/comapi.c dhcp-work/common/comapi.c
--- dhcp-3.0.1/common/comapi.c 2004-06-10 10:59:14.000000000 -0700
+++ dhcp-work/common/comapi.c 2004-07-08 16:01:43.000000000 -0700
@@ -53,7 +53,6 @@
X OMAPI_OBJECT_ALLOC (group_object, struct group_object, dhcp_type_group)
X OMAPI_OBJECT_ALLOC (dhcp_control, dhcp_control_object_t, dhcp_type_control)
X
-omapi_object_type_t *dhcp_type_interface;
X omapi_object_type_t *dhcp_type_group;
X omapi_object_type_t *dhcp_type_shared_network;
X omapi_object_type_t *dhcp_type_subnet;
diff -u -r dhcp-3.0.1/common/discover.c dhcp-work/common/discover.c
--- dhcp-3.0.1/common/discover.c 2004-06-10 10:59:16.000000000 -0700
+++ dhcp-work/common/discover.c 2004-07-08 16:50:27.000000000 -0700
@@ -58,7 +58,6 @@
X unsigned int,
X struct iaddr, struct hardware *));
X
-omapi_object_type_t *dhcp_type_interface;
X #if defined (TRACING)
X trace_type_t *interface_trace;
X trace_type_t *inpacket_trace;
@@ -69,6 +68,7 @@
X int interface_max;
X
X OMAPI_OBJECT_ALLOC (interface, struct interface_info, dhcp_type_interface)
+omapi_object_type_t *dhcp_type_interface;
X
X isc_result_t interface_setup ()
X {
diff -u -r dhcp-3.0.1/common/parse.c dhcp-work/common/parse.c
--- dhcp-3.0.1/common/parse.c 2004-06-17 13:54:38.000000000 -0700
+++ dhcp-work/common/parse.c 2004-07-08 16:53:28.000000000 -0700
@@ -44,6 +44,14 @@
X
X struct enumeration *enumerations;
X
+struct collection default_collection = {
+ (struct collection *)0,
+ "default",
+ (struct class *)0,
+};
+
+struct collection *collections = &default_collection;
+
X void add_enumeration (struct enumeration *enumeration)
X {
X enumeration -> next = enumerations;
diff -u -r dhcp-3.0.1/includes/dhcpd.h dhcp-work/includes/dhcpd.h
--- dhcp-3.0.1/includes/dhcpd.h 2004-06-10 10:59:29.000000000 -0700
+++ dhcp-work/includes/dhcpd.h 2004-07-08 16:21:36.000000000 -0700
@@ -1118,7 +1118,7 @@
X /* dhcpd.c */
X extern TIME cur_time;
X
-int ddns_update_style;
+extern int ddns_update_style;
X
X extern const char *path_dhcpd_conf;
X extern const char *path_dhcpd_db;
@@ -1133,7 +1133,7 @@
X void lease_pinged PROTO ((struct iaddr, u_int8_t *, int));
X void lease_ping_timeout PROTO ((void *));
X int dhcpd_interface_setup_hook (struct interface_info *ip, struct iaddr *ia);
-enum dhcp_shutdown_state shutdown_state;
+extern enum dhcp_shutdown_state shutdown_state;
X isc_result_t dhcp_io_shutdown (omapi_object_t *, void *);
X isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
X control_object_state_t newstate);
@@ -1391,7 +1391,7 @@
X void bootp PROTO ((struct packet *));
X
X /* memory.c */
-int (*group_write_hook) (struct group_object *);
+extern int (*group_write_hook) (struct group_object *);
X extern struct group *root_group;
X extern group_hash_t *group_name_hash;
X isc_result_t delete_group (struct group_object *, int);
@@ -1731,7 +1731,7 @@
X extern int (*dhcp_interface_setup_hook) (struct interface_info *,
X struct iaddr *);
X extern int (*dhcp_interface_discovery_hook) (struct interface_info *);
-isc_result_t (*dhcp_interface_startup_hook) (struct interface_info *);
+extern isc_result_t (*dhcp_interface_startup_hook) (struct interface_info *);
X
X extern void (*bootp_packet_handler) PROTO ((struct interface_info *,
X struct dhcp_packet *, unsigned,
@@ -1740,9 +1740,9 @@
X extern struct timeout *timeouts;
X extern omapi_object_type_t *dhcp_type_interface;
X #if defined (TRACING)
-trace_type_t *interface_trace;
-trace_type_t *inpacket_trace;
-trace_type_t *outpacket_trace;
+extern trace_type_t *interface_trace;
+extern trace_type_t *inpacket_trace;
+extern trace_type_t *outpacket_trace;
X #endif
X extern struct interface_info **interface_vector;
X extern int interface_count;
@@ -1794,11 +1794,11 @@
X extern int dhcp_option_default_priority_list [];
X extern int dhcp_option_default_priority_list_count;
X extern const char *hardware_types [256];
-int universe_count, universe_max;
-struct universe **universes;
+extern int universe_count, universe_max;
+extern struct universe **universes;
X extern universe_hash_t *universe_hash;
X void initialize_common_option_spaces PROTO ((void));
-struct universe *config_universe;
+extern struct universe *config_universe;
X
X /* stables.c */
X #if defined (FAILOVER_PROTOCOL)
@@ -2055,8 +2055,8 @@
X
X /* resolv.c */
X extern char path_resolv_conf [];
-struct name_server *name_servers;
-struct domain_search_list *domains;
+extern struct name_server *name_servers;
+extern struct domain_search_list *domains;
X
X void read_resolv_conf PROTO ((TIME));
X struct name_server *first_name_server PROTO ((void));
@@ -2068,11 +2068,11 @@
X
X /* class.c */
X extern int have_billing_classes;
-struct class unknown_class;
-struct class known_class;
-struct collection default_collection;
-struct collection *collections;
-struct executable_statement *default_classification_rules;
+extern struct class unknown_class;
+extern struct class known_class;
+extern struct collection default_collection;
+extern struct collection *collections;
+extern struct executable_statement *default_classification_rules;
X
X void classification_setup PROTO ((void));
X void classify_client PROTO ((struct packet *));
--- dhcp-3.0.1/relay/dhcrelay.c 2004-07-09 17:11:17.000000000 -0700
+++ dhcp-work2/relay/dhcrelay.c 2004-08-27 09:29:22.000000000 -0700
@@ -91,9 +91,6 @@
X forward_untouched, /* Forward without changes. */
X discard } agent_relay_mode = forward_and_replace;
X
-u_int16_t local_port;
-u_int16_t remote_port;
-
X struct server_list {
X struct server_list *next;
X struct sockaddr_in to;
diff -u -r dhcp-3.0.1/server/class.c dhcp-work/server/class.c
--- dhcp-3.0.1/server/class.c 2004-06-10 10:59:51.000000000 -0700
+++ dhcp-work/server/class.c 2004-07-08 16:53:27.000000000 -0700
@@ -40,13 +40,6 @@
X
X #include "dhcpd.h"
X
-struct collection default_collection = {
- (struct collection *)0,
- "default",
- (struct class *)0,
-};
-
-struct collection *collections = &default_collection;
X struct executable_statement *default_classification_rules;
X
X int have_billing_classes;
diff -u -r dhcp-3.0.1/server/mdb.c dhcp-work/server/mdb.c
--- dhcp-3.0.1/server/mdb.c 2004-06-10 10:59:56.000000000 -0700
+++ dhcp-work/server/mdb.c 2004-07-08 16:00:49.000000000 -0700
@@ -49,8 +49,6 @@
X lease_hash_t *lease_ip_addr_hash;
X lease_hash_t *lease_hw_addr_hash;
X
-omapi_object_type_t *dhcp_type_host;
-
X static int find_uid_statement (struct executable_statement *esp,
X void *vp, int condp)
X {
X
X
X
________________________________________________________________________
This email has been scanned for computer viruses.
X
________________________________________________________________________
This email has been scanned for computer viruses.
SHAR_EOF
(set 20 04 09 02 12 18 01 'dhcp-patch.03'; eval "$shar_touch") &&
chmod 0600 'dhcp-patch.03' ||
$echo 'restore of' 'dhcp-patch.03' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dhcp-patch.03:' 'MD5 check failed'
71ed95fac1ad38218fdc82e6dc5e5b02 dhcp-patch.03
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dhcp-patch.03'`"
test 11234 -eq "$shar_count" ||
$echo 'dhcp-patch.03:' 'original size' '11234,' 'current size' "$shar_count!"
fi
fi
# ============= dhcp-patch.04 ==============
if test -f 'dhcp-patch.04' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dhcp-patch.04' '(file already exists)'
else
$echo 'x -' extracting 'dhcp-patch.04' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dhcp-patch.04' &&
Return-Path: <dhcp-hackers-bounce at isc.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
X by daffodil.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i82JcQiK002511
X for <rpixley at localhost>; Thu, 2 Sep 2004 12:38:26 -0700
Received: from gwianameserver.sj.symbol.com [157.235.95.252]
X by localhost with IMAP (fetchmail-6.2.0)
X for rpixley at localhost (single-drop); Thu, 02 Sep 2004 12:38:26 -0700 (PDT)
Received: from proxy.symbol.com
X ([157.235.5.10])
X by RUNABOUT; Thu, 02 Sep 2004 12:33:51 -0700
Received: from mx2.symbol.com (mx2.symbol.com [167.206.235.72])
X by proxy.symbol.com (8.12.11/8.12.8) with ESMTP id i82JXoWp027944
X for <rpixley at sj.symbol.com>; Thu, 2 Sep 2004 15:33:50 -0400
Received: from mail20.messagelabs.com (mail20.messagelabs.com [66.28.8.211])
X by mx2.symbol.com (8.12.8/8.12.8) with SMTP id i82JXon6010624
X for <rpixley at sj.symbol.com>; Thu, 2 Sep 2004 15:33:50 -0400
XX-VirusChecked: Checked
XX-Env-Sender: dhcp-hackers-bounce at isc.org
XX-Msg-Ref: server-12.tower-20.messagelabs.com!1094153624!13020354
XX-StarScan-Version: 5.2.10; banners=sj.symbol.com,-,sj.symbol.com
XX-Originating-IP: [204.152.184.167]
XX-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 19219 invoked from network); 2 Sep 2004 19:33:44 -0000
Received: from mx-1.isc.org (HELO sf1.isc.org) (204.152.184.167)
X by server-12.tower-20.messagelabs.com with SMTP; 2 Sep 2004 19:33:44 -0000
Received: from rc3.isc.org (rc3.isc.org [IPv6:2001:4f8:3:bb:209:5bff:fe05:1b9c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP
X id 5D19B2860F; Thu, 2 Sep 2004 19:33:41 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: from rc3.isc.org (rc3.isc.org [204.152.187.25])
X by rc3.isc.org (Postfix) with ESMTP id 19DB95C8D9;
X Thu, 2 Sep 2004 19:33:19 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: with ECARTIS (v1.0.0; list dhcp-hackers); Thu, 02 Sep 2004 19:33:19 +0000 (UTC)
XX-Original-To: dhcp-hackers at rc3.isc.org
Received: from sf1.isc.org (mx-1.isc.org [IPv6:2001:4f8:0:2::1c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (Client did not present a certificate)
X by rc3.isc.org (Postfix) with ESMTP id C9C695C8C8
X for <dhcp-hackers at rc3.isc.org>; Thu, 2 Sep 2004 19:33:18 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (unknown [65.115.69.133])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP id 39A402860F
X for <dhcp-hackers at isc.org>; Thu, 2 Sep 2004 19:33:18 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (localhost.localdomain [127.0.0.1])
X by lotus.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i82JXHFj022278;
X Thu, 2 Sep 2004 12:33:17 -0700
Date: Thu, 2 Sep 2004 12:33:17 -0700
Message-Id: <200409021933.i82JXHFj022278 at lotus.isw1.symbol.com>
XFrom: "K. Richard Pixley" <rpixley at symbol.com>
To: dhcp-hackers at isc.org
Subject: writev workaround
XX-ecartis-version: Ecartis v1.0.0
Sender: dhcp-hackers-bounce at isc.org
Errors-To: dhcp-hackers-bounce at isc.org
XX-original-sender: rpixley at sj.symbol.com
Precedence: bulk
Reply-To: dhcp-hackers at isc.org
List-unsubscribe: <mailto:dhcp-hackers-request at isc.org?Subject=unsubscribe>
List-Id: <dhcp-hackers.isc.org>
XX-List-ID: <dhcp-hackers.isc.org>
XX-Scanned-By: MIMEDefang 2.39
XX-Spam-Status: No, hits=3.5 required=5.0
X tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS,RCVD_IN_OSIRUSOFT_COM,
X X_OSIRU_OPEN_RELAY
X version=2.55
XX-Spam-Level: ***
XX-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X
At least one operating system vendor, (LynxOs from Lynuxwork,
http://www.lnxw.com), releases a system with a broken writev
implentation, at least for bpf. This problem was reported to
Lynuxworks by a supported customer, (yours truley) on August 8, 2004
as call reference number 46678.
X
In the mean time, this patch works around the problem in the most
obvious and transparent method I could think of, (although this does
presuppose gcc or some other compiler capable of allocating dynamic
arrays).
X
--rich
X
diff -u -r dhcp-3.0.1/common/bpf.c dhcp-work2/common/bpf.c
--- dhcp-3.0.1/common/bpf.c 2004-06-17 13:54:38.000000000 -0700
+++ dhcp-work2/common/bpf.c 2004-08-27 09:43:29.000000000 -0700
@@ -366,6 +366,7 @@
X (unsigned char *)raw, len);
X
X /* Fire it off */
+#ifndef HAVE_BROKEN_WRITEV
X iov [0].iov_base = ((char *)hw);
X iov [0].iov_len = hbufp;
X iov [1].iov_base = ((char *)ip);
@@ -374,6 +375,18 @@
X iov [2].iov_len = len;
X
X result = writev(interface -> wfdesc, iov, 3);
+#else
+ {
+ int l = hbufp + ibufp + len;
+ char b[l];
+
+ memcpy(b, (char *)hw, hbufp);
+ memcpy(b + hbufp, (char *)ip, ibufp);
+ memcpy(b + hbufp + ibufp, (char *)raw, len);
+
+ result = write(interface -> wfdesc, b, l);
+ }
+#endif
X if (result < 0)
X log_error ("send_packet: %m");
X return result;
X
X
X
________________________________________________________________________
This email has been scanned for computer viruses.
X
________________________________________________________________________
This email has been scanned for computer viruses.
SHAR_EOF
(set 20 04 09 02 12 48 46 'dhcp-patch.04'; eval "$shar_touch") &&
chmod 0600 'dhcp-patch.04' ||
$echo 'restore of' 'dhcp-patch.04' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dhcp-patch.04:' 'MD5 check failed'
9d3e14f2ce83140f16d0bbfe0f180b5d dhcp-patch.04
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dhcp-patch.04'`"
test 5219 -eq "$shar_count" ||
$echo 'dhcp-patch.04:' 'original size' '5219,' 'current size' "$shar_count!"
fi
fi
# ============= dhcp-patch.05 ==============
if test -f 'dhcp-patch.05' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dhcp-patch.05' '(file already exists)'
else
$echo 'x -' extracting 'dhcp-patch.05' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dhcp-patch.05' &&
Return-Path: <dhcp-hackers-bounce at isc.org>
Received: from localhost (localhost.localdomain [127.0.0.1])
X by daffodil.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i82JhQVF002546
X for <rpixley at localhost>; Thu, 2 Sep 2004 12:43:27 -0700
Received: from gwianameserver.sj.symbol.com [157.235.95.252]
X by localhost with IMAP (fetchmail-6.2.0)
X for rpixley at localhost (single-drop); Thu, 02 Sep 2004 12:43:27 -0700 (PDT)
Received: from proxy.symbol.com
X ([157.235.5.10])
X by RUNABOUT; Thu, 02 Sep 2004 12:39:06 -0700
Received: from mx2.symbol.com (mx2.symbol.com [167.206.235.72])
X by proxy.symbol.com (8.12.11/8.12.8) with ESMTP id i82JdAS7028887
X for <rpixley at sj.symbol.com>; Thu, 2 Sep 2004 15:39:10 -0400
Received: from mail20.messagelabs.com (mail20.messagelabs.com [66.28.8.211])
X by mx2.symbol.com (8.12.8/8.12.8) with SMTP id i82Jd9n6011692
X for <rpixley at sj.symbol.com>; Thu, 2 Sep 2004 15:39:10 -0400
XX-VirusChecked: Checked
XX-Env-Sender: dhcp-hackers-bounce at isc.org
XX-Msg-Ref: server-2.tower-20.messagelabs.com!1094153941!10688987
XX-StarScan-Version: 5.2.10; banners=sj.symbol.com,-,sj.symbol.com
XX-Originating-IP: [204.152.184.167]
XX-SpamReason: No, hits=0.0 required=7.0 tests=
Received: (qmail 9369 invoked from network); 2 Sep 2004 19:39:03 -0000
Received: from mx-1.isc.org (HELO sf1.isc.org) (204.152.184.167)
X by server-2.tower-20.messagelabs.com with SMTP; 2 Sep 2004 19:39:03 -0000
Received: from rc3.isc.org (rc3.isc.org [IPv6:2001:4f8:3:bb:209:5bff:fe05:1b9c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP
X id 30D4E284DF; Thu, 2 Sep 2004 19:39:01 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: from rc3.isc.org (rc3.isc.org [204.152.187.25])
X by rc3.isc.org (Postfix) with ESMTP id D8F975C8D9;
X Thu, 2 Sep 2004 19:38:52 +0000 (UTC)
X (envelope-from dhcp-hackers-bounce at isc.org)
Received: with ECARTIS (v1.0.0; list dhcp-hackers); Thu, 02 Sep 2004 19:38:52 +0000 (UTC)
XX-Original-To: dhcp-hackers at rc3.isc.org
Received: from sf1.isc.org (mx-1.isc.org [IPv6:2001:4f8:0:2::1c])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (Client did not present a certificate)
X by rc3.isc.org (Postfix) with ESMTP id 5C6AD5C8C8
X for <dhcp-hackers at rc3.isc.org>; Thu, 2 Sep 2004 19:38:51 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (unknown [65.115.69.133])
X (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
X (No client certificate requested)
X by sf1.isc.org (Postfix) with ESMTP id D9CD6284DC
X for <dhcp-hackers at isc.org>; Thu, 2 Sep 2004 19:38:50 +0000 (UTC)
X (envelope-from rpixley at sj.symbol.com)
Received: from lotus.isw1.symbol.com (localhost.localdomain [127.0.0.1])
X by lotus.isw1.symbol.com (8.12.11/8.12.11) with ESMTP id i82JcocN022284;
X Thu, 2 Sep 2004 12:38:50 -0700
Date: Thu, 2 Sep 2004 12:38:50 -0700
Message-Id: <200409021938.i82JcocN022284 at lotus.isw1.symbol.com>
XFrom: "K. Richard Pixley" <rpixley at symbol.com>
To: dhcp-hackers at isc.org
Subject: ancient berkeley packet munging bug
XX-ecartis-version: Ecartis v1.0.0
Sender: dhcp-hackers-bounce at isc.org
Errors-To: dhcp-hackers-bounce at isc.org
XX-original-sender: rpixley at sj.symbol.com
Precedence: bulk
Reply-To: dhcp-hackers at isc.org
List-unsubscribe: <mailto:dhcp-hackers-request at isc.org?Subject=unsubscribe>
List-Id: <dhcp-hackers.isc.org>
XX-List-ID: <dhcp-hackers.isc.org>
XX-Scanned-By: MIMEDefang 2.39
XX-Spam-Status: No, hits=3.5 required=5.0
X tests=PATCH_UNIFIED_DIFF,RCVD_IN_ORBS,RCVD_IN_OSIRUSOFT_COM,
X X_OSIRU_OPEN_RELAY
X version=2.55
XX-Spam-Level: ***
XX-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X
At least one operating system vendor, (LynxOs from Lynuxworks,
http://lnxw.com), releases a version of bpf which munges outgoing
packets, although in a predicatable fashion. It would appear from
this info: http://www.whitefang.com/rin/rawfaq.html#14, as though this
were actually an ancient bug inherited from berkeley which was never
corrected.
X
This bug was reported to Lynuxwork by a supported customer, (yours
truley), on August 25, 2004 as call reference number 46676.
X
In the mean time, this patch works around the problem.
X
--rich
X
diff -u -r dhcp-3.0.1/common/ethernet.c dhcp-work2/common/ethernet.c
--- dhcp-3.0.1/common/ethernet.c 2004-06-10 10:59:17.000000000 -0700
+++ dhcp-work2/common/ethernet.c 2004-08-27 09:46:57.000000000 -0700
@@ -65,8 +65,11 @@
X else
X memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost));
X
+#ifndef HAVE_ANCIENT_BERKELEY_PACKET_MUNGING_BUG
X eh.ether_type = htons (ETHERTYPE_IP);
-
+#else
+ eh.ether_type = ETHERTYPE_IP;
+#endif
X memcpy (&buf [*bufix], &eh, ETHER_HEADER_SIZE);
X *bufix += ETHER_HEADER_SIZE;
X }
X
X
X
________________________________________________________________________
This email has been scanned for computer viruses.
X
________________________________________________________________________
This email has been scanned for computer viruses.
SHAR_EOF
(set 20 04 09 02 12 48 55 'dhcp-patch.05'; eval "$shar_touch") &&
chmod 0600 'dhcp-patch.05' ||
$echo 'restore of' 'dhcp-patch.05' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dhcp-patch.05:' 'MD5 check failed'
443f96867c92c6f9c952ed577702345b dhcp-patch.05
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dhcp-patch.05'`"
test 4984 -eq "$shar_count" ||
$echo 'dhcp-patch.05:' 'original size' '4984,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh24557
exit 0
More information about the dhcp-hackers
mailing list