Date: Fri, 13 Apr 2018 16:50:16 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332477 - in user/markj/netdump: . cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common lib/libc/amd64 lib/libc/amd64/sys lib/libc/gen lib/libc/i386 lib/libc/i3... Message-ID: <201804131650.w3DGoGPU039740@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Apr 13 16:50:16 2018 New Revision: 332477 URL: https://svnweb.freebsd.org/changeset/base/332477 Log: MFH at r332476. Added: user/markj/netdump/lib/libc/gen/exect.c - copied unchanged from r332476, head/lib/libc/gen/exect.c user/markj/netdump/sys/dev/altera/msgdma/ - copied from r332476, head/sys/dev/altera/msgdma/ user/markj/netdump/sys/dev/altera/softdma/ - copied from r332476, head/sys/dev/altera/softdma/ user/markj/netdump/sys/dev/netmap/netmap_legacy.c - copied unchanged from r332476, head/sys/dev/netmap/netmap_legacy.c user/markj/netdump/sys/dev/xdma/controller/ - copied from r332476, head/sys/dev/xdma/controller/ user/markj/netdump/sys/dev/xdma/xdma_bank.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_bank.c user/markj/netdump/sys/dev/xdma/xdma_bio.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_bio.c user/markj/netdump/sys/dev/xdma/xdma_mbuf.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_mbuf.c user/markj/netdump/sys/dev/xdma/xdma_queue.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_queue.c user/markj/netdump/sys/dev/xdma/xdma_sg.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_sg.c user/markj/netdump/sys/dev/xdma/xdma_sglist.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_sglist.c user/markj/netdump/sys/mips/beri/beri_mp.c - copied unchanged from r332476, head/sys/mips/beri/beri_mp.c user/markj/netdump/sys/mips/beri/beri_mp.h - copied unchanged from r332476, head/sys/mips/beri/beri_mp.h user/markj/netdump/sys/net/netmap_legacy.h - copied unchanged from r332476, head/sys/net/netmap_legacy.h Deleted: user/markj/netdump/lib/libc/amd64/sys/exect.S user/markj/netdump/lib/libc/i386/sys/exect.S user/markj/netdump/lib/libc/mips/sys/exect.S user/markj/netdump/lib/libc/powerpc/sys/exect.S user/markj/netdump/lib/libc/powerpc64/sys/exect.S user/markj/netdump/lib/libc/sparc64/sys/exect.S user/markj/netdump/sys/dev/altera/atse/a_api.h Modified: user/markj/netdump/Makefile.inc1 user/markj/netdump/ObsoleteFiles.inc user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c user/markj/netdump/lib/libc/amd64/Symbol.map user/markj/netdump/lib/libc/amd64/sys/Makefile.inc user/markj/netdump/lib/libc/gen/Makefile.inc user/markj/netdump/lib/libc/gen/Symbol.map user/markj/netdump/lib/libc/gen/syslog.3 user/markj/netdump/lib/libc/i386/Symbol.map user/markj/netdump/lib/libc/i386/sys/Makefile.inc user/markj/netdump/lib/libc/mips/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc/Symbol.map user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc64/Symbol.map user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc user/markj/netdump/lib/libc/sparc64/Symbol.map user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc user/markj/netdump/release/i386/make-memstick.sh user/markj/netdump/sbin/ipfw/ipfw2.c user/markj/netdump/sbin/ipfw/ipfw2.h user/markj/netdump/sbin/ipfw/ipv6.c user/markj/netdump/share/misc/bsd-family-tree user/markj/netdump/share/misc/committers-src.dot user/markj/netdump/share/mk/bsd.dtb.mk user/markj/netdump/share/mk/bsd.kmod.mk user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/amd64/pmap.c user/markj/netdump/sys/amd64/ia32/ia32_signal.c user/markj/netdump/sys/amd64/linux/linux_sysvec.c user/markj/netdump/sys/amd64/linux32/linux32_sysvec.c user/markj/netdump/sys/cam/scsi/scsi_da.c user/markj/netdump/sys/cam/scsi/scsi_sa.c user/markj/netdump/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/markj/netdump/sys/conf/files user/markj/netdump/sys/conf/kern.mk user/markj/netdump/sys/conf/kmod.mk user/markj/netdump/sys/conf/options.mips user/markj/netdump/sys/dev/altera/atse/if_atse.c user/markj/netdump/sys/dev/altera/atse/if_atse_fdt.c user/markj/netdump/sys/dev/altera/atse/if_atse_nexus.c user/markj/netdump/sys/dev/altera/atse/if_atsereg.h user/markj/netdump/sys/dev/cxgbe/t4_netmap.c user/markj/netdump/sys/dev/ixgbe/if_ixv.c user/markj/netdump/sys/dev/ixl/ixl_pf_main.c user/markj/netdump/sys/dev/ixl/ixl_txrx.c user/markj/netdump/sys/dev/netmap/if_ptnet.c user/markj/netdump/sys/dev/netmap/if_re_netmap.h user/markj/netdump/sys/dev/netmap/if_vtnet_netmap.h user/markj/netdump/sys/dev/netmap/netmap.c user/markj/netdump/sys/dev/netmap/netmap_freebsd.c user/markj/netdump/sys/dev/netmap/netmap_generic.c user/markj/netdump/sys/dev/netmap/netmap_kern.h user/markj/netdump/sys/dev/netmap/netmap_mem2.c user/markj/netdump/sys/dev/netmap/netmap_mem2.h user/markj/netdump/sys/dev/netmap/netmap_monitor.c user/markj/netdump/sys/dev/netmap/netmap_pipe.c user/markj/netdump/sys/dev/netmap/netmap_pt.c user/markj/netdump/sys/dev/netmap/netmap_vale.c user/markj/netdump/sys/dev/ocs_fc/ocs_os.c user/markj/netdump/sys/dev/re/if_re.c user/markj/netdump/sys/dev/vt/font/vt_font_default.c user/markj/netdump/sys/dev/vt/hw/vga/vt_vga.c user/markj/netdump/sys/dev/xdma/xdma.c user/markj/netdump/sys/dev/xdma/xdma.h user/markj/netdump/sys/dev/xdma/xdma_fdt_test.c user/markj/netdump/sys/dev/xdma/xdma_if.m user/markj/netdump/sys/dts/mips/beripad-de4.dts user/markj/netdump/sys/i386/i386/machdep.c user/markj/netdump/sys/mips/beri/files.beri user/markj/netdump/sys/mips/beri/std.beri user/markj/netdump/sys/mips/conf/BERI_DE4_BASE user/markj/netdump/sys/mips/include/cpufunc.h user/markj/netdump/sys/mips/include/hwfunc.h user/markj/netdump/sys/mips/ingenic/jz4780_aic.c user/markj/netdump/sys/mips/ingenic/jz4780_pdma.c user/markj/netdump/sys/mips/ingenic/jz4780_pdma.h user/markj/netdump/sys/mips/mips/mp_machdep.c user/markj/netdump/sys/modules/netmap/Makefile user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/net/netmap.h user/markj/netdump/sys/net/netmap_user.h user/markj/netdump/sys/net/netmap_virt.h user/markj/netdump/sys/netinet6/ip6_fastfwd.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64_translate.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64_translate.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn_control.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64stl.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64stl_control.c user/markj/netdump/sys/sys/param.h user/markj/netdump/sys/sys/proc.h user/markj/netdump/usr.bin/etdump/etdump.c user/markj/netdump/usr.bin/mandoc/Makefile user/markj/netdump/usr.bin/mkimg/mkimg.c user/markj/netdump/usr.bin/mkimg/scheme.h user/markj/netdump/usr.sbin/cron/cron/database.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/cddl/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/Makefile.inc1 ============================================================================== --- user/markj/netdump/Makefile.inc1 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/Makefile.inc1 Fri Apr 13 16:50:16 2018 (r332477) @@ -808,7 +808,8 @@ _cleanobj_fast_depend_hack: .PHONY # 20180404 r332048 sigreturn # 20180405 r332080 shmat # 20180406 r332119 setlogin -.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs +# 20170411 r332443 exect +.for f in exect fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ Modified: user/markj/netdump/ObsoleteFiles.inc ============================================================================== --- user/markj/netdump/ObsoleteFiles.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/ObsoleteFiles.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -40,6 +40,7 @@ # 20180409: remove FDDI support OLD_FILES+=usr/include/net/fddi.h +OLD_FILES+=usr/share/man/man4/fpa.4.gz # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays OLD_DIRS+=boot/overlays # 20180311: remove sys/sys/i386/include/pcaudioio.h @@ -1069,7 +1070,6 @@ OLD_FILES+=usr/share/man/man7/mm.7.gz OLD_FILES+=usr/share/man/man7/mmse.7.gz OLD_FILES+=usr/share/man/man7/ms.7.gz OLD_FILES+=usr/share/man/man7/orig_me.7.gz -OLD_FILES+=usr/share/man/man7/roff.7.gz OLD_FILES+=usr/share/me/acm.me OLD_FILES+=usr/share/me/chars.me OLD_FILES+=usr/share/me/deltext.me Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 13 16:50:16 2018 (r332477) @@ -62,6 +62,7 @@ .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Nm .Cm destroy @@ -115,6 +116,7 @@ .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -961,6 +963,7 @@ do not actually discard any transactions. .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Xc .Pp @@ -1062,6 +1065,18 @@ or .Qq Cm none . For more information on dataset mount points, see .Xr zfs 8 . +.It Fl t Ar tempname +Sets the in-core pool name to +.Pa tempname +while the on-disk name will be the name specified as the pool name +.Pa pool . +This will set the default +.Sy cachefile +property to +.Sy none . +This is intended to handle name space collisions when creating pools +for other systems, such as virtual machines or physical machines +whose pools live on network block devices. .El .It Xo .Nm @@ -1316,6 +1331,7 @@ Searches for and imports all pools found. .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -1375,6 +1391,20 @@ Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root +.It Fl t +Used with +.Ar newpool . +Specifies that +.Ar newpool +is temporary. +Temporary pool names last until export. +Ensures that the original pool name will be used in all label updates and +therefore is retained upon export. +Will also set +.Sy cachefile +property to +.Sy none +when not explicitly specified. .It Fl F Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 13 16:50:16 2018 (r332477) @@ -220,8 +220,9 @@ get_usage(zpool_help_t idx) case HELP_CREATE: return (gettext("\tcreate [-fnd] [-B] " "[-o property=value] ... \n" - "\t [-O file-system-property=value] ... \n" - "\t [-m mountpoint] [-R root] <pool> <vdev> ...\n")); + "\t [-O file-system-property=value] ...\n" + "\t [-m mountpoint] [-R root] [-t tempname] " + "<pool> <vdev> ...\n")); case HELP_CHECKPOINT: return (gettext("\tcheckpoint [--discard] <pool> ...\n")); case HELP_DESTROY: @@ -239,7 +240,7 @@ get_usage(zpool_help_t idx) "[-R root] [-F [-n]] -a\n" "\timport [-o mntopts] [-o property=value] ... \n" "\t [-d dir | -c cachefile] [-D] [-f] [-m] [-N] " - "[-R root] [-F [-n]]\n" + "[-R root] [-F [-n]] [-t]\n" "\t [--rewind-to-checkpoint] <pool | id> [newpool]\n")); case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " @@ -489,6 +490,21 @@ add_prop_list(const char *propname, char *propval, nvl } /* + * Set a default property pair (name, string-value) in a property nvlist + */ +static int +add_prop_list_default(const char *propname, char *propval, nvlist_t **props, + boolean_t poolprop) +{ + char *pval; + + if (nvlist_lookup_string(*props, propname, &pval) == 0) + return (0); + + return (add_prop_list(propname, propval, props, poolprop)); +} + +/* * zpool add [-fn] <pool> <vdev> ... * * -f Force addition of devices, even if they appear in use @@ -850,15 +866,16 @@ errout: /* * zpool create [-fnd] [-B] [-o property=value] ... * [-O file-system-property=value] ... - * [-R root] [-m mountpoint] <pool> <dev> ... + * [-R root] [-m mountpoint] [-t tempname] <pool> <dev> ... * * -B Create boot partition. * -f Force creation, even if devices appear in use * -n Do not create the pool, but display the resulting layout if it * were to be created. - * -R Create a pool under an alternate root - * -m Set default mountpoint for the root dataset. By default it's + * -R Create a pool under an alternate root + * -m Set default mountpoint for the root dataset. By default it's * '/<pool>' + * -t Use the temporary name until the pool is exported. * -o Set property=value. * -d Don't automatically enable all supported pool features * (individual features can be enabled with -o). @@ -882,6 +899,7 @@ zpool_do_create(int argc, char **argv) int c; nvlist_t *nvroot = NULL; char *poolname; + char *tname = NULL; int ret = 1; char *altroot = NULL; char *mountpoint = NULL; @@ -890,7 +908,7 @@ zpool_do_create(int argc, char **argv) char *propval; /* check options */ - while ((c = getopt(argc, argv, ":fndBR:m:o:O:")) != -1) { + while ((c = getopt(argc, argv, ":fndBR:m:o:O:t:")) != -1) { switch (c) { case 'f': force = B_TRUE; @@ -922,11 +940,7 @@ zpool_do_create(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto errout; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto errout; break; @@ -999,6 +1013,27 @@ zpool_do_create(int argc, char **argv) goto errout; } break; + case 't': + /* + * Sanity check temporary pool name. + */ + if (strchr(optarg, '/') != NULL) { + (void) fprintf(stderr, gettext("cannot create " + "'%s': invalid character '/' in temporary " + "name\n"), optarg); + (void) fprintf(stderr, gettext("use 'zfs " + "create' to create a dataset\n")); + goto errout; + } + + if (add_prop_list(zpool_prop_to_name( + ZPOOL_PROP_TNAME), optarg, &props, B_TRUE)) + goto errout; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto errout; + tname = optarg; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -1205,8 +1240,8 @@ zpool_do_create(int argc, char **argv) ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { - zfs_handle_t *pool = zfs_open(g_zfs, poolname, - ZFS_TYPE_FILESYSTEM); + zfs_handle_t *pool = zfs_open(g_zfs, + tname ? tname : poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); @@ -2162,7 +2197,8 @@ zpool_do_checkpoint(int argc, char **argv) * import [-o mntopts] [-o prop=value] ... [-R root] [-D] * [-d dir | -c cachefile] [-f] -a * import [-o mntopts] [-o prop=value] ... [-R root] [-D] - * [-d dir | -c cachefile] [-f] [-n] [-F] <pool | id> [newpool] + * [-d dir | -c cachefile] [-f] [-n] [-F] [-t] + * <pool | id> [newpool] * * -c Read pool information from a cachefile instead of searching * devices. @@ -2191,6 +2227,9 @@ zpool_do_checkpoint(int argc, char **argv) * * -N Import the pool but don't mount datasets. * + * -t Use newpool as a temporary pool name instead of renaming + * the pool. + * * -T Specify a starting txg to use for import. This option is * intentionally undocumented option for testing purposes. * @@ -2241,7 +2280,7 @@ zpool_do_import(int argc, char **argv) }; /* check options */ - while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX", + while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:tT:VX", long_options, NULL)) != -1) { switch (c) { case 'a': @@ -2296,14 +2335,16 @@ zpool_do_import(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto error; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto error; break; + case 't': + flags |= ZFS_IMPORT_TEMP_NAME; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto error; + break; case 'T': errno = 0; txg = strtoull(optarg, &endptr, 0); @@ -2439,9 +2480,9 @@ zpool_do_import(int argc, char **argv) (void) fprintf(stderr, gettext("cannot import '%s': " "a pool with that name already exists\n"), argv[0]); - (void) fprintf(stderr, gettext("use the form '%s " - "<pool | id> <newpool>' to give it a new name\n"), - "zpool import"); + (void) fprintf(stderr, gettext("use the form 'zpool import " + "[-t] <pool | id> <newpool>' to give it a new temporary " + "or permanent name\n")); err = 1; } else if (pools == NULL && idata.exists) { (void) fprintf(stderr, gettext("cannot import '%s': " Modified: user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 13 16:50:16 2018 (r332477) @@ -644,11 +644,22 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char goto error; } break; + case ZPOOL_PROP_READONLY: if (!flags.import) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property '%s' can only be set at " "import time"), propname); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + + case ZPOOL_PROP_TNAME: + if (!flags.create) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property '%s' can only be set at " + "creation time"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } Modified: user/markj/netdump/lib/libc/amd64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/amd64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/amd64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -40,7 +40,6 @@ FBSD_1.0 { amd64_set_fsbase; amd64_set_gsbase; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -8,8 +8,7 @@ SRCS+= \ amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S +MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/gen/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/gen/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -41,6 +41,7 @@ SRCS+= __getosreldate.c \ errlst.c \ errno.c \ exec.c \ + exect.c \ fdevname.c \ feature_present.c \ fmtcheck.c \ Modified: user/markj/netdump/lib/libc/gen/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/gen/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -105,6 +105,7 @@ FBSD_1.0 { sys_errlist; sys_nerr; errno; + exect; execl; execle; execlp; Copied: user/markj/netdump/lib/libc/gen/exect.c (from r332476, head/lib/libc/gen/exect.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/gen/exect.c Fri Apr 13 16:50:16 2018 (r332477, copy of r332476, head/lib/libc/gen/exect.c) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2018 Ali Mashtizadeh <ali@mashtizadeh.com> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/ptrace.h> + +#include <errno.h> +#include <unistd.h> + +int +exect(const char *path, char *const argv[], char *const envp[]) +{ + + if (ptrace(PT_TRACE_ME, 0, 0, 0) != 0) { + if (errno != EBUSY) + return (-1); + } + + return (execve(path, argv, envp)); +} Modified: user/markj/netdump/lib/libc/gen/syslog.3 ============================================================================== --- user/markj/netdump/lib/libc/gen/syslog.3 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/syslog.3 Fri Apr 13 16:50:16 2018 (r332477) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2018 +.Dd April 12, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -295,4 +295,4 @@ for later interpolation by .Pp Always use the proper secure idiom: .Pp -.Dl syslog(priority, "%s", string); +.Dl syslog(priority, \*q%s\*q, string); Modified: user/markj/netdump/lib/libc/i386/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/i386/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/i386/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -31,7 +31,6 @@ FBSD_1.0 { ntohs; vfork; brk; - exect; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; Modified: user/markj/netdump/lib/libc/i386/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/i386/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/i386/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -7,8 +7,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S syscall.S NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/mips/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/mips/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/mips/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -2,8 +2,7 @@ SRCS+= trivial-vdso_tc.c -MDASM= Ovfork.S brk.S cerror.S exect.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/powerpc/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/powerpc/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: user/markj/netdump/lib/libc/powerpc64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: user/markj/netdump/lib/libc/sparc64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/sparc64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/sparc64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; @@ -82,8 +81,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_brk; _brk; - __sys_exect; - _exect; _end; __sys_sbrk; _sbrk; Modified: user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S +MDASM+= brk.S cerror.S sbrk.S sigaction1.S Modified: user/markj/netdump/release/i386/make-memstick.sh ============================================================================== --- user/markj/netdump/release/i386/make-memstick.sh Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/release/i386/make-memstick.sh Fri Apr 13 16:50:16 2018 (r332477) @@ -36,11 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt \ - -b ${1}/boot/pmbr \ - -p freebsd-boot:=${1}/boot/gptboot \ - -p freebsd-ufs:=${2}.part \ - -p freebsd-swap::1M \ +mkimg -s mbr \ + -b ${1}/boot/mbr \ + -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${2}.part Modified: user/markj/netdump/sbin/ipfw/ipfw2.c ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw2.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipfw2.c Fri Apr 13 16:50:16 2018 (r332477) @@ -1176,8 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, - char const *s) +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd) { struct hostent *he = NULL; struct in_addr *ia; @@ -1185,6 +1184,7 @@ print_ip(struct buf_pr *bp, const struct format_opts * uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; char *t; + bprintf(bp, " "); if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { uint32_t d = a[1]; const char *arg = "<invalid>"; @@ -1192,12 +1192,9 @@ print_ip(struct buf_pr *bp, const struct format_opts * if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) arg = match_value(rule_options, lookup_key[d]); t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1); - bprintf(bp, "%s lookup %s %s", cmd->o.len & F_NOT ? " not": "", - arg, t); + bprintf(bp, "lookup %s %s", arg, t); return; } - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); - if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { bprintf(bp, "me"); return; @@ -1468,7 +1465,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP_DST_MASK: case O_IP_DST_ME: case O_IP_DST_SET: - print_ip(bp, fo, insntod(cmd, ip), ""); + print_ip(bp, fo, insntod(cmd, ip)); break; case O_IP6_SRC: case O_IP6_SRC_MASK: @@ -1476,7 +1473,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP6_DST: case O_IP6_DST_MASK: case O_IP6_DST_ME: - print_ip6(bp, insntod(cmd, ip6), ""); + print_ip6(bp, insntod(cmd, ip6)); break; case O_FLOW6ID: print_flow6id(bp, insntod(cmd, u32)); Modified: user/markj/netdump/sbin/ipfw/ipfw2.h ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw2.h Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipfw2.h Fri Apr 13 16:50:16 2018 (r332477) @@ -401,7 +401,7 @@ int ipfw_delete_pipe(int pipe_or_queue, int n); /* ipv6.c */ void print_unreach6_code(struct buf_pr *bp, uint16_t code); -void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd, char const *s); +void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd); void print_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct buf_pr *bp, struct _ipfw_insn *cmd ); Modified: user/markj/netdump/sbin/ipfw/ipv6.c ============================================================================== --- user/markj/netdump/sbin/ipfw/ipv6.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipv6.c Fri Apr 13 16:50:16 2018 (r332477) @@ -48,11 +48,11 @@ } while (0) static struct _s_x icmp6codes[] = { - { "no-route", ICMP6_DST_UNREACH_NOROUTE }, - { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, - { "address", ICMP6_DST_UNREACH_ADDR }, - { "port", ICMP6_DST_UNREACH_NOPORT }, - { NULL, 0 } + { "no-route", ICMP6_DST_UNREACH_NOROUTE }, + { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, + { "address", ICMP6_DST_UNREACH_ADDR }, + { "port", ICMP6_DST_UNREACH_NOPORT }, + { NULL, 0 } }; void @@ -85,54 +85,56 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code) * Print the ip address contained in a command. */ void -print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char const *s) +print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd) { - struct hostent *he = NULL; - int len = F_LEN((ipfw_insn *) cmd) - 1; - struct in6_addr *a = &(cmd->addr6); - char trad[255]; + char trad[255]; + struct hostent *he = NULL; + struct in6_addr *a = &(cmd->addr6); + int len, mb; - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); + len = F_LEN((ipfw_insn *) cmd) - 1; + if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { + bprintf(bp, " me6"); + return; + } + if (cmd->o.opcode == O_IP6) { + bprintf(bp, " ip6"); + return; + } - if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { - bprintf(bp, "me6"); - return; - } - if (cmd->o.opcode == O_IP6) { - bprintf(bp, " ip6"); - return; - } + /* + * len == 4 indicates a single IP, whereas lists of 1 or more + * addr/mask pairs have len = (2n+1). We convert len to n so we + * use that to count the number of entries. + */ + bprintf(bp, " "); + for (len = len / 4; len > 0; len -= 2, a += 2) { + /* mask length */ + mb = (cmd->o.opcode == O_IP6_SRC || + cmd->o.opcode == O_IP6_DST) ? 128: + contigmask((uint8_t *)&(a[1]), 128); - /* - * len == 4 indicates a single IP, whereas lists of 1 or more - * addr/mask pairs have len = (2n+1). We convert len to n so we - * use that to count the number of entries. - */ + if (mb == 128 && co.do_resolv) + he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); - for (len = len / 4; len > 0; len -= 2, a += 2) { - int mb = /* mask length */ - (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ? - 128 : contigmask((uint8_t *)&(a[1]), 128); - - if (mb == 128 && co.do_resolv) - he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); - if (he != NULL) /* resolved to name */ - bprintf(bp, "%s", he->h_name); - else if (mb == 0) /* any */ - bprintf(bp, "any"); - else { /* numeric IP followed by some kind of mask */ - if (inet_ntop(AF_INET6, a, trad, sizeof( trad ) ) == NULL) - bprintf(bp, "Error ntop in print_ip6\n"); - bprintf(bp, "%s", trad ); - if (mb < 0) /* mask not contiguous */ - bprintf(bp, "/%s", - inet_ntop(AF_INET6, &a[1], trad, sizeof(trad))); - else if (mb < 128) - bprintf(bp, "/%d", mb); - } - if (len > 2) - bprintf(bp, ","); - } + if (he != NULL) /* resolved to name */ + bprintf(bp, "%s", he->h_name); + else if (mb == 0) /* any */ + bprintf(bp, "any"); + else { /* numeric IP followed by some kind of mask */ + if (inet_ntop(AF_INET6, a, trad, + sizeof(trad)) == NULL) + bprintf(bp, "Error ntop in print_ip6\n"); + bprintf(bp, "%s", trad ); + if (mb < 0) /* mask not contiguous */ + bprintf(bp, "/%s", inet_ntop(AF_INET6, &a[1], + trad, sizeof(trad))); + else if (mb < 128) + bprintf(bp, "/%d", mb); + } + if (len > 2) + bprintf(bp, ","); + } } void @@ -144,163 +146,154 @@ fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cb bzero(cmd, sizeof(*cmd)); while (*av) { - if (*av == ',') - av++; - type = strtoul(av, &av, 0); - if (*av != ',' && *av != '\0') - errx(EX_DATAERR, "invalid ICMP6 type"); - /* - * XXX: shouldn't this be 0xFF? I can't see any reason why - * we shouldn't be able to filter all possiable values - * regardless of the ability of the rest of the kernel to do - * anything useful with them. - */ - if (type > ICMP6_MAXTYPE) - errx(EX_DATAERR, "ICMP6 type out of range"); - cmd->d[type / 32] |= ( 1 << (type % 32)); + if (*av == ',') + av++; + type = strtoul(av, &av, 0); + if (*av != ',' && *av != '\0') + errx(EX_DATAERR, "invalid ICMP6 type"); + /* + * XXX: shouldn't this be 0xFF? I can't see any reason why + * we shouldn't be able to filter all possiable values + * regardless of the ability of the rest of the kernel to do + * anything useful with them. + */ + if (type > ICMP6_MAXTYPE) + errx(EX_DATAERR, "ICMP6 type out of range"); + cmd->d[type / 32] |= ( 1 << (type % 32)); } cmd->o.opcode = O_ICMP6TYPE; cmd->o.len |= F_INSN_SIZE(ipfw_insn_icmp6); } - void print_icmp6types(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - int i, j; - char sep= ' '; + int i, j; + char sep= ' '; - bprintf(bp, " ip6 icmp6types"); - for (i = 0; i < 7; i++) - for (j=0; j < 32; ++j) { - if ( (cmd->d[i] & (1 << (j))) == 0) - continue; - bprintf(bp, "%c%d", sep, (i*32 + j)); - sep = ','; - } + bprintf(bp, " ip6 icmp6types"); + for (i = 0; i < 7; i++) + for (j=0; j < 32; ++j) { + if ( (cmd->d[i] & (1 << (j))) == 0) + continue; + bprintf(bp, "%c%d", sep, (i*32 + j)); + sep = ','; + } } void print_flow6id(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - uint16_t i, limit = cmd->o.arg1; - char sep = ','; + uint16_t i, limit = cmd->o.arg1; + char sep = ','; - bprintf(bp, " flow-id "); - for( i=0; i < limit; ++i) { - if (i == limit - 1) - sep = ' '; - bprintf(bp, "%d%c", cmd->d[i], sep); - } + bprintf(bp, " flow-id "); + for( i=0; i < limit; ++i) { + if (i == limit - 1) + sep = ' '; + bprintf(bp, "%d%c", cmd->d[i], sep); + } } /* structure and define for the extension header in ipv6 */ static struct _s_x ext6hdrcodes[] = { - { "frag", EXT_FRAGMENT }, - { "hopopt", EXT_HOPOPTS }, - { "route", EXT_ROUTING }, - { "dstopt", EXT_DSTOPTS }, - { "ah", EXT_AH }, - { "esp", EXT_ESP }, - { "rthdr0", EXT_RTHDR0 }, - { "rthdr2", EXT_RTHDR2 }, - { NULL, 0 } + { "frag", EXT_FRAGMENT }, + { "hopopt", EXT_HOPOPTS }, + { "route", EXT_ROUTING }, + { "dstopt", EXT_DSTOPTS }, + { "ah", EXT_AH }, + { "esp", EXT_ESP }, + { "rthdr0", EXT_RTHDR0 }, + { "rthdr2", EXT_RTHDR2 }, + { NULL, 0 } }; /* fills command for the extension header filtering */ int fill_ext6hdr( ipfw_insn *cmd, char *av) { - int tok; - char *s = av; + int tok; + char *s = av; - cmd->arg1 = 0; - - while(s) { - av = strsep( &s, ",") ; - tok = match_token(ext6hdrcodes, av); - switch (tok) { - case EXT_FRAGMENT: - cmd->arg1 |= EXT_FRAGMENT; - break; - - case EXT_HOPOPTS: - cmd->arg1 |= EXT_HOPOPTS; - break; - - case EXT_ROUTING: - cmd->arg1 |= EXT_ROUTING; - break; - - case EXT_DSTOPTS: - cmd->arg1 |= EXT_DSTOPTS; - break; - - case EXT_AH: - cmd->arg1 |= EXT_AH; - break; - - case EXT_ESP: - cmd->arg1 |= EXT_ESP; - break; - - case EXT_RTHDR0: - cmd->arg1 |= EXT_RTHDR0; - break; - - case EXT_RTHDR2: - cmd->arg1 |= EXT_RTHDR2; - break; - - default: - errx( EX_DATAERR, "invalid option for ipv6 exten header" ); - break; - } - } - if (cmd->arg1 == 0 ) - return 0; - cmd->opcode = O_EXT_HDR; - cmd->len |= F_INSN_SIZE( ipfw_insn ); - return 1; + cmd->arg1 = 0; + while(s) { + av = strsep( &s, ",") ; + tok = match_token(ext6hdrcodes, av); + switch (tok) { + case EXT_FRAGMENT: + cmd->arg1 |= EXT_FRAGMENT; + break; + case EXT_HOPOPTS: + cmd->arg1 |= EXT_HOPOPTS; + break; + case EXT_ROUTING: + cmd->arg1 |= EXT_ROUTING; + break; + case EXT_DSTOPTS: + cmd->arg1 |= EXT_DSTOPTS; + break; + case EXT_AH: + cmd->arg1 |= EXT_AH; + break; + case EXT_ESP: + cmd->arg1 |= EXT_ESP; + break; + case EXT_RTHDR0: + cmd->arg1 |= EXT_RTHDR0; + break; + case EXT_RTHDR2: + cmd->arg1 |= EXT_RTHDR2; + break; + default: + errx(EX_DATAERR, + "invalid option for ipv6 exten header"); + break; + } + } + if (cmd->arg1 == 0) + return (0); + cmd->opcode = O_EXT_HDR; + cmd->len |= F_INSN_SIZE(ipfw_insn); + return (1); } void print_ext6hdr(struct buf_pr *bp, ipfw_insn *cmd ) { - char sep = ' '; + char sep = ' '; - bprintf(bp, " extension header:"); - if (cmd->arg1 & EXT_FRAGMENT ) { - bprintf(bp, "%cfragmentation", sep); - sep = ','; - } - if (cmd->arg1 & EXT_HOPOPTS ) { - bprintf(bp, "%chop options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ROUTING ) { - bprintf(bp, "%crouting options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR0 ) { - bprintf(bp, "%crthdr0", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR2 ) { - bprintf(bp, "%crthdr2", sep); - sep = ','; - } - if (cmd->arg1 & EXT_DSTOPTS ) { - bprintf(bp, "%cdestination options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_AH ) { - bprintf(bp, "%cauthentication header", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ESP ) { - bprintf(bp, "%cencapsulated security payload", sep); - } + bprintf(bp, " extension header:"); + if (cmd->arg1 & EXT_FRAGMENT) { + bprintf(bp, "%cfragmentation", sep); + sep = ','; + } + if (cmd->arg1 & EXT_HOPOPTS) { + bprintf(bp, "%chop options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_ROUTING) { + bprintf(bp, "%crouting options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR0) { + bprintf(bp, "%crthdr0", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR2) { + bprintf(bp, "%crthdr2", sep); + sep = ','; + } + if (cmd->arg1 & EXT_DSTOPTS) { + bprintf(bp, "%cdestination options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_AH) { + bprintf(bp, "%cauthentication header", sep); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804131650.w3DGoGPU039740>