From owner-svn-src-projects@freebsd.org Sun Mar 29 23:33:32 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 063D226825E for ; Sun, 29 Mar 2020 23:33:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48rBjk13d7z3GZV; Sun, 29 Mar 2020 23:33:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ADE8918B; Sun, 29 Mar 2020 23:33:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02TNXJSO006966; Sun, 29 Mar 2020 23:33:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02TNXCRo006926; Sun, 29 Mar 2020 23:33:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <202003292333.02TNXCRo006926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 29 Mar 2020 23:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r359430 - in projects/kyua-use-googletest-test-interface: bin/sh cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool contrib/binutils/gas contrib/ipfilter contrib/ipfilt... X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in projects/kyua-use-googletest-test-interface: bin/sh cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool contrib/binutils/gas contrib/ipfilter contrib/ipfilter/tools contrib/openbsm/... X-SVN-Commit-Revision: 359430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2020 23:33:32 -0000 Author: ngie Date: Sun Mar 29 23:33:12 2020 New Revision: 359430 URL: https://svnweb.freebsd.org/changeset/base/359430 Log: MFhead@r359429 Added: projects/kyua-use-googletest-test-interface/tests/sys/net/routing/generic_cleanup.sh - copied unchanged from r359429, head/tests/sys/net/routing/generic_cleanup.sh projects/kyua-use-googletest-test-interface/tests/sys/net/routing/params.h - copied unchanged from r359429, head/tests/sys/net/routing/params.h Modified: projects/kyua-use-googletest-test-interface/bin/sh/input.c projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h projects/kyua-use-googletest-test-interface/contrib/binutils/gas/dwarf2dbg.h projects/kyua-use-googletest-test-interface/contrib/ipfilter/ipf.h projects/kyua-use-googletest-test-interface/contrib/ipfilter/tools/ipnat.c projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.1 projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.c projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.h projects/kyua-use-googletest-test-interface/contrib/tcsh/tc.sig.c projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/ext.h projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/global.c projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/sys_term.c projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/telnetd.c projects/kyua-use-googletest-test-interface/crypto/openssh/session.c projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/fsck.h projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/gjournal.c projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/globs.c projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/setup.c projects/kyua-use-googletest-test-interface/sbin/fsdb/fsdb.c projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.c projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.h projects/kyua-use-googletest-test-interface/share/man/man4/tcp.4 projects/kyua-use-googletest-test-interface/share/man/man7/arch.7 projects/kyua-use-googletest-test-interface/stand/efi/libefi/efi_console.c projects/kyua-use-googletest-test-interface/stand/libsa/stand.h projects/kyua-use-googletest-test-interface/stand/libsa/zfs/zfs.c projects/kyua-use-googletest-test-interface/stand/userboot/userboot/libuserboot.h projects/kyua-use-googletest-test-interface/sys/arm/include/atomic-v6.h projects/kyua-use-googletest-test-interface/sys/dev/evdev/cdev.c projects/kyua-use-googletest-test-interface/sys/dev/sound/pci/hda/hdac.c projects/kyua-use-googletest-test-interface/sys/netinet/sctp_cc_functions.c projects/kyua-use-googletest-test-interface/sys/netinet/sctp_constants.h projects/kyua-use-googletest-test-interface/sys/netinet/sctp_input.c projects/kyua-use-googletest-test-interface/sys/netinet/sctp_pcb.c projects/kyua-use-googletest-test-interface/sys/netinet/sctp_timer.c projects/kyua-use-googletest-test-interface/sys/netinet/sctp_usrreq.c projects/kyua-use-googletest-test-interface/sys/netinet/sctputil.c projects/kyua-use-googletest-test-interface/sys/netinet/sctputil.h projects/kyua-use-googletest-test-interface/sys/vm/vm_page.c projects/kyua-use-googletest-test-interface/tests/sys/net/routing/Makefile projects/kyua-use-googletest-test-interface/tests/sys/net/routing/rtsock_common.h projects/kyua-use-googletest-test-interface/tests/sys/net/routing/rtsock_config.h projects/kyua-use-googletest-test-interface/tests/sys/net/routing/test_rtsock_l3.c projects/kyua-use-googletest-test-interface/tests/sys/net/routing/test_rtsock_lladdr.c projects/kyua-use-googletest-test-interface/usr.bin/calendar/calendars/calendar.holiday projects/kyua-use-googletest-test-interface/usr.bin/kyua/Makefile projects/kyua-use-googletest-test-interface/usr.bin/locate/locate/locate.c projects/kyua-use-googletest-test-interface/usr.bin/locate/locate/locate.h projects/kyua-use-googletest-test-interface/usr.bin/ncal/ncal.1 projects/kyua-use-googletest-test-interface/usr.bin/ncal/ncal.c projects/kyua-use-googletest-test-interface/usr.bin/systat/swap.c projects/kyua-use-googletest-test-interface/usr.sbin/config/config.h projects/kyua-use-googletest-test-interface/usr.sbin/config/main.c Directory Properties: projects/kyua-use-googletest-test-interface/ (props changed) projects/kyua-use-googletest-test-interface/cddl/ (props changed) projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/ (props changed) projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zfs/ (props changed) projects/kyua-use-googletest-test-interface/contrib/binutils/ (props changed) projects/kyua-use-googletest-test-interface/contrib/ipfilter/ (props changed) projects/kyua-use-googletest-test-interface/contrib/openbsm/ (props changed) projects/kyua-use-googletest-test-interface/contrib/tcsh/ (props changed) projects/kyua-use-googletest-test-interface/crypto/openssh/ (props changed) Modified: projects/kyua-use-googletest-test-interface/bin/sh/input.c ============================================================================== --- projects/kyua-use-googletest-test-interface/bin/sh/input.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/bin/sh/input.c Sun Mar 29 23:33:12 2020 (r359430) @@ -102,8 +102,6 @@ static struct parsefile basepf = { /* top level input static struct parsefile *parsefile = &basepf; /* current input file */ int whichprompt; /* 1 == PS1, 2 == PS2 */ -EditLine *el; /* cookie for editline package */ - static void pushfile(void); static int preadfd(void); static void popstring(void); Modified: projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h ============================================================================== --- projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h Sun Mar 29 23:33:12 2020 (r359430) @@ -33,7 +33,7 @@ extern "C" { void * safe_malloc(size_t size); void nomem(void); -libzfs_handle_t *g_zfs; +extern libzfs_handle_t *g_zfs; #ifdef __cplusplus } Modified: projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Mar 29 23:33:12 2020 (r359430) @@ -64,6 +64,8 @@ #include "statcommon.h" +libzfs_handle_t *g_zfs; + static int zpool_do_create(int, char **); static int zpool_do_destroy(int, char **); Modified: projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h ============================================================================== --- projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h Sun Mar 29 23:33:12 2020 (r359430) @@ -64,7 +64,7 @@ void pool_list_free(zpool_list_t *); int pool_list_count(zpool_list_t *); void pool_list_remove(zpool_list_t *, zpool_handle_t *); -libzfs_handle_t *g_zfs; +extern libzfs_handle_t *g_zfs; #ifdef __cplusplus } Modified: projects/kyua-use-googletest-test-interface/contrib/binutils/gas/dwarf2dbg.h ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/binutils/gas/dwarf2dbg.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/binutils/gas/dwarf2dbg.h Sun Mar 29 23:33:12 2020 (r359430) @@ -78,7 +78,7 @@ extern void dwarf2_emit_label (symbolS *); /* True when we're supposed to set the basic block mark whenever a label is seen. Unless the target is doing Something Weird, just call dwarf2_emit_label. */ -bfd_boolean dwarf2_loc_mark_labels; +extern bfd_boolean dwarf2_loc_mark_labels; extern void dwarf2_finish (void); Modified: projects/kyua-use-googletest-test-interface/contrib/ipfilter/ipf.h ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/ipfilter/ipf.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/ipfilter/ipf.h Sun Mar 29 23:33:12 2020 (r359430) @@ -191,7 +191,7 @@ typedef int (* addfunc_t) __P((int, ioctlfunc_t, void typedef int (* copyfunc_t) __P((void *, void *, size_t)); -extern char thishost[]; +extern char thishost[MAXHOSTNAMELEN]; extern char flagset[]; extern u_char flags[]; extern struct ipopt_names ionames[]; Modified: projects/kyua-use-googletest-test-interface/contrib/ipfilter/tools/ipnat.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/ipfilter/tools/ipnat.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/ipfilter/tools/ipnat.c Sun Mar 29 23:33:12 2020 (r359430) @@ -60,7 +60,6 @@ static const char rcsid[] = "@(#)$Id$"; #define bzero(a,b) memset(a,0,b) #endif int use_inet6 = 0; -char thishost[MAXHOSTNAMELEN]; extern char *optarg; Modified: projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.1 ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.1 Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.1 Sun Mar 29 23:33:12 2020 (r359430) @@ -25,7 +25,7 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 24, 2004 +.Dd February 20, 2020 .Dt AUDITREDUCE 1 .Os .Sh NAME @@ -47,6 +47,7 @@ .Op Fl r Ar ruid .Op Fl u Ar auid .Op Fl v +.Op Fl z Ar zone .Op Ar .Sh DESCRIPTION The @@ -129,6 +130,10 @@ Select records with the given real user ID or name. Select records with the given audit ID. .It Fl v Invert sense of matching, to select records that do not match. +.It Fl z Ar zone +Select records from the given zone(s). +.Ar zone +is a glob for zones to match. .El .Sh EXAMPLES To select all records associated with effective user ID root from the audit Modified: projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.c Sun Mar 29 23:33:12 2020 (r359430) @@ -62,6 +62,7 @@ #include #include +#include #include #include #include @@ -94,6 +95,7 @@ static int p_egid; /* Effective group id. */ static int p_rgid; /* Real group id. */ static int p_ruid; /* Real user id. */ static int p_subid; /* Subject id. */ +static const char *p_zone; /* Zone. */ /* * Maintain a dynamically sized array of events for -m @@ -114,6 +116,8 @@ static char *p_sockobj = NULL; static uint32_t opttochk = 0; +static int select_zone(const char *zone, uint32_t *optchkd); + static void parse_regexp(char *re_string) { @@ -186,6 +190,7 @@ usage(const char *msg) fprintf(stderr, "\t-r : real user\n"); fprintf(stderr, "\t-u : audit user\n"); fprintf(stderr, "\t-v : select non-matching records\n"); + fprintf(stderr, "\t-z : zone name\n"); exit(EX_USAGE); } @@ -493,6 +498,21 @@ select_subj32(tokenstr_t tok, uint32_t *optchkd) } /* + * Check if the given zone matches the selection criteria. + */ +static int +select_zone(const char *zone, uint32_t *optchkd) +{ + + SETOPT((*optchkd), OPT_z); + if (ISOPTSET(opttochk, OPT_z) && p_zone != NULL) { + if (fnmatch(p_zone, zone, FNM_PATHNAME) != 0) + return (0); + } + return (1); +} + +/* * Read each record from the audit trail. Check if it is selected after * passing through each of the options */ @@ -559,6 +579,10 @@ select_records(FILE *fp) tok_hdr32_copy, &optchkd); break; + case AUT_ZONENAME: + selected = select_zone(tok.tt.zonename.zonename, &optchkd); + break; + default: break; } @@ -629,7 +653,7 @@ main(int argc, char **argv) converr = NULL; - while ((ch = getopt(argc, argv, "Aa:b:c:d:e:f:g:j:m:o:r:u:v")) != -1) { + while ((ch = getopt(argc, argv, "Aa:b:c:d:e:f:g:j:m:o:r:u:vz:")) != -1) { switch(ch) { case 'A': SETOPT(opttochk, OPT_A); @@ -781,6 +805,11 @@ main(int argc, char **argv) case 'v': SETOPT(opttochk, OPT_v); + break; + + case 'z': + p_zone = optarg; + SETOPT(opttochk, OPT_z); break; case '?': Modified: projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.h ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/openbsm/bin/auditreduce/auditreduce.h Sun Mar 29 23:33:12 2020 (r359430) @@ -57,6 +57,7 @@ struct re_entry { #define OPT_u 0x00010000 #define OPT_A 0x00020000 #define OPT_v 0x00040000 +#define OPT_z 0x00080000 #define FILEOBJ "file" #define MSGQIDOBJ "msgqid" Modified: projects/kyua-use-googletest-test-interface/contrib/tcsh/tc.sig.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/tcsh/tc.sig.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/tcsh/tc.sig.c Sun Mar 29 23:33:12 2020 (r359430) @@ -56,7 +56,6 @@ int alrmcatch_disabled; /* = 0; */ int phup_disabled; /* = 0; */ int pchild_disabled; /* = 0; */ int pintr_disabled; /* = 0; */ -int handle_interrupt; /* = 0; */ int handle_pending_signals(void) Modified: projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/ext.h ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/ext.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/ext.h Sun Mar 29 23:33:12 2020 (r359430) @@ -30,53 +30,57 @@ * $FreeBSD$ */ +#ifndef EXTERN +#define EXTERN extern +#endif + /* * Telnet server variable declarations */ -extern char options[256]; -extern char do_dont_resp[256]; -extern char will_wont_resp[256]; -extern int linemode; /* linemode on/off */ +EXTERN char options[256]; +EXTERN char do_dont_resp[256]; +EXTERN char will_wont_resp[256]; +EXTERN int linemode; /* linemode on/off */ #ifdef LINEMODE -extern int uselinemode; /* what linemode to use (on/off) */ -extern int editmode; /* edit modes in use */ -extern int useeditmode; /* edit modes to use */ -extern int alwayslinemode; /* command line option */ -extern int lmodetype; /* Client support for linemode */ +EXTERN int uselinemode; /* what linemode to use (on/off) */ +EXTERN int editmode; /* edit modes in use */ +EXTERN int useeditmode; /* edit modes to use */ +EXTERN int alwayslinemode; /* command line option */ +EXTERN int lmodetype; /* Client support for linemode */ #endif /* LINEMODE */ -extern int flowmode; /* current flow control state */ -extern int restartany; /* restart output on any character state */ +EXTERN int flowmode; /* current flow control state */ +EXTERN int restartany; /* restart output on any character state */ #ifdef DIAGNOSTICS -extern int diagnostic; /* telnet diagnostic capabilities */ +EXTERN int diagnostic; /* telnet diagnostic capabilities */ #endif /* DIAGNOSTICS */ #ifdef BFTPDAEMON -extern int bftpd; /* behave as bftp daemon */ +EXTERN int bftpd; /* behave as bftp daemon */ #endif /* BFTPDAEMON */ #ifdef AUTHENTICATION -extern int auth_level; +EXTERN int auth_level; #endif -extern slcfun slctab[NSLC + 1]; /* slc mapping table */ +EXTERN slcfun slctab[NSLC + 1]; /* slc mapping table */ -char *terminaltype; +EXTERN char *terminaltype; /* * I/O data buffers, pointers, and counters. */ -extern char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; +EXTERN char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; -extern char netibuf[BUFSIZ], *netip; +EXTERN char netibuf[BUFSIZ], *netip; -extern char netobuf[BUFSIZ], *nfrontp, *nbackp; -extern char *neturg; /* one past last bye of urgent data */ +EXTERN char netobuf[BUFSIZ], *nfrontp, *nbackp; +EXTERN char *neturg; /* one past last bye of urgent data */ -extern int pcc, ncc; +EXTERN int pcc, ncc; -extern int pty, net; -extern char line[32]; -extern int SYNCHing; /* we are in TELNET SYNCH mode */ +EXTERN int pty, net; +EXTERN char line[32]; +EXTERN int SYNCHing; /* we are in TELNET SYNCH mode */ -extern void +EXTERN void _termstat(void), add_slc(char, char, cc_t), check_slc(void), @@ -133,7 +137,7 @@ extern void tty_binaryin(int), tty_binaryout(int); -extern int +EXTERN int end_slc(unsigned char **), getnpty(void), #ifndef convex @@ -158,7 +162,7 @@ extern int tty_istrapsig(void), tty_linemode(void); -extern void +EXTERN void tty_rspeed(int), tty_setecho(int), tty_setedit(int), @@ -177,7 +181,7 @@ void startslave(char *, int, char *); #ifdef ENCRYPTION extern void (*encrypt_output)(unsigned char *, int); extern int (*decrypt_input)(int); -extern char *nclearto; +EXTERN char *nclearto; #endif /* ENCRYPTION */ @@ -186,7 +190,7 @@ extern char *nclearto; * the relationship between various variables. */ -extern struct { +EXTERN struct { int system, /* what the current time is */ echotoggle, /* last time user entered echo character */ Modified: projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/global.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/global.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/global.c Sun Mar 29 23:33:12 2020 (r359430) @@ -44,5 +44,5 @@ __FBSDID("$FreeBSD$"); */ #include "defs.h" -#define extern +#define EXTERN #include "ext.h" Modified: projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/sys_term.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/sys_term.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/sys_term.c Sun Mar 29 23:33:12 2020 (r359430) @@ -376,8 +376,6 @@ spcset(int func, cc_t *valp, cc_t **valpp) * * Returns the file descriptor of the opened pty. */ -char line[32]; - int getpty(int *ptynum __unused) { Modified: projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/telnetd.c ============================================================================== --- projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/telnetd.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/contrib/telnet/telnetd/telnetd.c Sun Mar 29 23:33:12 2020 (r359430) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #ifdef AUTHENTICATION #include -int auth_level = 0; #endif #ifdef ENCRYPTION #include Modified: projects/kyua-use-googletest-test-interface/crypto/openssh/session.c ============================================================================== --- projects/kyua-use-googletest-test-interface/crypto/openssh/session.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/crypto/openssh/session.c Sun Mar 29 23:33:12 2020 (r359430) @@ -143,7 +143,7 @@ extern int startup_pipe; extern void destroy_sensitive_data(void); extern struct sshbuf *loginmsg; extern struct sshauthopt *auth_opts; -char *tun_fwd_ifnames; /* serverloop.c */ +extern char *tun_fwd_ifnames; /* serverloop.c */ /* original command from peer. */ const char *original_command = NULL; Modified: projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/fsck.h ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/fsck.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/fsck.h Sun Mar 29 23:33:12 2020 (r359430) @@ -127,7 +127,7 @@ struct inostat { * Inode state information is contained on per cylinder group lists * which are described by the following structure. */ -struct inostatlist { +extern struct inostatlist { long il_numalloced; /* number of inodes allocated in this cg */ struct inostat *il_stat;/* inostat info for this cylinder group */ } *inostathead; @@ -271,13 +271,13 @@ struct dups { struct dups *next; ufs2_daddr_t dup; }; -struct dups *duplist; /* head of dup list */ -struct dups *muldup; /* end of unique duplicate dup block numbers */ +extern struct dups *duplist; /* head of dup list */ +extern struct dups *muldup; /* end of unique duplicate dup block numbers */ /* * Inode cache data structures. */ -struct inoinfo { +extern struct inoinfo { struct inoinfo *i_nexthash; /* next entry in hash chain */ ino_t i_number; /* inode number of this entry */ ino_t i_parent; /* inode number of parent */ Modified: projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/gjournal.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/gjournal.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/gjournal.c Sun Mar 29 23:33:12 2020 (r359430) @@ -93,7 +93,6 @@ static LIST_HEAD(, cgchain) cglist = LIST_HEAD_INITIAL static const char *devnam; static struct uufsd *diskp = NULL; static struct fs *fs = NULL; -struct ufs2_dinode ufs2_zino; static void putcgs(void); Modified: projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/globs.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/globs.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/globs.c Sun Mar 29 23:33:12 2020 (r359430) @@ -117,6 +117,10 @@ volatile sig_atomic_t got_sigalarm; /* received a SIGA struct ufs1_dinode ufs1_zino; struct ufs2_dinode ufs2_zino; +struct dups *duplist; +struct dups *muldup; +struct inostatlist *inostathead; + void fsckinit(void) { Modified: projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/setup.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/setup.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/fsck_ffs/setup.c Sun Mar 29 23:33:12 2020 (r359430) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include "fsck.h" +struct inoinfo **inphead, **inpsort; + struct uufsd disk; struct bufarea asblk; #define altsblock (*asblk.b_un.b_fs) Modified: projects/kyua-use-googletest-test-interface/sbin/fsdb/fsdb.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/fsdb/fsdb.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/fsdb/fsdb.c Sun Mar 29 23:33:12 2020 (r359430) @@ -70,9 +70,6 @@ usage(void) exit(1); } -int returntosingle; -char nflag; - /* * We suck in lots of fsck code, and just pick & choose the stuff we want. * Modified: projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.c Sun Mar 29 23:33:12 2020 (r359430) @@ -82,6 +82,9 @@ token_t DigestMethods[] = { {0, 0} }; +int vflag; +char *iscsidev; + u_char isid[6 + 6]; /* | Default values Modified: projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.h ============================================================================== --- projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sbin/iscontrol/iscontrol.h Sun Mar 29 23:33:12 2020 (r359430) @@ -149,8 +149,8 @@ int recvpdu(isess_t *sess, pdu_t *pp); int lookup(token_t *tbl, char *m); -int vflag; -char *iscsidev; +extern int vflag; +extern char *iscsidev; void parseArgs(int nargs, char **args, isc_opt_t *op); void parseConfig(FILE *fd, char *key, isc_opt_t *op); Modified: projects/kyua-use-googletest-test-interface/share/man/man4/tcp.4 ============================================================================== --- projects/kyua-use-googletest-test-interface/share/man/man4/tcp.4 Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/share/man/man4/tcp.4 Sun Mar 29 23:33:12 2020 (r359430) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 2, 2019 +.Dd March 29, 2020 .Dt TCP 4 .Os .Sh NAME @@ -632,7 +632,12 @@ Turn on automatic path MTU blackhole detection. In case of retransmits OS will lower the MSS to check if it's MTU problem. If current MSS is greater than -configured value to try, it will be set to configured value, otherwise, +configured value to try +.Po Va net.inet.tcp.pmtud_blackhole_mss +and +.Va net.inet.tcp.v6pmtud_blackhole_mss +.Pc , +it will be set to this value, otherwise, MSS will be set to default values .Po Va net.inet.tcp.mssdflt and @@ -642,13 +647,6 @@ and MSS to try for IPv4 if PMTU blackhole detection is turned on. .It Va v6pmtud_blackhole_mss MSS to try for IPv6 if PMTU blackhole detection is turned on. -.It Va pmtud_blackhole_activated -Number of times configured values were used in an attempt to downshift. -.It Va pmtud_blackhole_activated_min_mss -Number of times default MSS was used in an attempt to downshift. -.It Va pmtud_blackhole_failed -Number of connections for which retransmits continued even after MSS -downshift. .It Va functions_available List of available TCP function blocks (TCP stacks). .It Va functions_default Modified: projects/kyua-use-googletest-test-interface/share/man/man7/arch.7 ============================================================================== --- projects/kyua-use-googletest-test-interface/share/man/man7/arch.7 Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/share/man/man7/arch.7 Sun Mar 29 23:33:12 2020 (r359430) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2020 +.Dd March 28, 2020 .Dt ARCH 7 .Os .Sh NAME @@ -287,36 +287,13 @@ is 8 bytes on all supported architectures except i386. uses .Xr clang 1 as the default compiler on all supported CPU architectures, -as well as ELF Tool Chain binary utilities such as +LLVM's +.Xr ld.lld 1 +as the default linker, and +ELF Tool Chain binary utilities such as .Xr objcopy 1 and .Xr readelf 1 . -Most supported CPU architectures also use LLVM's -.Xr ld.lld 1 -as the linker. -This table shows the default tool chain for each architecture. -.Bl -column -offset indent "Architecture" "Compiler" "Linker" -.It Sy Architecture Ta Sy Compiler Ta Sy Linker -.It aarch64 Ta Clang Ta lld -.It amd64 Ta Clang Ta lld -.It armv6 Ta Clang Ta lld -.It armv7 Ta Clang Ta lld -.It i386 Ta Clang Ta lld -.It mips Ta Clang Ta lld -.It mipsel Ta Clang Ta lld -.It mipselhf Ta Clang Ta lld -.It mipshf Ta Clang Ta lld -.It mipsn32 Ta Clang Ta lld -.It mips64 Ta Clang Ta lld -.It mips64el Ta Clang Ta lld -.It mips64elhf Ta Clang Ta lld -.It mips64hf Ta Clang Ta lld -.It powerpc Ta Clang Ta lld -.It powerpcspe Ta Clang Ta lld -.It powerpc64 Ta Clang Ta lld -.It riscv64 Ta Clang Ta lld -.It riscv64sf Ta Clang Ta lld -.El .Ss MACHINE_ARCH vs MACHINE_CPUARCH vs MACHINE .Dv MACHINE_CPUARCH should be preferred in Makefiles when the generic Modified: projects/kyua-use-googletest-test-interface/stand/efi/libefi/efi_console.c ============================================================================== --- projects/kyua-use-googletest-test-interface/stand/efi/libefi/efi_console.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/stand/efi/libefi/efi_console.c Sun Mar 29 23:33:12 2020 (r359430) @@ -828,8 +828,9 @@ efi_cons_update_mode(void) { UINTN cols, rows; const teken_attr_t *a; + teken_attr_t attr; EFI_STATUS status; - char env[8]; + char env[8], *ptr; status = conout->QueryMode(conout, conout->Mode->Mode, &cols, &rows); if (EFI_ERROR(status) || cols * rows == 0) { @@ -866,18 +867,35 @@ efi_cons_update_mode(void) if (buffer != NULL) { teken_set_winsize(&teken, &tp); a = teken_get_defattr(&teken); + attr = *a; - snprintf(env, sizeof(env), "%d", a->ta_fgcolor); - env_setenv("teken.fg_color", EV_VOLATILE, env, - efi_set_colors, env_nounset); - snprintf(env, sizeof(env), "%d", a->ta_bgcolor); - env_setenv("teken.bg_color", EV_VOLATILE, env, - efi_set_colors, env_nounset); + /* + * On first run, we set up the efi_set_colors() + * callback. If the env is already set, we + * pick up fg and bg color values from the environment. + */ + ptr = getenv("teken.fg_color"); + if (ptr != NULL) { + attr.ta_fgcolor = strtol(ptr, NULL, 10); + ptr = getenv("teken.bg_color"); + attr.ta_bgcolor = strtol(ptr, NULL, 10); + teken_set_defattr(&teken, &attr); + } else { + snprintf(env, sizeof(env), "%d", + attr.ta_fgcolor); + env_setenv("teken.fg_color", EV_VOLATILE, env, + efi_set_colors, env_nounset); + snprintf(env, sizeof(env), "%d", + attr.ta_bgcolor); + env_setenv("teken.bg_color", EV_VOLATILE, env, + efi_set_colors, env_nounset); + } + for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { buffer[col + row * tp.tp_col].c = ' '; - buffer[col + row * tp.tp_col].a = *a; + buffer[col + row * tp.tp_col].a = attr; } } } @@ -907,9 +925,6 @@ static int efi_cons_init(int arg) { EFI_STATUS status; - - if (conin != NULL) - return (0); conout->EnableCursor(conout, TRUE); if (efi_cons_update_mode()) Modified: projects/kyua-use-googletest-test-interface/stand/libsa/stand.h ============================================================================== --- projects/kyua-use-googletest-test-interface/stand/libsa/stand.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/stand/libsa/stand.h Sun Mar 29 23:33:12 2020 (r359430) @@ -436,7 +436,14 @@ extern void mallocstats(void); const char *x86_hypervisor(void); -#ifdef DEBUG_MALLOC +#ifdef USER_MALLOC +extern void *malloc(size_t); +extern void *memalign(size_t, size_t); +extern void *calloc(size_t, size_t); +extern void free(void *); +extern void *realloc(void *, size_t); +extern void *reallocf(void *, size_t); +#elif defined(DEBUG_MALLOC) #define malloc(x) Malloc(x, __FILE__, __LINE__) #define memalign(x, y) Memalign(x, y, __FILE__, __LINE__) #define calloc(x, y) Calloc(x, y, __FILE__, __LINE__) Modified: projects/kyua-use-googletest-test-interface/stand/libsa/zfs/zfs.c ============================================================================== --- projects/kyua-use-googletest-test-interface/stand/libsa/zfs/zfs.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/stand/libsa/zfs/zfs.c Sun Mar 29 23:33:12 2020 (r359430) @@ -92,7 +92,7 @@ static int zfs_env_count; SLIST_HEAD(zfs_be_list, zfs_be_entry) zfs_be_head = SLIST_HEAD_INITIALIZER(zfs_be_head); struct zfs_be_list *zfs_be_headp; struct zfs_be_entry { - const char *name; + char *name; SLIST_ENTRY(zfs_be_entry) entries; } *zfs_be, *zfs_be_tmp; @@ -906,6 +906,7 @@ zfs_bootenv_initial(const char *name) while (!SLIST_EMPTY(&zfs_be_head)) { zfs_be = SLIST_FIRST(&zfs_be_head); SLIST_REMOVE_HEAD(&zfs_be_head, entries); + free(zfs_be->name); free(zfs_be); } @@ -973,6 +974,7 @@ zfs_bootenv(const char *name) while (!SLIST_EMPTY(&zfs_be_head)) { zfs_be = SLIST_FIRST(&zfs_be_head); SLIST_REMOVE_HEAD(&zfs_be_head, entries); + free(zfs_be->name); free(zfs_be); } @@ -992,7 +994,11 @@ zfs_belist_add(const char *name, uint64_t value __unus if (zfs_be == NULL) { return (ENOMEM); } - zfs_be->name = name; + zfs_be->name = strdup(name); + if (zfs_be->name == NULL) { + free(zfs_be); + return (ENOMEM); + } SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); zfs_env_count++; Modified: projects/kyua-use-googletest-test-interface/stand/userboot/userboot/libuserboot.h ============================================================================== --- projects/kyua-use-googletest-test-interface/stand/userboot/userboot/libuserboot.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/stand/userboot/userboot/libuserboot.h Sun Mar 29 23:33:12 2020 (r359430) @@ -44,7 +44,7 @@ extern int userboot_disk_maxunit; extern struct devsw host_dev; /* access to host filesystem */ -struct fs_ops host_fsops; +extern struct fs_ops host_fsops; struct bootinfo; struct preloaded_file; Modified: projects/kyua-use-googletest-test-interface/sys/arm/include/atomic-v6.h ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/arm/include/atomic-v6.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/arm/include/atomic-v6.h Sun Mar 29 23:33:12 2020 (r359430) @@ -196,7 +196,7 @@ ATOMIC_ACQ_REL_LONG(clear) \ __asm __volatile( \ "1: ldrex" SUF " %[tmp], [%[ptr]] \n" \ - " ldr %[ret], [%[oldv]] \n" \ + " ldr" SUF " %[ret], [%[oldv]] \n" \ " teq %[tmp], %[ret] \n" \ " ittee ne \n" \ " str" SUF "ne %[tmp], [%[oldv]] \n" \ Modified: projects/kyua-use-googletest-test-interface/sys/dev/evdev/cdev.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/dev/evdev/cdev.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/dev/evdev/cdev.c Sun Mar 29 23:33:12 2020 (r359430) @@ -47,6 +47,18 @@ #include #include +#ifdef COMPAT_FREEBSD32 +#include +#include +#include +struct input_event32 { + struct timeval32 time; + uint16_t type; + uint16_t code; + int32_t value; +}; +#endif + #ifdef EVDEV_DEBUG #define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args) #else @@ -161,7 +173,14 @@ static int evdev_read(struct cdev *dev, struct uio *uio, int ioflag) { struct evdev_client *client; - struct input_event event; + union { + struct input_event t; +#ifdef COMPAT_FREEBSD32 + struct input_event32 t32; +#endif + } event; + struct input_event *head; + size_t evsize; int ret = 0; int remaining; @@ -175,11 +194,18 @@ evdev_read(struct cdev *dev, struct uio *uio, int iofl if (client->ec_revoked) return (ENODEV); +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + evsize = sizeof(struct input_event32); + else +#endif + evsize = sizeof(struct input_event); + /* Zero-sized reads are allowed for error checking */ - if (uio->uio_resid != 0 && uio->uio_resid < sizeof(struct input_event)) + if (uio->uio_resid != 0 && uio->uio_resid < evsize) return (EINVAL); - remaining = uio->uio_resid / sizeof(struct input_event); + remaining = uio->uio_resid / evsize; EVDEV_CLIENT_LOCKQ(client); @@ -191,19 +217,31 @@ evdev_read(struct cdev *dev, struct uio *uio, int iofl client->ec_blocked = true; ret = mtx_sleep(client, &client->ec_buffer_mtx, PCATCH, "evread", 0); + if (ret == 0 && client->ec_revoked) + ret = ENODEV; } } } while (ret == 0 && !EVDEV_CLIENT_EMPTYQ(client) && remaining > 0) { - memcpy(&event, &client->ec_buffer[client->ec_buffer_head], - sizeof(struct input_event)); + head = client->ec_buffer + client->ec_buffer_head; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + bzero(&event.t32, sizeof(struct input_event32)); + TV_CP(*head, event.t32, time); + CP(*head, event.t32, type); + CP(*head, event.t32, code); + CP(*head, event.t32, value); + } else +#endif + bcopy(head, &event.t, evsize); + client->ec_buffer_head = (client->ec_buffer_head + 1) % client->ec_buffer_size; remaining--; EVDEV_CLIENT_UNLOCKQ(client); - ret = uiomove(&event, sizeof(struct input_event), uio); + ret = uiomove(&event, evsize, uio); EVDEV_CLIENT_LOCKQ(client); } @@ -217,7 +255,13 @@ evdev_write(struct cdev *dev, struct uio *uio, int iof { struct evdev_dev *evdev = dev->si_drv1; struct evdev_client *client; - struct input_event event; + union { + struct input_event t; +#ifdef COMPAT_FREEBSD32 + struct input_event32 t32; +#endif + } event; + size_t evsize; int ret = 0; ret = devfs_get_cdevpriv((void **)&client); @@ -230,16 +274,30 @@ evdev_write(struct cdev *dev, struct uio *uio, int iof if (client->ec_revoked || evdev == NULL) return (ENODEV); - if (uio->uio_resid % sizeof(struct input_event) != 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + evsize = sizeof(struct input_event32); + else +#endif + evsize = sizeof(struct input_event); + + if (uio->uio_resid % evsize != 0) { debugf(client, "write size not multiple of input_event size"); return (EINVAL); } while (uio->uio_resid > 0 && ret == 0) { - ret = uiomove(&event, sizeof(struct input_event), uio); - if (ret == 0) - ret = evdev_inject_event(evdev, event.type, event.code, - event.value); + ret = uiomove(&event, evsize, uio); + if (ret == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + ret = evdev_inject_event(evdev, event.t32.type, + event.t32.code, event.t32.value); + else +#endif + ret = evdev_inject_event(evdev, event.t.type, + event.t.code, event.t.value); + } } return (ret); Modified: projects/kyua-use-googletest-test-interface/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/dev/sound/pci/hda/hdac.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/dev/sound/pci/hda/hdac.c Sun Mar 29 23:33:12 2020 (r359430) @@ -1413,21 +1413,11 @@ hdac_poll_reinit(struct hdac_softc *sc) pollticks >>= 1; if (pollticks > hz) pollticks = hz; - if (pollticks < 1) { - HDA_BOOTVERBOSE( - device_printf(sc->dev, - "poll interval < 1 tick !\n"); - ); + if (pollticks < 1) pollticks = 1; - } if (min > pollticks) min = pollticks; } - HDA_BOOTVERBOSE( - device_printf(sc->dev, - "poll interval %d -> %d ticks\n", - sc->poll_ival, min); - ); sc->poll_ival = min; if (min == 1000000) callout_stop(&sc->poll_callout); Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_cc_functions.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_cc_functions.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_cc_functions.c Sun Mar 29 23:33:12 2020 (r359430) @@ -1914,7 +1914,7 @@ measure_rtt(struct sctp_nets *net) if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->cc_mod.htcp_ca) > 3) { if (net->cc_mod.htcp_ca.maxRTT < net->cc_mod.htcp_ca.minRTT) net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.minRTT; - if (net->cc_mod.htcp_ca.maxRTT < srtt && srtt <= net->cc_mod.htcp_ca.maxRTT + MSEC_TO_TICKS(20)) + if (net->cc_mod.htcp_ca.maxRTT < srtt && srtt <= net->cc_mod.htcp_ca.maxRTT + sctp_msecs_to_ticks(20)) net->cc_mod.htcp_ca.maxRTT = srtt; } } @@ -1975,7 +1975,7 @@ htcp_beta_update(struct htcp *ca, uint32_t minRTT, uin } } - if (ca->modeswitch && minRTT > (uint32_t)MSEC_TO_TICKS(10) && maxRTT) { + if (ca->modeswitch && minRTT > sctp_msecs_to_ticks(10) && maxRTT) { ca->beta = (minRTT << 7) / maxRTT; if (ca->beta < BETA_MIN) ca->beta = BETA_MIN; Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_constants.h ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_constants.h Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_constants.h Sun Mar 29 23:33:12 2020 (r359430) @@ -577,16 +577,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512 -/* The conversion from time to ticks and vice versa is done by rounding - * upwards. This way we can test in the code the time to be positive and - * know that this corresponds to a positive number of ticks. - */ -#define MSEC_TO_TICKS(x) ((hz == 1000) ? x : ((((x) * hz) + 999) / 1000)) -#define TICKS_TO_MSEC(x) ((hz == 1000) ? x : ((((x) * 1000) + (hz - 1)) / hz)) - -#define SEC_TO_TICKS(x) ((x) * hz) -#define TICKS_TO_SEC(x) (((x) + (hz - 1)) / hz) - /* * Basically the minimum amount of time before I do a early FR. Making this * value to low will cause duplicate retransmissions. Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_input.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_input.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_input.c Sun Mar 29 23:33:12 2020 (r359430) @@ -2600,7 +2600,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in */ (void)SCTP_GETTIME_TIMEVAL(&now); /* Expire time is in Ticks, so we convert to seconds */ - time_expires.tv_sec = cookie->time_entered.tv_sec + TICKS_TO_SEC(cookie->cookie_life); + time_expires.tv_sec = cookie->time_entered.tv_sec + sctp_ticks_to_secs(cookie->cookie_life); time_expires.tv_usec = cookie->time_entered.tv_usec; if (timevalcmp(&now, &time_expires, >)) { /* cookie is stale! */ Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_pcb.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_pcb.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_pcb.c Sun Mar 29 23:33:12 2020 (r359430) @@ -2556,13 +2556,13 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) m = &inp->sctp_ep; /* setup the base timeout information */ - m->sctp_timeoutticks[SCTP_TIMER_SEND] = SEC_TO_TICKS(SCTP_SEND_SEC); /* needed ? */ - m->sctp_timeoutticks[SCTP_TIMER_INIT] = SEC_TO_TICKS(SCTP_INIT_SEC); /* needed ? */ - m->sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default)); - m->sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default)); - m->sctp_timeoutticks[SCTP_TIMER_PMTU] = SEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default)); - m->sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN] = SEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default)); - m->sctp_timeoutticks[SCTP_TIMER_SIGNATURE] = SEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default)); + m->sctp_timeoutticks[SCTP_TIMER_SEND] = sctp_secs_to_ticks(SCTP_SEND_SEC); /* needed ? */ + m->sctp_timeoutticks[SCTP_TIMER_INIT] = sctp_secs_to_ticks(SCTP_INIT_SEC); /* needed ? */ + m->sctp_timeoutticks[SCTP_TIMER_RECV] = sctp_msecs_to_ticks(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default)); + m->sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = sctp_msecs_to_ticks(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default)); + m->sctp_timeoutticks[SCTP_TIMER_PMTU] = sctp_secs_to_ticks(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default)); + m->sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN] = sctp_secs_to_ticks(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default)); + m->sctp_timeoutticks[SCTP_TIMER_SIGNATURE] = sctp_secs_to_ticks(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default)); /* all max/min max are in ms */ m->sctp_maxrto = SCTP_BASE_SYSCTL(sctp_rto_max_default); m->sctp_minrto = SCTP_BASE_SYSCTL(sctp_rto_min_default); @@ -2610,7 +2610,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) sctp_timer_start(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL); /* How long is a cookie good for ? */ - m->def_cookie_life = MSEC_TO_TICKS(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default)); + m->def_cookie_life = sctp_msecs_to_ticks(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default)); /* * Initialize authentication parameters */ Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_timer.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_timer.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_timer.c Sun Mar 29 23:33:12 2020 (r359430) @@ -1539,7 +1539,7 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sc tim_touse = &asoc->time_last_sent; } /* Now has long enough transpired to autoclose? */ - ticks_gone_by = SEC_TO_TICKS((uint32_t)(tn.tv_sec - tim_touse->tv_sec)); + ticks_gone_by = sctp_secs_to_ticks((uint32_t)(tn.tv_sec - tim_touse->tv_sec)); if (ticks_gone_by >= asoc->sctp_autoclose_ticks) { /* * autoclose time has hit, call the output routine, Modified: projects/kyua-use-googletest-test-interface/sys/netinet/sctp_usrreq.c ============================================================================== --- projects/kyua-use-googletest-test-interface/sys/netinet/sctp_usrreq.c Sun Mar 29 23:01:36 2020 (r359429) +++ projects/kyua-use-googletest-test-interface/sys/netinet/sctp_usrreq.c Sun Mar 29 23:33:12 2020 (r359430) @@ -1600,7 +1600,7 @@ sctp_getopt(struct socket *so, int optname, void *optv break; case SCTP_AUTOCLOSE: if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) - val = TICKS_TO_SEC(inp->sctp_ep.auto_close_time); + val = sctp_ticks_to_secs(inp->sctp_ep.auto_close_time); else val = 0; break; @@ -2012,7 +2012,7 @@ flags_out: ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && (sack->sack_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_RLOCK(inp); - sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]); + sack->sack_delay = sctp_ticks_to_msecs(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]); sack->sack_freq = inp->sctp_ep.sctp_sack_freq; SCTP_INP_RUNLOCK(inp); } else { @@ -2493,7 +2493,7 @@ flags_out: /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure; - paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***