Date: Tue, 6 Jul 2004 01:59:28 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 56566 for review Message-ID: <200407060159.i661xSf2099358@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=56566 Change 56566 by marcel@marcel_nfs on 2004/07/06 01:58:46 IFC @56561 Affected files ... .. //depot/projects/gdb/UPDATING#19 integrate .. //depot/projects/gdb/contrib/gnu-sort/FREEBSD-upgrade#3 integrate .. //depot/projects/gdb/contrib/gnu-sort/src/sort.c#3 integrate .. //depot/projects/gdb/contrib/top/top.c#3 integrate .. //depot/projects/gdb/etc/devd.conf#5 integrate .. //depot/projects/gdb/gnu/lib/libregex/FREEBSD-upgrade#2 integrate .. //depot/projects/gdb/include/Makefile#8 integrate .. //depot/projects/gdb/include/ftw.h#1 branch .. //depot/projects/gdb/lib/libalias/Makefile#4 integrate .. //depot/projects/gdb/lib/libalias/alias.c#7 integrate .. //depot/projects/gdb/lib/libalias/alias.h#5 integrate .. //depot/projects/gdb/lib/libalias/alias_cuseeme.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_db.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_ftp.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_irc.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_local.h#5 integrate .. //depot/projects/gdb/lib/libalias/alias_nbt.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_old.c#3 integrate .. //depot/projects/gdb/lib/libalias/alias_pptp.c#5 integrate .. //depot/projects/gdb/lib/libalias/alias_proxy.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_skinny.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_smedia.c#4 integrate .. //depot/projects/gdb/lib/libalias/alias_util.c#5 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.3#7 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.c#17 integrate .. //depot/projects/gdb/lib/libarchive/archive_entry.h#10 integrate .. //depot/projects/gdb/lib/libarchive/archive_read.3#10 integrate .. //depot/projects/gdb/lib/libarchive/archive_util.3#2 integrate .. //depot/projects/gdb/lib/libarchive/archive_write.3#4 integrate .. //depot/projects/gdb/lib/libarchive/libarchive-formats.5#2 integrate .. //depot/projects/gdb/lib/libarchive/libarchive.3#4 integrate .. //depot/projects/gdb/lib/libarchive/tar.5#6 integrate .. //depot/projects/gdb/lib/libbluetooth/bluetooth.3#3 integrate .. //depot/projects/gdb/lib/libbsnmp/modules/snmp_netgraph/snmp_netgraph.3#4 integrate .. //depot/projects/gdb/lib/libc/gen/Makefile.inc#4 integrate .. //depot/projects/gdb/lib/libc/gen/ftw.3#1 branch .. //depot/projects/gdb/lib/libc/gen/ftw.c#1 branch .. //depot/projects/gdb/lib/libc/gen/getttyent.3#2 integrate .. //depot/projects/gdb/lib/libc/gen/shm_open.3#3 integrate .. //depot/projects/gdb/lib/libc/locale/big5.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/euc.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/gb18030.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/gb2312.5#3 integrate .. //depot/projects/gdb/lib/libc/locale/gbk.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/isideogram.3#2 integrate .. //depot/projects/gdb/lib/libc/locale/localeconv.3#2 integrate .. //depot/projects/gdb/lib/libc/locale/mblen.3#5 integrate .. //depot/projects/gdb/lib/libc/locale/mbstowcs.3#3 integrate .. //depot/projects/gdb/lib/libc/locale/mbtowc.3#4 integrate .. //depot/projects/gdb/lib/libc/locale/mskanji.5#2 integrate .. //depot/projects/gdb/lib/libc/locale/utf2.5#3 integrate .. //depot/projects/gdb/lib/libc/locale/wcstombs.3#4 integrate .. //depot/projects/gdb/lib/libc/locale/wctomb.3#3 integrate .. //depot/projects/gdb/lib/libc/net/getifmaddrs.3#2 integrate .. //depot/projects/gdb/lib/libc/net/inet6_opt_init.3#4 integrate .. //depot/projects/gdb/lib/libc/net/inet6_rth_space.3#4 integrate .. //depot/projects/gdb/lib/libc/posix1e/acl_delete.3#3 integrate .. //depot/projects/gdb/lib/libc/stdio/fflush.c#2 integrate .. //depot/projects/gdb/lib/libc/stdlib/exit.3#2 integrate .. //depot/projects/gdb/lib/libc/sys/execve.2#3 integrate .. //depot/projects/gdb/lib/libc/sys/extattr_get_file.2#2 integrate .. //depot/projects/gdb/lib/libc/sys/sched_setparam.2#3 integrate .. //depot/projects/gdb/lib/libc/sys/setuid.2#2 integrate .. //depot/projects/gdb/lib/libc/sys/vfork.2#3 integrate .. //depot/projects/gdb/lib/libc/sys/wait.2#4 integrate .. //depot/projects/gdb/lib/libkiconv/kiconv.3#4 integrate .. //depot/projects/gdb/lib/libpam/modules/pam_guest/pam_guest.8#3 integrate .. //depot/projects/gdb/lib/libsdp/sdp.3#5 integrate .. //depot/projects/gdb/lib/libufs/bread.3#3 integrate .. //depot/projects/gdb/lib/libufs/cgread.3#3 integrate .. //depot/projects/gdb/lib/libufs/getino.3#3 integrate .. //depot/projects/gdb/lib/libufs/libufs.3#3 integrate .. //depot/projects/gdb/lib/libufs/sbread.3#3 integrate .. //depot/projects/gdb/sbin/geom/class/concat/gconcat.8#4 integrate .. //depot/projects/gdb/sbin/geom/class/concat/geom_concat.c#3 integrate .. //depot/projects/gdb/sbin/geom/class/label/geom_label.c#2 integrate .. //depot/projects/gdb/sbin/geom/class/label/glabel.8#3 integrate .. //depot/projects/gdb/sbin/geom/class/stripe/geom_stripe.c#3 integrate .. //depot/projects/gdb/sbin/geom/class/stripe/gstripe.8#4 integrate .. //depot/projects/gdb/sbin/geom/misc/subr.c#3 integrate .. //depot/projects/gdb/sbin/geom/misc/subr.h#3 integrate .. //depot/projects/gdb/share/man/man4/man4.i386/ndis.4#4 integrate .. //depot/projects/gdb/share/man/man4/man4.i386/pae.4#3 integrate .. //depot/projects/gdb/share/man/man4/matcd.4#4 integrate .. //depot/projects/gdb/share/man/man4/natmip.4#3 integrate .. //depot/projects/gdb/share/man/man4/ng_atm.4#4 integrate .. //depot/projects/gdb/share/man/man4/ng_atmpif.4#4 integrate .. //depot/projects/gdb/share/man/man4/ng_one2many.4#7 integrate .. //depot/projects/gdb/share/man/man4/ng_sppp.4#5 integrate .. //depot/projects/gdb/share/man/man4/random.4#6 integrate .. //depot/projects/gdb/share/man/man4/sbp_targ.4#3 integrate .. //depot/projects/gdb/share/man/man8/rc.8#3 integrate .. //depot/projects/gdb/share/man/man9/VOP_LINK.9#2 integrate .. //depot/projects/gdb/share/man/man9/VOP_LISTEXTATTR.9#3 integrate .. //depot/projects/gdb/share/man/man9/g_access.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_attach.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_bio.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_consumer.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_data.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_event.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_geom.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_provider.9#5 integrate .. //depot/projects/gdb/share/man/man9/g_provider_by_name.9#4 integrate .. //depot/projects/gdb/share/man/man9/g_wither_geom.9#4 integrate .. //depot/projects/gdb/share/man/man9/ieee80211.9#2 integrate .. //depot/projects/gdb/share/man/man9/ithread.9#3 integrate .. //depot/projects/gdb/share/man/man9/mutex.9#5 integrate .. //depot/projects/gdb/share/man/man9/p_candebug.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap.9#3 integrate .. //depot/projects/gdb/share/man/man9/pmap_addr_hint.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_change_wiring.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_clear_modify.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_copy.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_enter.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_extract.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_is_modified.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_is_prefaultable.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_map.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_mincore.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_object_init_pt.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_page_protect.9#2 integrate .. //depot/projects/gdb/share/man/man9/pmap_zero_page.9#2 integrate .. //depot/projects/gdb/share/man/man9/signal.9#2 integrate .. //depot/projects/gdb/sys/alpha/alpha/pmap.c#10 integrate .. //depot/projects/gdb/sys/alpha/include/pmap.h#7 integrate .. //depot/projects/gdb/sys/arm/arm/pmap.c#4 integrate .. //depot/projects/gdb/sys/dev/fdc/fdc.c#4 integrate .. //depot/projects/gdb/sys/geom/concat/g_concat.c#8 integrate .. //depot/projects/gdb/sys/geom/concat/g_concat.h#5 integrate .. //depot/projects/gdb/sys/geom/label/g_label.c#2 integrate .. //depot/projects/gdb/sys/geom/label/g_label.h#2 integrate .. //depot/projects/gdb/sys/geom/stripe/g_stripe.c#3 integrate .. //depot/projects/gdb/sys/geom/stripe/g_stripe.h#2 integrate .. //depot/projects/gdb/sys/geom/vinum/geom_vinum.c#4 integrate .. //depot/projects/gdb/sys/i386/isa/isa.h#3 integrate .. //depot/projects/gdb/sys/i386/isa/isa_dma.c#3 integrate .. //depot/projects/gdb/sys/i4b/driver/i4b_ing.c#5 integrate .. //depot/projects/gdb/sys/ia64/ia64/pmap.c#9 integrate .. //depot/projects/gdb/sys/isa/orm.c#3 integrate .. //depot/projects/gdb/sys/kern/uipc_socket.c#18 integrate .. //depot/projects/gdb/sys/kern/vfs_subr.c#14 integrate .. //depot/projects/gdb/sys/net/bpf.c#8 integrate .. //depot/projects/gdb/sys/net/bridge.c#8 integrate .. //depot/projects/gdb/sys/pci/if_dc.c#8 integrate .. //depot/projects/gdb/sys/pci/if_de.c#7 integrate .. //depot/projects/gdb/sys/pci/if_rl.c#11 integrate .. //depot/projects/gdb/sys/pci/if_rlreg.h#4 integrate .. //depot/projects/gdb/sys/pci/if_sf.c#6 integrate .. //depot/projects/gdb/sys/pci/if_ti.c#6 integrate .. //depot/projects/gdb/sys/pci/if_xl.c#8 integrate .. //depot/projects/gdb/sys/pci/if_xlreg.h#2 integrate .. //depot/projects/gdb/sys/powerpc/powerpc/pmap.c#8 integrate .. //depot/projects/gdb/sys/sys/mount.h#9 integrate .. //depot/projects/gdb/usr.bin/compress/compress.1#3 integrate .. //depot/projects/gdb/usr.bin/fetch/fetch.c#6 integrate .. //depot/projects/gdb/usr.bin/join/join.1#4 integrate .. //depot/projects/gdb/usr.bin/join/join.c#2 integrate .. //depot/projects/gdb/usr.bin/rup/rup.1#3 integrate .. //depot/projects/gdb/usr.bin/rusers/rusers.1#3 integrate .. //depot/projects/gdb/usr.bin/rwall/rwall.1#3 integrate .. //depot/projects/gdb/usr.bin/tar/bsdtar.1#10 integrate .. //depot/projects/gdb/usr.bin/top/machine.c#4 integrate .. //depot/projects/gdb/usr.sbin/syslogd/syslogd.c#6 integrate .. //depot/projects/gdb/usr.sbin/ypserv/ypinit.8#2 integrate Differences ... ==== //depot/projects/gdb/UPDATING#19 (text+ko) ==== @@ -17,6 +17,13 @@ developers choose to disable these features on build machines to maximize performance. +20040702: + The native preemption has been added to the kernel scheduler. + There is some report that ULE scheduler was broken in some + machines and we encourage users using ULE schedluer either + stick with an known good kernel, or temporary switch to 4BSD + scheduler as a workaround. + 20040630: The netgraph ABI version number has been incremented to indicate an incompatible change in the ABI. Old netgraph nodes will refuse @@ -26,6 +33,9 @@ case the changes are simple; the file ng_ksocket.c serves as an example of such changes. + This also broke i4b, although the compile problem has been papered + over. + 20040630: ACPI has been updated to disable known-bad BIOS revisions. A message will be printed on console indicating that ACPI has been disabled @@ -1670,4 +1680,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.321 2004/06/30 23:13:16 bms Exp $ +$FreeBSD: src/UPDATING,v 1.322 2004/07/05 18:11:59 imp Exp $ ==== //depot/projects/gdb/contrib/gnu-sort/FREEBSD-upgrade#3 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/contrib/gnu-sort/FREEBSD-upgrade,v 1.3 2004/07/03 02:37:42 tjr Exp $ +$FreeBSD: src/contrib/gnu-sort/FREEBSD-upgrade,v 1.4 2004/07/06 00:33:52 ache Exp $ GNU Sort originals can be found at: ftp://ftp.gnu.org/gnu/coreutils/ @@ -12,6 +12,3 @@ cvs import \ -m "Virgin import (trimmed) of GNU Sort, coreutils 5.2.1" \ src/contrib/gnu-sort FSF SORT_v5_2_1 - -ache@FreeBSD.org -30 Aug 2003 ==== //depot/projects/gdb/contrib/gnu-sort/src/sort.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/contrib/gnu-sort/src/sort.c,v 1.2 2004/07/02 11:07:42 tjr Exp $ */ +/* $FreeBSD: src/contrib/gnu-sort/src/sort.c,v 1.3 2004/07/05 12:40:31 tjr Exp $ */ /* sort - sort lines of text (with all kinds of options). Copyright (C) 88, 1991-2004 Free Software Foundation, Inc. @@ -301,13 +301,11 @@ they were read if all keys compare equal. */ static bool stable; -/* If TAB has this value, blanks separate fields. */ -enum { TAB_DEFAULT = CHAR_MAX + 1 }; - -/* Tab character separating fields. If TAB_DEFAULT, then fields are +/* Tab character separating fields. If tab_default, then fields are separated by the empty string between a non-blank character and a blank character. */ -static int tab[MB_LEN_MAX + 1] = { TAB_DEFAULT }; +static bool tab_default = true; +static unsigned char tab[MB_LEN_MAX + 1]; static size_t tab_length = 1; /* Flag to remove consecutive duplicate lines from the output. @@ -949,7 +947,7 @@ /* The leading field separator itself is included in a field when -t is absent. */ - if (tab[0] != TAB_DEFAULT) + if (!tab_default) while (ptr < lim && sword--) { while (ptr < lim && *ptr != tab[0]) @@ -993,7 +991,7 @@ memset (&state, '\0', sizeof(mbstate_t)); - if (tab[0] != TAB_DEFAULT) + if (!tab_default) while (ptr < lim && sword--) { while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) @@ -1056,7 +1054,7 @@ `beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first `blank' character after the preceding field. */ - if (tab[0] != TAB_DEFAULT) + if (!tab_default) while (ptr < lim && eword--) { while (ptr < lim && *ptr != tab[0]) @@ -1105,7 +1103,7 @@ */ /* Make LIM point to the end of (one byte past) the current field. */ - if (tab[0] != TAB_DEFAULT) + if (!tab_default) { char *newlim; newlim = memchr (ptr, tab[0], lim - ptr); @@ -1152,7 +1150,7 @@ memset (&state, '\0', sizeof(mbstate_t)); - if (tab[0]) + if (!tab_default) while (ptr < lim && eword--) { while (ptr < lim && memcmp (ptr, tab, tab_length) != 0) @@ -1183,7 +1181,7 @@ # ifdef POSIX_UNSPECIFIED /* Make LIM point to the end of (one byte past) the current field. */ - if (tab[0]) + if (!tab_default) { char *newlim, *p; @@ -3150,6 +3148,7 @@ case 't': { char newtab[MB_LEN_MAX + 1]; + size_t newtab_length = 1; strncpy (newtab, optarg, MB_LEN_MAX); if (! newtab[0]) error (SORT_FAILURE, 0, _("empty tab")); @@ -3158,7 +3157,7 @@ { wchar_t wc; mbstate_t state; - size_t newtab_length, i; + size_t i; memset (&state, '\0', sizeof (mbstate_t)); newtab_length = mbrtowc (&wc, newtab, strnlen (newtab, MB_LEN_MAX), &state); @@ -3170,7 +3169,7 @@ newtab_length = 1; } - if (optarg[tab_length]) + if (optarg[newtab_length]) { /* Provoke with `sort -txx'. Complain about "multi-character tab" instead of "multibyte tab", so @@ -3179,9 +3178,6 @@ error (SORT_FAILURE, 0, _("multi-character tab `%s'"), optarg); } - - for (i = 0; i < newtab_length; i++) - tab[i] = newtab[i]; } else #endif @@ -3200,9 +3196,12 @@ optarg); } } - if (tab[0] != TAB_DEFAULT && tab[0] != newtab[0]) + if (!tab_default && (tab_length != newtab_length + || memcmp(tab, newtab, tab_length) != 0)) error (SORT_FAILURE, 0, _("incompatible tabs")); - tab[0] = newtab[0]; + memcpy(tab, newtab, newtab_length); + tab_length = newtab_length; + tab_default = false; } break; ==== //depot/projects/gdb/contrib/top/top.c#3 (text+ko) ==== @@ -13,7 +13,7 @@ * Copyright (c) 1994, 1995, William LeFebvre, Argonne National Laboratory * Copyright (c) 1996, William LeFebvre, Group sys Consulting * - * $FreeBSD: src/contrib/top/top.c,v 1.11 2004/07/01 09:12:38 alfred Exp $ + * $FreeBSD: src/contrib/top/top.c,v 1.12 2004/07/05 12:19:53 des Exp $ */ /* @@ -354,7 +354,7 @@ } break; - case 'm': /* select sort order */ + case 'm': /* select display mode */ if (strcmp(optarg, "io") == 0) { displaymode = DISP_IO; } else if (strcmp(optarg, "cpu") == 0) { ==== //depot/projects/gdb/etc/devd.conf#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/devd.conf,v 1.13 2004/06/06 11:46:27 schweikh Exp $ +# $FreeBSD: src/etc/devd.conf,v 1.14 2004/07/05 20:16:30 imp Exp $ # # Refer to devd.conf(5) and devd(8) man pages for the details on how to # run and configure devd. @@ -60,7 +60,7 @@ # attach 0 { device-name "$scsi-controller-regex"; - action "camcontrol rescan all"; +// action "camcontrol rescan all"; }; # Don't even try to second guess what to do about drivers that don't ==== //depot/projects/gdb/gnu/lib/libregex/FREEBSD-upgrade#2 (text+ko) ==== @@ -1,14 +1,12 @@ -$FreeBSD: src/gnu/lib/libregex/FREEBSD-upgrade,v 1.1 2004/02/25 02:59:26 ache Exp $ +$FreeBSD: src/gnu/lib/libregex/FREEBSD-upgrade,v 1.2 2004/07/06 00:10:40 ache Exp $ GNU regex (from grep): -originals can be found at: ftp://ftp.gnu.org/gnu/grep/ +originals can be found at: +http://download.fedora.redhat.com/pub/fedora/linux/core/2/SRPMS/grep-2.5.1-26.src.rpm Imported by: cvs import \ - -m "Virgin import (trimmed) of GNU regex, from GNU grep 2.4.2" \ - src/gnu/lib/libregex FSF from_grep_v2_4_2 - -ache@FreeBSD.org -25 Feb 2004 + -m "Import of GNU regex from GNU grep 2.5.1 (trimmed)." \ + src/gnu/lib/libregex FSF from_grep_v2_5_1 ==== //depot/projects/gdb/include/Makefile#8 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.2 (Berkeley) 1/4/94 -# $FreeBSD: src/include/Makefile,v 1.215 2004/07/02 19:40:35 pjd Exp $ +# $FreeBSD: src/include/Makefile,v 1.216 2004/07/05 23:13:16 das Exp $ # # Doing a "make install" builds /usr/include. @@ -7,7 +7,8 @@ SUBDIR= arpa protocols rpcsvc rpc INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ - fts.h getopt.h glob.h grp.h hesiod.h histedit.h ieeefp.h ifaddrs.h \ + fts.h ftw.h getopt.h glob.h grp.h \ + hesiod.h histedit.h ieeefp.h ifaddrs.h \ inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \ netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ ==== //depot/projects/gdb/lib/libalias/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/lib/libalias/Makefile,v 1.25 2004/03/31 21:33:55 des Exp $ +# $FreeBSD: src/lib/libalias/Makefile,v 1.26 2004/07/05 11:10:57 des Exp $ LIB= alias SHLIBDIR?= /lib @@ -8,6 +8,6 @@ alias_nbt.c alias_pptp.c alias_proxy.c alias_skinny.c alias_smedia.c \ alias_util.c alias_old.c INCS= alias.h -WARNS?= 2 +WARNS?= 6 .include <bsd.lib.mk> ==== //depot/projects/gdb/lib/libalias/alias.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libalias/alias.c,v 1.43 2004/07/04 12:53:07 phk Exp $"); +__FBSDID("$FreeBSD: src/lib/libalias/alias.c,v 1.46 2004/07/05 11:10:57 des Exp $"); /* Alias.c provides supervisory control for the functions of the @@ -47,56 +47,56 @@ Version 1.0 August, 1996 (cjm) Version 1.1 August 20, 1996 (cjm) - PPP host accepts incoming connections for ports 0 to 1023. - (Gary Roberts pointed out the need to handle incoming - connections.) + PPP host accepts incoming connections for ports 0 to 1023. + (Gary Roberts pointed out the need to handle incoming + connections.) Version 1.2 September 7, 1996 (cjm) - Fragment handling error in alias_db.c corrected. - (Tom Torrance helped fix this problem.) + Fragment handling error in alias_db.c corrected. + (Tom Torrance helped fix this problem.) Version 1.4 September 16, 1996 (cjm) - - A more generalized method for handling incoming - connections, without the 0-1023 restriction, is - implemented in alias_db.c - - Improved ICMP support in alias.c. Traceroute - packet streams can now be correctly aliased. - - TCP connection closing logic simplified in - alias.c and now allows for additional 1 minute - "grace period" after FIN or RST is observed. + - A more generalized method for handling incoming + connections, without the 0-1023 restriction, is + implemented in alias_db.c + - Improved ICMP support in alias.c. Traceroute + packet streams can now be correctly aliased. + - TCP connection closing logic simplified in + alias.c and now allows for additional 1 minute + "grace period" after FIN or RST is observed. Version 1.5 September 17, 1996 (cjm) - Corrected error in handling incoming UDP packets with 0 checksum. - (Tom Torrance helped fix this problem.) + Corrected error in handling incoming UDP packets with 0 checksum. + (Tom Torrance helped fix this problem.) Version 1.6 September 18, 1996 (cjm) - Simplified ICMP aliasing scheme. Should now support - traceroute from Win95 as well as FreeBSD. + Simplified ICMP aliasing scheme. Should now support + traceroute from Win95 as well as FreeBSD. Version 1.7 January 9, 1997 (cjm) - - Out-of-order fragment handling. - - IP checksum error fixed for ftp transfers - from aliasing host. - - Integer return codes added to all - aliasing/de-aliasing functions. - - Some obsolete comments cleaned up. - - Differential checksum computations for - IP header (TCP, UDP and ICMP were already - differential). + - Out-of-order fragment handling. + - IP checksum error fixed for ftp transfers + from aliasing host. + - Integer return codes added to all + aliasing/de-aliasing functions. + - Some obsolete comments cleaned up. + - Differential checksum computations for + IP header (TCP, UDP and ICMP were already + differential). Version 2.1 May 1997 (cjm) - - Added support for outgoing ICMP error - messages. - - Added two functions PacketAliasIn2() - and PacketAliasOut2() for dynamic address - control (e.g. round-robin allocation of - incoming packets). + - Added support for outgoing ICMP error + messages. + - Added two functions PacketAliasIn2() + and PacketAliasOut2() for dynamic address + control (e.g. round-robin allocation of + incoming packets). Version 2.2 July 1997 (cjm) - - Rationalized API function names to begin - with "PacketAlias..." - - Eliminated PacketAliasIn2() and - PacketAliasOut2() as poorly conceived. + - Rationalized API function names to begin + with "PacketAlias..." + - Eliminated PacketAliasIn2() and + PacketAliasOut2() as poorly conceived. Version 2.3 Dec 1998 (dillon) - Major bounds checking additions, see FreeBSD/CVS @@ -162,43 +162,43 @@ static void -TcpMonitorIn(struct ip *pip, struct alias_link *link) +TcpMonitorIn(struct ip *pip, struct alias_link *lnk) { struct tcphdr *tc; tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); - switch (GetStateIn(link)) { + switch (GetStateIn(lnk)) { case ALIAS_TCP_STATE_NOT_CONNECTED: if (tc->th_flags & TH_RST) - SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED); + SetStateIn(lnk, ALIAS_TCP_STATE_DISCONNECTED); else if (tc->th_flags & TH_SYN) - SetStateIn(link, ALIAS_TCP_STATE_CONNECTED); + SetStateIn(lnk, ALIAS_TCP_STATE_CONNECTED); break; case ALIAS_TCP_STATE_CONNECTED: if (tc->th_flags & (TH_FIN | TH_RST)) - SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED); + SetStateIn(lnk, ALIAS_TCP_STATE_DISCONNECTED); break; } } static void -TcpMonitorOut(struct ip *pip, struct alias_link *link) +TcpMonitorOut(struct ip *pip, struct alias_link *lnk) { struct tcphdr *tc; tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); - switch (GetStateOut(link)) { + switch (GetStateOut(lnk)) { case ALIAS_TCP_STATE_NOT_CONNECTED: if (tc->th_flags & TH_RST) - SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED); + SetStateOut(lnk, ALIAS_TCP_STATE_DISCONNECTED); else if (tc->th_flags & TH_SYN) - SetStateOut(link, ALIAS_TCP_STATE_CONNECTED); + SetStateOut(lnk, ALIAS_TCP_STATE_CONNECTED); break; case ALIAS_TCP_STATE_CONNECTED: if (tc->th_flags & (TH_FIN | TH_RST)) - SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED); + SetStateOut(lnk, ALIAS_TCP_STATE_DISCONNECTED); break; } } @@ -273,18 +273,18 @@ De-alias incoming echo and timestamp replies. Alias incoming echo and timestamp requests. */ - struct alias_link *link; + struct alias_link *lnk; struct icmp *ic; ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); /* Get source address from ICMP data field and restore original data */ - link = FindIcmpIn(la, pip->ip_src, pip->ip_dst, ic->icmp_id, 1); - if (link != NULL) { + lnk = FindIcmpIn(la, pip->ip_src, pip->ip_dst, ic->icmp_id, 1); + if (lnk != NULL) { u_short original_id; int accumulate; - original_id = GetOriginalPort(link); + original_id = GetOriginalPort(lnk); /* Adjust ICMP checksum */ accumulate = ic->icmp_id; @@ -298,7 +298,7 @@ { struct in_addr original_address; - original_address = GetOriginalAddress(link); + original_address = GetOriginalAddress(lnk); DifferentialChecksum(&pip->ip_sum, &original_address, &pip->ip_dst, 2); pip->ip_dst = original_address; @@ -320,7 +320,7 @@ struct icmp *ic, *ic2; struct udphdr *ud; struct tcphdr *tc; - struct alias_link *link; + struct alias_link *lnk; ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); ip = &ic->icmp_ip; @@ -330,29 +330,29 @@ ic2 = (struct icmp *)ud; if (ip->ip_p == IPPROTO_UDP) - link = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src, + lnk = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src, ud->uh_dport, ud->uh_sport, IPPROTO_UDP, 0); else if (ip->ip_p == IPPROTO_TCP) - link = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src, + lnk = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src, tc->th_dport, tc->th_sport, IPPROTO_TCP, 0); else if (ip->ip_p == IPPROTO_ICMP) { if (ic2->icmp_type == ICMP_ECHO || ic2->icmp_type == ICMP_TSTAMP) - link = FindIcmpIn(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0); + lnk = FindIcmpIn(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0); else - link = NULL; + lnk = NULL; } else - link = NULL; + lnk = NULL; - if (link != NULL) { + if (lnk != NULL) { if (ip->ip_p == IPPROTO_UDP || ip->ip_p == IPPROTO_TCP) { int accumulate, accumulate2; struct in_addr original_address; u_short original_port; - original_address = GetOriginalAddress(link); - original_port = GetOriginalPort(link); + original_address = GetOriginalAddress(lnk); + original_port = GetOriginalPort(lnk); /* Adjust ICMP checksum */ accumulate = twowords(&ip->ip_src); @@ -379,8 +379,8 @@ struct in_addr original_address; u_short original_id; - original_address = GetOriginalAddress(link); - original_id = GetOriginalPort(link); + original_address = GetOriginalAddress(lnk); + original_id = GetOriginalPort(lnk); /* Adjust ICMP checksum */ accumulate = twowords(&ip->ip_src); @@ -417,7 +417,7 @@ /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); @@ -451,18 +451,18 @@ Alias outgoing echo and timestamp requests. De-alias outgoing echo and timestamp replies. */ - struct alias_link *link; + struct alias_link *lnk; struct icmp *ic; ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); /* Save overwritten data for when echo packet returns */ - link = FindIcmpOut(la, pip->ip_src, pip->ip_dst, ic->icmp_id, 1); - if (link != NULL) { + lnk = FindIcmpOut(la, pip->ip_src, pip->ip_dst, ic->icmp_id, 1); + if (lnk != NULL) { u_short alias_id; int accumulate; - alias_id = GetAliasPort(link); + alias_id = GetAliasPort(lnk); /* Since data field is being modified, adjust ICMP checksum */ accumulate = ic->icmp_id; @@ -476,7 +476,7 @@ { struct in_addr alias_address; - alias_address = GetAliasAddress(link); + alias_address = GetAliasAddress(lnk); DifferentialChecksum(&pip->ip_sum, &alias_address, &pip->ip_src, 2); pip->ip_src = alias_address; @@ -499,7 +499,7 @@ struct icmp *ic, *ic2; struct udphdr *ud; struct tcphdr *tc; - struct alias_link *link; + struct alias_link *lnk; ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); ip = &ic->icmp_ip; @@ -509,29 +509,29 @@ ic2 = (struct icmp *)ud; if (ip->ip_p == IPPROTO_UDP) - link = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src, + lnk = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src, ud->uh_dport, ud->uh_sport, IPPROTO_UDP, 0); else if (ip->ip_p == IPPROTO_TCP) - link = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src, + lnk = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src, tc->th_dport, tc->th_sport, IPPROTO_TCP, 0); else if (ip->ip_p == IPPROTO_ICMP) { if (ic2->icmp_type == ICMP_ECHO || ic2->icmp_type == ICMP_TSTAMP) - link = FindIcmpOut(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0); + lnk = FindIcmpOut(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0); else - link = NULL; + lnk = NULL; } else - link = NULL; + lnk = NULL; - if (link != NULL) { + if (lnk != NULL) { if (ip->ip_p == IPPROTO_UDP || ip->ip_p == IPPROTO_TCP) { int accumulate; struct in_addr alias_address; u_short alias_port; - alias_address = GetAliasAddress(link); - alias_port = GetAliasPort(link); + alias_address = GetAliasAddress(lnk); + alias_port = GetAliasPort(lnk); /* Adjust ICMP checksum */ accumulate = twowords(&ip->ip_dst); @@ -558,8 +558,8 @@ struct in_addr alias_address; u_short alias_id; - alias_address = GetAliasAddress(link); - alias_id = GetAliasPort(link); + alias_address = GetAliasAddress(lnk); + alias_id = GetAliasPort(lnk); /* Adjust ICMP checksum */ accumulate = twowords(&ip->ip_dst); @@ -594,9 +594,11 @@ int iresult; struct icmp *ic; + (void)create; + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); ic = (struct icmp *)((char *)pip + (pip->ip_hl << 2)); @@ -632,17 +634,17 @@ the dest IP address of the packet to our inside machine. */ - struct alias_link *link; + struct alias_link *lnk; /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); - link = FindProtoIn(la, pip->ip_src, pip->ip_dst, pip->ip_p); - if (link != NULL) { + lnk = FindProtoIn(la, pip->ip_src, pip->ip_dst, pip->ip_p); + if (lnk != NULL) { struct in_addr original_address; - original_address = GetOriginalAddress(link); + original_address = GetOriginalAddress(lnk); /* Restore original IP address */ DifferentialChecksum(&pip->ip_sum, @@ -663,17 +665,19 @@ only thing which is done in this case is to alias the source IP address of the packet. */ - struct alias_link *link; + struct alias_link *lnk; + + (void)create; /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); - link = FindProtoOut(la, pip->ip_src, pip->ip_dst, pip->ip_p); - if (link != NULL) { + lnk = FindProtoOut(la, pip->ip_src, pip->ip_dst, pip->ip_p); + if (lnk != NULL) { struct in_addr alias_address; - alias_address = GetAliasAddress(link); + alias_address = GetAliasAddress(lnk); /* Change source address */ DifferentialChecksum(&pip->ip_sum, @@ -690,28 +694,28 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; - struct alias_link *link; + struct alias_link *lnk; /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); ud = (struct udphdr *)((char *)pip + (pip->ip_hl << 2)); - link = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, + lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, IPPROTO_UDP, 1); - if (link != NULL) { + if (lnk != NULL) { struct in_addr alias_address; struct in_addr original_address; u_short alias_port; int accumulate; int r = 0; - alias_address = GetAliasAddress(link); - original_address = GetOriginalAddress(link); + alias_address = GetAliasAddress(lnk); + original_address = GetOriginalAddress(lnk); alias_port = ud->uh_dport; - ud->uh_dport = GetOriginalPort(link); + ud->uh_dport = GetOriginalPort(lnk); /* Special processing for IP encoding protocols */ if (ntohs(ud->uh_dport) == CUSEEME_PORT_NUMBER) @@ -719,10 +723,10 @@ /* If NETBIOS Datagram, It should be alias address in UDP Data, too */ else if (ntohs(ud->uh_dport) == NETBIOS_DGM_PORT_NUMBER || ntohs(ud->uh_sport) == NETBIOS_DGM_PORT_NUMBER) - r = AliasHandleUdpNbt(la, pip, link, &original_address, ud->uh_dport); + r = AliasHandleUdpNbt(la, pip, lnk, &original_address, ud->uh_dport); else if (ntohs(ud->uh_dport) == NETBIOS_NS_PORT_NUMBER || ntohs(ud->uh_sport) == NETBIOS_NS_PORT_NUMBER) - r = AliasHandleUdpNbtNS(la, pip, link, &alias_address, &alias_port, + r = AliasHandleUdpNbtNS(la, pip, lnk, &alias_address, &alias_port, &original_address, &ud->uh_dport); /* If UDP checksum is not zero, then adjust since destination port */ @@ -754,34 +758,34 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int create) { struct udphdr *ud; - struct alias_link *link; + struct alias_link *lnk; /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) - return PKT_ALIAS_OK; + return (PKT_ALIAS_OK); ud = (struct udphdr *)((char *)pip + (pip->ip_hl << 2)); - link = FindUdpTcpOut(la, pip->ip_src, pip->ip_dst, + lnk = FindUdpTcpOut(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, IPPROTO_UDP, create); - if (link != NULL) { + if (lnk != NULL) { u_short alias_port; struct in_addr alias_address; - alias_address = GetAliasAddress(link); - alias_port = GetAliasPort(link); + alias_address = GetAliasAddress(lnk); + alias_port = GetAliasPort(lnk); /* Special processing for IP encoding protocols */ if (ntohs(ud->uh_dport) == CUSEEME_PORT_NUMBER) - AliasHandleCUSeeMeOut(la, pip, link); + AliasHandleCUSeeMeOut(la, pip, lnk); /* If NETBIOS Datagram, It should be alias address in UDP Data, too */ else if (ntohs(ud->uh_dport) == NETBIOS_DGM_PORT_NUMBER || ntohs(ud->uh_sport) == NETBIOS_DGM_PORT_NUMBER) - AliasHandleUdpNbt(la, pip, link, &alias_address, alias_port); + AliasHandleUdpNbt(la, pip, lnk, &alias_address, alias_port); else if (ntohs(ud->uh_dport) == NETBIOS_NS_PORT_NUMBER || ntohs(ud->uh_sport) == NETBIOS_NS_PORT_NUMBER) - AliasHandleUdpNbtNS(la, pip, link, &pip->ip_src, &ud->uh_sport, + AliasHandleUdpNbtNS(la, pip, lnk, &pip->ip_src, &ud->uh_sport, &alias_address, &alias_port); /* * We don't know in advance what TID the TFTP server will choose, @@ -822,15 +826,15 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; - struct alias_link *link; + struct alias_link *lnk; tc = (struct tcphdr *)((char *)pip + (pip->ip_hl << 2)); - link = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, + lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, tc->th_sport, tc->th_dport, IPPROTO_TCP, !(la->packetAliasMode & PKT_ALIAS_PROXY_ONLY)); - if (link != NULL) { + if (lnk != NULL) { struct in_addr alias_address; struct in_addr original_address; struct in_addr proxy_address; @@ -841,17 +845,17 @@ /* Special processing for IP encoding protocols */ if (ntohs(tc->th_dport) == PPTP_CONTROL_PORT_NUMBER || ntohs(tc->th_sport) == PPTP_CONTROL_PORT_NUMBER) - AliasHandlePptpIn(la, pip, link); + AliasHandlePptpIn(la, pip, lnk); else if (la->skinnyPort != 0 && (ntohs(tc->th_dport) == la->skinnyPort || ntohs(tc->th_sport) == la->skinnyPort)) - AliasHandleSkinny(la, pip, link); + AliasHandleSkinny(la, pip, lnk); - alias_address = GetAliasAddress(link); - original_address = GetOriginalAddress(link); - proxy_address = GetProxyAddress(link); + alias_address = GetAliasAddress(lnk); + original_address = GetOriginalAddress(lnk); + proxy_address = GetProxyAddress(lnk); alias_port = tc->th_dport; - tc->th_dport = GetOriginalPort(link); - proxy_port = GetProxyPort(link); + tc->th_dport = GetOriginalPort(lnk); + proxy_port = GetProxyPort(lnk); /* Adjust TCP checksum since destination port is being unaliased */ /* and destination port is being altered. */ @@ -870,10 +874,10 @@ accumulate -= twowords(&proxy_address); } >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407060159.i661xSf2099358>