PERFORCE change 34521 for review
Marcel Moolenaar
marcel at FreeBSD.org
Mon Jul 14 21:19:57 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=34521
Change 34521 by marcel at marcel_nfs on 2003/07/14 21:19:14
IFC @34520
Affected files ...
.. //depot/projects/ia64/Makefile.inc1#75 integrate
.. //depot/projects/ia64/etc/rc.d/cleanvar#5 integrate
.. //depot/projects/ia64/etc/rc.d/ipmon#6 integrate
.. //depot/projects/ia64/games/fortune/datfiles/fortunes#30 integrate
.. //depot/projects/ia64/include/histedit.h#3 integrate
.. //depot/projects/ia64/rescue/rescue/Makefile#5 integrate
.. //depot/projects/ia64/sbin/ipfw/ipfw2.c#22 integrate
.. //depot/projects/ia64/sbin/ping/ping.c#24 integrate
.. //depot/projects/ia64/share/man/man4/utopia.4#2 integrate
.. //depot/projects/ia64/share/man/man9/utopia.9#2 integrate
.. //depot/projects/ia64/sys/alpha/alpha/machdep.c#31 integrate
.. //depot/projects/ia64/sys/amd64/amd64/machdep.c#9 integrate
.. //depot/projects/ia64/sys/conf/files#87 integrate
.. //depot/projects/ia64/sys/dev/pccard/pccarddevs#29 integrate
.. //depot/projects/ia64/sys/dev/pccard/pccarddevs.h#29 integrate
.. //depot/projects/ia64/sys/dev/usb/ohci.c#17 integrate
.. //depot/projects/ia64/sys/dev/usb/ubsa.c#6 integrate
.. //depot/projects/ia64/sys/dev/usb/ucom.c#10 integrate
.. //depot/projects/ia64/sys/dev/usb/uftdi.c#8 integrate
.. //depot/projects/ia64/sys/dev/usb/ugen.c#15 integrate
.. //depot/projects/ia64/sys/dev/usb/uhci.c#18 integrate
.. //depot/projects/ia64/sys/dev/usb/uhid.c#13 integrate
.. //depot/projects/ia64/sys/dev/usb/uhub.c#8 integrate
.. //depot/projects/ia64/sys/dev/usb/uplcom.c#8 integrate
.. //depot/projects/ia64/sys/dev/usb/usb.c#14 integrate
.. //depot/projects/ia64/sys/dev/usb/usb_port.h#12 integrate
.. //depot/projects/ia64/sys/dev/usb/usb_subr.c#11 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdevs#43 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdevs.h#41 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdevs_data.h#41 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdi.c#11 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdi.h#7 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdi_util.c#7 integrate
.. //depot/projects/ia64/sys/dev/usb/usbdivar.h#8 integrate
.. //depot/projects/ia64/sys/dev/usb/uscanner.c#12 integrate
.. //depot/projects/ia64/sys/dev/usb/uvisor.c#7 integrate
.. //depot/projects/ia64/sys/dev/utopia/idtphy.h#2 integrate
.. //depot/projects/ia64/sys/dev/utopia/utopia.c#2 integrate
.. //depot/projects/ia64/sys/dev/utopia/utopia.h#2 integrate
.. //depot/projects/ia64/sys/dev/wi/if_wi_pccard.c#24 integrate
.. //depot/projects/ia64/sys/i386/i386/machdep.c#42 integrate
.. //depot/projects/ia64/sys/kern/uipc_socket.c#32 integrate
.. //depot/projects/ia64/sys/modules/acpi/Makefile#11 integrate
.. //depot/projects/ia64/sys/pc98/i386/machdep.c#38 integrate
.. //depot/projects/ia64/sys/powerpc/powerpc/machdep.c#29 integrate
.. //depot/projects/ia64/sys/sparc64/sparc64/machdep.c#42 integrate
.. //depot/projects/ia64/sys/sys/proc.h#70 integrate
.. //depot/projects/ia64/usr.sbin/Makefile#44 integrate
.. //depot/projects/ia64/usr.sbin/apm/Makefile#4 integrate
.. //depot/projects/ia64/usr.sbin/apm/zzz.8#2 delete
.. //depot/projects/ia64/usr.sbin/apm/zzz.sh#2 delete
.. //depot/projects/ia64/usr.sbin/lpr/common_source/common.c#7 integrate
.. //depot/projects/ia64/usr.sbin/lpr/common_source/displayq.c#3 integrate
.. //depot/projects/ia64/usr.sbin/lpr/common_source/printcap.c#4 integrate
.. //depot/projects/ia64/usr.sbin/lpr/common_source/request.c#3 integrate
.. //depot/projects/ia64/usr.sbin/lpr/common_source/rmjob.c#3 integrate
.. //depot/projects/ia64/usr.sbin/lpr/common_source/startdaemon.c#4 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpc/cmds.c#6 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpc/cmdtab.c#4 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpc/extern.h#4 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpc/lpc.c#4 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpc/movejobs.c#3 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/extern.h#2 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/lpd.c#7 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/lpdchar.c#2 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/modes.c#2 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/printjob.c#8 integrate
.. //depot/projects/ia64/usr.sbin/lpr/lpd/recvjob.c#4 integrate
.. //depot/projects/ia64/usr.sbin/zzz/Makefile#1 branch
.. //depot/projects/ia64/usr.sbin/zzz/zzz.8#1 branch
.. //depot/projects/ia64/usr.sbin/zzz/zzz.sh#1 branch
Differences ...
==== //depot/projects/ia64/Makefile.inc1#75 (text+ko) ====
@@ -1,14 +1,14 @@
#
-# $FreeBSD: src/Makefile.inc1,v 1.380 2003/07/11 17:01:58 gordon Exp $
+# $FreeBSD: src/Makefile.inc1,v 1.381 2003/07/14 16:21:16 gordon Exp $
#
# Make command line options:
# -DNO_KERBEROS Do not build Heimdal (Kerberos 5)
+# -DNO_RESCUE do not build rescue binaries
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
# -DNOCLEAN do not clean at all
# -DNOCRYPT will prevent building of crypt versions
# -DNOMAN do not build the manual pages
# -DNOPROFILE do not build profiled libraries
-# -DNORESCUE do not build rescue binaries
# -DNOGAMES do not go into games subdir
# -DNOSHARE do not go into share subdir
# -DNOINFO do not make or install info files
@@ -67,7 +67,7 @@
.if exists(${.CURDIR}/libexec)
SUBDIR+= libexec
.endif
-.if exists(${.CURDIR}/rescue) && !defined(NORESCUE)
+.if exists(${.CURDIR}/rescue) && !defined(NO_RESCUE)
SUBDIR+= rescue
.endif
.if exists(${.CURDIR}/sbin)
@@ -668,7 +668,7 @@
_yacc= usr.bin/yacc
.endif
-.if !defined(NORESCUE) && \
+.if !defined(NO_RESCUE) && \
${BOOTSTRAPPING} < 501100
_crunchgen= usr.sbin/crunch/crunchgen
.endif
@@ -722,7 +722,7 @@
kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
.endif
-.if exists(${.CURDIR}/rescue) && !defined(NORESCUE)
+.if exists(${.CURDIR}/rescue) && !defined(NO_RESCUE)
_rescue= rescue/rescue
.endif
@@ -758,7 +758,7 @@
_btxld= usr.sbin/btxld
.endif
-.if (!defined(NORESCUE) || \
+.if (!defined(NO_RESCUE) || \
defined(RELEASEDIR)) && \
( ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 501101 )
_crunchide= usr.sbin/crunch/crunchide
==== //depot/projects/ia64/etc/rc.d/cleanvar#5 (text+ko) ====
@@ -1,11 +1,10 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/cleanvar,v 1.4 2003/04/18 17:55:05 mtm Exp $
+# $FreeBSD: src/etc/rc.d/cleanvar,v 1.5 2003/07/14 13:02:36 mtm Exp $
#
# PROVIDE: cleanvar
-# REQUIRE: adjkerntz mountcritlocal
-# BEFORE: netif
+# REQUIRE: mountcritlocal
# KEYWORD: FreeBSD
purgedir()
==== //depot/projects/ia64/etc/rc.d/ipmon#6 (text+ko) ====
@@ -1,11 +1,11 @@
#!/bin/sh
#
# $NetBSD: ipmon,v 2002/04/18 05:02:01 lukem Exp $
-# $FreeBSD: src/etc/rc.d/ipmon,v 1.5 2003/04/24 08:20:47 mtm Exp $
+# $FreeBSD: src/etc/rc.d/ipmon,v 1.6 2003/07/14 13:02:36 mtm Exp $
#
# PROVIDE: ipmon
-# REQUIRE: mountcritlocal hostname sysctl
+# REQUIRE: mountcritlocal hostname sysctl cleanvar
# BEFORE: SERVERS
# KEYWORD: FreeBSD NetBSD
==== //depot/projects/ia64/games/fortune/datfiles/fortunes#30 (text+ko) ====
@@ -1,5 +1,5 @@
This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.112 2003/06/18 12:46:20 joerg Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.114 2003/07/14 22:22:56 mph Exp $
%
-- Gifts for Children --
@@ -7164,10 +7164,6 @@
"I shot an arrow into the air, and it stuck."
-- Graffito in Los Angeles
%
-"I stayed up all night playing poker with tarot cards. I got a full
-house and four people died."
- -- Steven Wright
-%
"I stopped believing in Santa Claus when I was six. Mother took me to
see him in a department store and he asked for my autograph."
-- Shirley Temple
@@ -10564,6 +10560,13 @@
%
Oh, wow! Look at the moon!
%
+Ok, note to all reading this: if I ask for information and you don't
+have the information available, don't bother sending me an e-mail
+just to tell me that you don't have the information available. Wait
+until you do have the information available, and then e-mail me. You'll
+save precious time and electrons.
+ -- Bill Paul
+%
"OK, now let's look at four dimensions on the blackboard."
-- Dr. Joy
%
==== //depot/projects/ia64/include/histedit.h#3 (text+ko) ====
@@ -35,7 +35,7 @@
*
* @(#)histedit.h 8.2 (Berkeley) 1/3/94
* $NetBSD: histedit.h,v 1.15 2000/02/28 17:41:05 chopps Exp $
- * $FreeBSD: src/include/histedit.h,v 1.8 2002/06/16 08:29:33 mdodd Exp $
+ * $FreeBSD: src/include/histedit.h,v 1.9 2003/07/14 16:31:20 imp Exp $
*/
/*
@@ -47,6 +47,8 @@
#include <sys/types.h>
#include <stdio.h>
+__BEGIN_DECLS
+
/*
* ==== Editing ====
*/
@@ -194,4 +196,6 @@
#define H_SAVE 18 /* , const char *); */
#define H_CLEAR 19 /* , void); */
+__END_DECLS
+
#endif /* _HISTEDIT_H_ */
==== //depot/projects/ia64/rescue/rescue/Makefile#5 (text+ko) ====
@@ -1,4 +1,4 @@
-#$FreeBSD: src/rescue/rescue/Makefile,v 1.6 2003/07/11 16:57:43 gordon Exp $
+#$FreeBSD: src/rescue/rescue/Makefile,v 1.7 2003/07/15 00:30:31 gordon Exp $
# @(#)Makefile 8.1 (Berkeley) 6/2/93
PROG= rescue
@@ -66,9 +66,9 @@
# WARNING: Changing this list may require adjusting
# /usr/include/paths.h as well! You were warned!
#
-CRUNCH_SRCDIRS+=$(.CURDIR)/../../bin $(.CURDIR)/../../usr.bin
-CRUNCH_PROGS=cat chflags chio chmod cp date dd df domainname echo ed \
- expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \
+CRUNCH_SRCDIRS+=bin
+CRUNCH_PROGS_bin=cat chflags chio chmod cp date dd df domainname echo \
+ ed expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \
realpath rm rmdir setfacl sh sleep stty sync test
CRUNCH_LIBS+=-lcrypt -lcrypto -ledit -lkvm -ll -lm -ltermcap -lutil
@@ -82,18 +82,18 @@
CRUNCH_ALIAS_ed= red
.if !defined(NO_RCMNDS)
-CRUNCH_PROGS+= rcp
+CRUNCH_PROGS_bin+= rcp
.endif
.if !defined(NO_TCSH)
-CRUNCH_PROGS+= csh
+CRUNCH_PROGS_bin+= csh
CRUNCH_ALIAS_csh= -csh tcsh -tcsh
CRUNCH_SUPPRESS_LINK_-csh=1
CRUNCH_SUPPRESS_LINK_-tcsh=1
.endif
#Is rmail of any use at all here? I think not.
-#CRUNCH_PROGS+= rmail
+#CRUNCH_PROGS_bin+= rmail
###################################################################
# Programs from standard /sbin
@@ -104,8 +104,8 @@
# Note that mdmfs and shutdown have their own private 'pathnames.h'
# headers in addition to the standard 'paths.h' header.
#
-CRUNCH_SRCDIRS+=$(.CURDIR)/../../sbin
-CRUNCH_PROGS+=atm adjkerntz atacontrol badsect bsdlabel camcontrol \
+CRUNCH_SRCDIRS+=sbin
+CRUNCH_PROGS_sbin=atm adjkerntz atacontrol badsect bsdlabel camcontrol \
ccdconfig clri comcontrol conscontrol devfs dmesg dump \
dumpfs dumpon fore_dnld fsck fsck_ffs fsck_msdosfs fsdb \
fsirand gbde growfs ifconfig ilmid init ip6fw ipf ipfs ipfstat \
@@ -124,7 +124,7 @@
-lgeom -lmd -lreadline -lsbuf -lufs -lz
.if ${MACHINE_ARCH} == "i386"
-CRUNCH_PROGS+= cxconfig fdisk
+CRUNCH_PROGS_sbin+= cxconfig fdisk
CRUNCH_ALIAS_bsdlabel= disklabel
#CRUNCH_PROGS+= mount_nwfs mount_smbfs
#CRUNCH_LIBS+= -lncp -lsmb
@@ -135,11 +135,11 @@
.endif
.if ${MACHINE_ARCH} == "ia64"
-CRUNCH_PROGS+= mca gpt fdisk
+CRUNCH_PROGS_sbin+= mca gpt fdisk
.endif
.if ${MACHINE_ARCH} == "sparc64"
-CRUNCH_PROGS+= sunlabel
+CRUNCH_PROGS_sbin+= sunlabel
.endif
.if ${MACHINE_ARCH} == "alpha"
@@ -147,7 +147,7 @@
.endif
.if ${MACHINE_ARCH} == "amd64"
-CRUNCH_PROGS+= fdisk
+CRUNCH_PROGS_sbin+= fdisk
CRUNCH_ALIAS_bsdlabel= disklabel
.endif
@@ -162,26 +162,26 @@
CRUNCH_ALIAS_mount_std= mount_devfs mount_fdescfs mount_linprocfs mount_procfs
# dhclient has historically been troublesome...
-CRUNCH_PROGS+=dhclient
+CRUNCH_PROGS_sbin+=dhclient
CRUNCH_BUILDOPTS_dhclient=-DRELEASE_CRUNCH -Dlint
##################################################################
# Programs from stock /usr/bin
#
-CRUNCH_SRCDIRS+=$(.CURDIR)/../../usr.bin
-CRUNCH_SRCDIRS+=$(.CURDIR)/../../gnu/usr.bin
+CRUNCH_SRCDIRS+=usr.bin
+CRUNCH_SRCDIRS+=gnu/usr.bin
-CRUNCH_PROGS+=wall
+CRUNCH_PROGS_usr.bin+=wall
-CRUNCH_PROGS+=gzip
+CRUNCH_PROGS_gnu/usr.bin+=gzip
CRUNCH_ALIAS_gzip=gunzip gzcat zcat
-CRUNCH_PROGS+=bzip2
+CRUNCH_PROGS_usr.bin+=bzip2
CRUNCH_ALIAS_bzip2=bunzip2 bzcat
CRUNCH_LIBS+=-lbz2
-CRUNCH_PROGS+=tar
-CRUNCH_PROGS+=vi
+CRUNCH_PROGS_gnu/usr.bin+=tar
+CRUNCH_PROGS_usr.bin+=vi
CRUNCH_ALIAS_vi=ex
##################################################################
@@ -204,7 +204,8 @@
# Program names and their aliases contribute hardlinks to 'rescue' executable,
# except for those that get suppressed.
-.for P in $(CRUNCH_PROGS)
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
.ifndef CRUNCH_SUPPRESS_LINK_${P}
LINKS += $(BINDIR)/$(PROG) $(BINDIR)/$(P)
.endif
@@ -214,6 +215,7 @@
.endif
.endfor
.endfor
+.endfor
all: $(PROG)
exe: $(PROG)
@@ -221,7 +223,7 @@
$(CONF): Makefile
echo \# Auto-generated, do not edit >$(.TARGET)
.for D in $(CRUNCH_SRCDIRS)
- echo srcdirs $(D) >>$(.TARGET)
+ echo srcdirs $(.CURDIR)/../../$(D) >>$(.TARGET)
.endfor
.ifdef CRUNCH_BUILDOPTS
echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET)
@@ -229,7 +231,8 @@
.ifdef CRUNCH_LIBS
echo libs $(CRUNCH_LIBS) >>$(.TARGET)
.endif
-.for P in $(CRUNCH_PROGS)
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
echo progs $(P) >>$(.TARGET)
.ifdef CRUNCH_SRCDIR_${P}
echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET)
@@ -241,6 +244,7 @@
echo ln $(P) $(A) >>$(.TARGET)
.endfor
.endfor
+.endfor
$(OUTPUTS): $(CONF)
@@ -256,7 +260,7 @@
# shell scripts so we can remove this nonsense.
build-tools:
.for _tool in bin/csh bin/sh
- cd ${.CURDIR}/../../${_tool}; \
+ cd $(.CURDIR)/../../${_tool}; \
MAKEOBJDIRPREFIX=${CRUNCHOBJS} make DIRPRFX=rescue/${_tool} build-tools
.endfor
@@ -266,7 +270,15 @@
# targets should NOT be propagated into the components.
cleandepend cleandir obj objlink:
.for D in $(CRUNCH_SRCDIRS)
- cd ${D} && MAKEOBJDIRPREFIX=${CANONICALOBJDIR} make ${.TARGET}
+.for P in $(CRUNCH_PROGS_$(D))
+.ifdef CRUNCH_SRCDIR_${P}
+ cd ${CRUNCH_SRCDIR_$(P)} && \
+ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} make ${.TARGET}
+.else
+ cd $(.CURDIR)/../../${D}/${P} && \
+ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} make ${.TARGET}
+.endif
+.endfor
.endfor
clean:
@@ -274,8 +286,16 @@
if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
MAKEOBJDIRPREFIX=${CRUNCHOBJS} make -f $(OUTMK) clean; \
fi
-.for D in $(CRUNCH_SRCDIRS) $(EXTRA_SRCDIRS)
- cd ${D} && MAKEOBJDIRPREFIX=${CRUNCHOBJS} make clean
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
+.ifdef CRUNCH_SRCDIR_${P}
+ cd ${CRUNCH_SRCDIR_$(P)} && \
+ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} make ${.TARGET}
+.else
+ cd $(.CURDIR)/../../${D}/${P} && \
+ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} make ${.TARGET}
+.endif
+.endfor
.endfor
.include <bsd.prog.mk>
==== //depot/projects/ia64/sbin/ipfw/ipfw2.c#22 (text+ko) ====
@@ -17,7 +17,7 @@
*
* NEW command line interface for IP firewall facility
*
- * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.33 2003/07/12 08:35:25 luigi Exp $
+ * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.35 2003/07/14 18:57:41 luigi Exp $
*/
#include <sys/param.h>
@@ -59,7 +59,6 @@
do_resolv, /* Would try to resolve all */
do_time, /* Show time stamps */
do_quiet, /* Be quiet in add and flush */
- do_force, /* Don't ask for confirmation */
do_pipe, /* this cmd refers to a pipe */
do_sort, /* field to sort results (0 = no) */
do_dynamic, /* display dynamic rules */
@@ -368,7 +367,7 @@
{
static int s = -1; /* the socket */
int i;
-
+
if (test_only)
return 0;
@@ -501,7 +500,7 @@
int i;
*end = s; /* default - not found */
- if ( *s == '\0')
+ if (*s == '\0')
return 0; /* not found */
if (isdigit(*s))
@@ -522,7 +521,7 @@
* copy into a buffer skipping backslashes
*/
for (p = s, i = 0; p != s1 ; p++)
- if ( *p != '\\')
+ if (*p != '\\')
buf[i++] = *p;
buf[i++] = '\0';
@@ -646,9 +645,10 @@
* len is the max length in bits.
*/
static int
-contigmask(u_char *p, int len)
+contigmask(uint8_t *p, int len)
{
int i, n;
+
for (i=0; i<len ; i++)
if ( (p[i/8] & (1 << (7 - (i%8)))) == 0) /* first bit unset */
break;
@@ -667,8 +667,8 @@
{
char const *comma = "";
int i;
- u_char set = cmd->arg1 & 0xff;
- u_char clear = (cmd->arg1 >> 8) & 0xff;
+ uint8_t set = cmd->arg1 & 0xff;
+ uint8_t clear = (cmd->arg1 >> 8) & 0xff;
if (list == f_tcpflags && set == TH_SYN && clear == TH_ACK) {
printf(" setup");
@@ -715,7 +715,7 @@
x = htonl( ~x );
cmd->addr.s_addr = htonl(cmd->addr.s_addr);
printf("%s/%d", inet_ntoa(cmd->addr),
- contigmask((u_char *)&x, 32));
+ contigmask((uint8_t *)&x, 32));
x = cmd->addr.s_addr = htonl(cmd->addr.s_addr);
x &= 0xff; /* base */
/*
@@ -747,7 +747,7 @@
for (len = len / 2; len > 0; len--, a += 2) {
int mb = /* mask length */
(cmd->o.opcode == O_IP_SRC || cmd->o.opcode == O_IP_DST) ?
- 32 : contigmask((u_char *)&(a[1]), 32);
+ 32 : contigmask((uint8_t *)&(a[1]), 32);
if (mb == 32 && do_resolv)
he = gethostbyaddr((char *)&(a[0]), sizeof(u_long), AF_INET);
if (he != NULL) /* resolved to name */
@@ -764,14 +764,13 @@
if (len > 1)
printf(",");
}
-
}
/*
* prints a MAC address/mask pair
*/
static void
-print_mac(u_char *addr, u_char *mask)
+print_mac(uint8_t *addr, uint8_t *mask)
{
int l = contigmask(mask, 48);
@@ -1039,7 +1038,7 @@
show_prerequisites(&flags, 0, cmd->opcode);
switch(cmd->opcode) {
- case O_PROB:
+ case O_PROB:
break; /* done already */
case O_PROBE_STATE:
@@ -1054,8 +1053,8 @@
printf(" not");
printf(" MAC");
flags |= HAVE_MAC;
- print_mac( m->addr, m->mask);
- print_mac( m->addr + 6, m->mask + 6);
+ print_mac(m->addr, m->mask);
+ print_mac(m->addr + 6, m->mask + 6);
}
break;
@@ -1279,7 +1278,7 @@
char const *comma = " ";
printf(" limit");
- for ( ; p->x != 0 ; p++)
+ for (; p->x != 0 ; p++)
if ((x & p->x) == p->x) {
x &= ~p->x;
printf("%s%s", comma, p->s);
@@ -1561,13 +1560,13 @@
&set_disable, sizeof(set_disable));
for (i = 0, msg = "disable" ; i < 31; i++)
- if ( (set_disable & (1<<i))) {
+ if ((set_disable & (1<<i))) {
printf("%s %d", msg, i);
msg = "";
}
msg = (set_disable) ? " enable" : "enable";
for (i = 0; i < 31; i++)
- if ( !(set_disable & (1<<i))) {
+ if (!(set_disable & (1<<i))) {
printf("%s %d", msg, i);
msg = "";
}
@@ -1779,7 +1778,6 @@
if (*endptr == '-')
last = strtoul(endptr+1, &endptr, 10);
if (*endptr) {
-
exitval = EX_USAGE;
warnx("invalid rule number: %s", *(lav - 1));
continue;
@@ -1845,7 +1843,7 @@
{
fprintf(stderr,
"ipfw syntax summary (but please do read the ipfw(8) manpage):\n"
-"ipfw [-acdeftnNpqS] command:"
+"ipfw [-acdeftTnNpqS] <command> where <command> is one of:\n"
"add [num] [set N] [prob x] RULE-BODY\n"
"{pipe|queue} N config PIPE-BODY\n"
"[pipe|queue] {zero|delete|show} [N{,N}]\n"
@@ -1855,10 +1853,10 @@
"ACTION: check-state | allow | count | deny | reject | skipto N |\n"
" {divert|tee} PORT | forward ADDR | pipe N | queue N\n"
"ADDR: [ MAC dst src ether_type ] \n"
-" [ from IPLIST [ PORT ] to IPLIST [ PORTLIST ] ]\n"
-"IPLIST: IPADDR[,IPADDR] | { IPADDR or ... or IPADDR }\n"
-"IPADDR: [not] { any | me | ip | ip/bits | ip:mask | ip/bits{x,y,z} }\n"
-"OPTION_LIST: OPTION [,OPTION_LIST]\n"
+" [ from IPADDR [ PORT ] to IPADDR [ PORTLIST ] ]\n"
+"IPADDR: [not] { any | me | ip/bits{x,y,z} | IPLIST }\n"
+"IPLIST: { ip | ip/bits | ip:mask }[,IPLIST]\n"
+"OPTION_LIST: OPTION [OPTION_LIST]\n"
"OPTION: bridged | {dst-ip|src-ip} ADDR | {dst-port|src-port} LIST |\n"
" estab | frag | {gid|uid} N | icmptypes LIST | in | out | ipid LIST |\n"
" iplen LIST | ipoptions SPEC | ipprecedence | ipsec | iptos SPEC |\n"
@@ -1972,7 +1970,7 @@
*/
uint32_t *map = (uint32_t *)&cmd->mask;
int low, high;
- int i = contigmask((u_char *)&(d[1]), 32);
+ int i = contigmask((uint8_t *)&(d[1]), 32);
if (len > 0)
errx(EX_DATAERR, "address set cannot be in a list");
@@ -2508,7 +2506,7 @@
}
static void
-get_mac_addr_mask(char *p, u_char *addr, u_char *mask)
+get_mac_addr_mask(char *p, uint8_t *addr, uint8_t *mask)
{
int i, l;
@@ -2561,7 +2559,7 @@
{
int i, l;
char *p = (char *)(cmd + 1);
-
+
cmd->opcode = O_NOP;
cmd->len = (cmd->len & (F_NOT | F_OR));
@@ -2582,7 +2580,7 @@
}
*(--p) = '\0';
}
-
+
/*
* A function to fill simple commands of size 1.
* Existing flags are preserved.
@@ -3477,7 +3475,7 @@
* put back O_LOG if necessary
*/
src = (ipfw_insn *)cmdbuf;
- if ( src->opcode == O_LOG ) {
+ if (src->opcode == O_LOG) {
i = F_LEN(src);
bcopy(src, dst, i * sizeof(uint32_t));
dst += i;
@@ -3542,11 +3540,11 @@
}
static void
-flush(void)
+flush(int force)
{
int cmd = do_pipe ? IP_DUMMYNET_FLUSH : IP_FW_FLUSH;
- if (!do_force && !do_quiet) { /* need to ask user */
+ if (!force && !do_quiet) { /* need to ask user */
int c;
printf("Are you sure? [yn] ");
@@ -3569,7 +3567,21 @@
}
/*
- * called with the arguments (excluding program name).
+ * Free a the (locally allocated) copy of command line arguments.
+ */
+static void
+free_args(int ac, char **av)
+{
+ int i;
+
+ for (i=0; i < ac; i++)
+ free(av[i]);
+ free(av);
+}
+
+/*
+ * Called with the arguments (excluding program name).
+ * Returns 0 if successful, 1 if empty command, errx() in case of errors.
*/
static int
ipfw_main(int oldac, char **oldav)
@@ -3577,9 +3589,12 @@
int ch, ac, save_ac;
char **av, **save_av;
int do_acct = 0; /* Show packet/byte count */
+ int do_force = 0; /* Don't ask for confirmation */
#define WHITESP " \t\f\v\n\r"
- if (oldac == 1) {
+ if (oldac == 0)
+ return 1;
+ else if (oldac == 1) {
/*
* If we are called with a single string, try to split it into
* arguments for subsequent parsing.
@@ -3607,7 +3622,7 @@
l = j; /* the new argument length */
arg[j++] = '\0';
if (l == 0) /* empty string! */
- show_usage();
+ return 1;
/*
* First, count number of arguments. Because of the previous
@@ -3658,9 +3673,6 @@
}
}
- if (ac == 0)
- show_usage();
-
/* Set the force flag for non-interactive processes */
do_force = !isatty(STDIN_FILENO);
@@ -3692,6 +3704,7 @@
break;
case 'h': /* help */
+ free_args(save_ac, save_av);
help();
break; /* NOTREACHED */
@@ -3728,7 +3741,8 @@
break;
default:
- show_usage();
+ free_args(save_ac, save_av);
+ return 1;
}
ac -= optind;
@@ -3736,14 +3750,25 @@
NEED1("bad arguments, for usage summary ``ipfw''");
/*
+ * An undocumented behaviour of ipfw1 was to allow rule numbers first,
+ * e.g. "100 add allow ..." instead of "add 100 allow ...".
+ * In case, swap first and second argument to get the normal form.
+ */
+ if (ac > 1 && isdigit(*av[0])) {
+ char *p = av[0];
+
+ av[0] = av[1];
+ av[1] = p;
+ }
+
+ /*
* optional: pipe or queue
*/
- if (!strncmp(*av, "pipe", strlen(*av))) {
+ if (!strncmp(*av, "pipe", strlen(*av)))
do_pipe = 1;
- ac--;
- av++;
- } else if (!strncmp(*av, "queue", strlen(*av))) {
+ else if (!strncmp(*av, "queue", strlen(*av)))
do_pipe = 2;
+ if (do_pipe) {
ac--;
av++;
}
@@ -3756,6 +3781,7 @@
*/
if (do_pipe > 0 && ac > 1 && isdigit(*av[0])) {
char *p = av[0];
+
av[0] = av[1];
av[1] = p;
}
@@ -3767,7 +3793,7 @@
else if (!strncmp(*av, "delete", strlen(*av)))
delete(ac, av);
else if (!strncmp(*av, "flush", strlen(*av)))
- flush();
+ flush(do_force);
else if (!strncmp(*av, "zero", strlen(*av)))
zero(ac, av, IP_FW_ZERO);
else if (!strncmp(*av, "resetlog", strlen(*av)))
@@ -3787,9 +3813,7 @@
errx(EX_USAGE, "bad command `%s'", *av);
/* Free memory allocated in the argument parsing. */
- for (ch=0; ch < save_ac; ch++)
- free(save_av[ch]);
- free(save_av);
+ free_args(save_ac, save_av);
return 0;
}
@@ -3868,7 +3892,7 @@
if (preproc == -1)
err(EX_OSERR, "cannot fork");
- if (preproc == 0) {
+ if (preproc == 0) {
/*
* Child, will run the preprocessor with the
* file on stdin and the pipe on stdout.
@@ -3931,7 +3955,9 @@
if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0)
ipfw_readfile(ac, av);
- else
- ipfw_main(ac-1, av+1);
+ else {
+ if (ipfw_main(ac-1, av+1))
+ show_usage();
+ }
return EX_OK;
}
==== //depot/projects/ia64/sbin/ping/ping.c#24 (text+ko) ====
@@ -46,7 +46,7 @@
#endif /* not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/ping/ping.c,v 1.98 2003/06/02 10:01:59 maxim Exp $");
+__FBSDID("$FreeBSD: src/sbin/ping/ping.c,v 1.101 2003/07/14 12:43:48 maxim Exp $");
/*
* P I N G . C
@@ -105,7 +105,6 @@
/* runs out of buffer space */
#define MAXIPLEN (sizeof(struct ip) + MAX_IPOPTLEN)
#define MAXICMPLEN (ICMP_ADVLENMIN + MAX_IPOPTLEN)
-#define MINICMPLEN ICMP_MINLEN
#define MAXWAIT 10 /* max seconds to wait for response */
#define MAXALARM (60 * 60) /* max seconds for alarm timeout */
#define MAXTOS 255
@@ -168,6 +167,7 @@
u_char icmp_type = ICMP_ECHO;
u_char icmp_type_rsp = ICMP_ECHOREPLY;
int phdr_len = 0;
+int send_len;
/* counters */
long nmissedmax; /* max value of ntransmitted - nreceived - 1 */
@@ -227,7 +227,7 @@
struct sockaddr_in *to;
double t;
u_long alarmtimeout, ultmp;
- int almost_done, ch, df, hold, i, mib[4], packlen, preload, sockerrno,
+ int almost_done, ch, df, hold, i, icmp_len, mib[4], preload, sockerrno,
tos, ttl;
char ctrl[CMSG_SPACE(sizeof(struct timeval))];
char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN];
@@ -458,13 +458,15 @@
errx(EX_USAGE, "ICMP_TSTAMP and ICMP_MASKREQ are exclusive.");
break;
}
- maxpayload = IP_MAXPACKET - sizeof(struct ip) - MINICMPLEN - phdr_len;
+ icmp_len = sizeof(struct ip) + ICMP_MINLEN + phdr_len;
if (options & F_RROUTE)
- maxpayload -= MAX_IPOPTLEN;
+ icmp_len += MAX_IPOPTLEN;
+ maxpayload = IP_MAXPACKET - icmp_len;
if (datalen > maxpayload)
errx(EX_USAGE, "packet size too large: %d > %d", datalen,
maxpayload);
- datap = &outpack[MINICMPLEN + phdr_len + TIMEVAL_LEN];
+ send_len = icmp_len + datalen;
+ datap = &outpack[ICMP_MINLEN + phdr_len + TIMEVAL_LEN];
if (options & F_PINGFILLED) {
fill((char *)datap, payload);
}
@@ -527,8 +529,6 @@
if (datalen >= TIMEVAL_LEN) /* can we time transfer */
timing = 1;
- packlen = MAXIPLEN + MAXICMPLEN + datalen;
- packlen = packlen > IP_MAXPACKET ? IP_MAXPACKET : packlen;
if (!(options & F_PINGFILLED))
for (i = TIMEVAL_LEN; i < datalen; ++i)
@@ -706,7 +706,7 @@
msg.msg_control = (caddr_t)ctrl;
#endif
iov.iov_base = packet;
- iov.iov_len = packlen;
+ iov.iov_len = IP_MAXPACKET;
if (tcgetattr(STDOUT_FILENO, &ts) != -1) {
reset_kerninfo = !(ts.c_lflag & NOKERNINFO);
@@ -868,11 +868,11 @@
* 1000 + now.tv_usec / 1000);
if (timing)
bcopy((void *)&now,
- (void *)&outpack[MINICMPLEN + phdr_len],
+ (void *)&outpack[ICMP_MINLEN + phdr_len],
sizeof(struct timeval));
}
- cc = MINICMPLEN + phdr_len + datalen;
+ cc = ICMP_MINLEN + phdr_len + datalen;
/* compute ICMP checksum here */
icp->icmp_cksum = in_cksum((u_short *)icp, cc);
@@ -924,13 +924,14 @@
struct ip *ip;
const void *tp;
double triptime;
- int dupflag, hlen, i, j, seq;
+ int dupflag, hlen, i, j, recv_len, seq;
static int old_rrlen;
static char old_rr[MAX_IPOPTLEN];
/* Check the IP header */
ip = (struct ip *)buf;
hlen = ip->ip_hl << 2;
+ recv_len = cc;
if (cc < hlen + ICMP_MINLEN) {
if (options & F_VERBOSE)
warn("packet too short (%d bytes) from %s", cc,
@@ -1008,9 +1009,14 @@
(void)printf(" tsr=%s", pr_ntime(icp->icmp_rtime));
(void)printf(" tst=%s", pr_ntime(icp->icmp_ttime));
}
+ if (recv_len != send_len) {
+ (void)printf(
+ "\nwrong total length %d instead of %d",
+ recv_len, send_len);
+ }
/* check the data */
cp = (u_char*)&icp->icmp_data[phdr_len];
- dp = &outpack[MINICMPLEN + phdr_len];
+ dp = &outpack[ICMP_MINLEN + phdr_len];
cc -= ICMP_MINLEN + phdr_len;
i = 0;
if (timing) { /* don't check variable timestamp */
@@ -1026,16 +1032,16 @@
(void)printf("\ncp:");
cp = (u_char*)&icp->icmp_data[0];
for (i = 0; i < datalen; ++i, ++cp) {
- if ((i % 32) == 8)
+ if ((i % 16) == 8)
(void)printf("\n\t");
- (void)printf("%x ", *cp);
+ (void)printf("%2x ", *cp);
}
(void)printf("\ndp:");
- cp = &outpack[MINICMPLEN];
+ cp = &outpack[ICMP_MINLEN];
for (i = 0; i < datalen; ++i, ++cp) {
- if ((i % 32) == 8)
+ if ((i % 16) == 8)
(void)printf("\n\t");
- (void)printf("%x ", *cp);
+ (void)printf("%2x ", *cp);
}
break;
}
@@ -1539,17 +1545,17 @@
}
static char *
-pr_ntime (n_time time)
+pr_ntime (n_time timestamp)
{
static char buf[10];
- int h, m, s;
+ int hour, min, sec;
- s = ntohl(time) / 1000;
- h = s / 60 / 60;
- m = (s % (60 * 60)) / 60;
- s = (s % (60 * 60)) % 60;
+ sec = ntohl(timestamp) / 1000;
+ hour = sec / 60 / 60;
+ min = (sec % (60 * 60)) / 60;
+ sec = (sec % (60 * 60)) % 60;
- (void)snprintf(buf, sizeof(buf), "%02d:%02d:%02d", h, m, s);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list