CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: blymn Date: Tue Nov 8 06:08:33 UTC 2022 Modified Files: src/distrib/sets/lists/tests: mi Log Message: Added a new check file for libcurses test slk To generate a diff of this commit: cvs rdiff -u -r1.1227 -r1.1228 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1227 src/distrib/sets/lists/tests/mi:1.1228 --- src/distrib/sets/lists/tests/mi:1.1227 Fri Nov 4 08:01:42 2022 +++ src/distrib/sets/lists/tests/mi Tue Nov 8 06:08:33 2022 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1227 2022/11/04 08:01:42 ozaki-r Exp $ +# $NetBSD: mi,v 1.1228 2022/11/08 06:08:33 blymn Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3504,6 +3504,7 @@ ./usr/tests/lib/libcurses/check_files/slk4.chk tests-lib-tests compattestfile,atf ./usr/tests/lib/libcurses/check_files/slk5.chk tests-lib-tests compattestfile,atf ./usr/tests/lib/libcurses/check_files/slk6.chk tests-lib-tests compattestfile,atf +./usr/tests/lib/libcurses/check_files/slk7.chk tests-lib-tests compattestfile,atf ./usr/tests/lib/libcurses/check_files/slk_init.chk tests-lib-tests compattestfile,atf ./usr/tests/lib/libcurses/check_files/timeout.chk tests-lib-tests compattestfile,atf ./usr/tests/lib/libcurses/check_files/touchline1.chk tests-lib-tests compattestfile,atf
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: blymn Date: Tue Nov 8 06:08:33 UTC 2022 Modified Files: src/distrib/sets/lists/tests: mi Log Message: Added a new check file for libcurses test slk To generate a diff of this commit: cvs rdiff -u -r1.1227 -r1.1228 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libcurses
Module Name:src Committed By: blymn Date: Tue Nov 8 06:06:54 UTC 2022 Modified Files: src/tests/lib/libcurses/check_files: Makefile src/tests/lib/libcurses/tests: slk Added Files: src/tests/lib/libcurses/check_files: slk7.chk Log Message: * Uncomment the slk_wset test which was previously commented out due to incorrect output as this bug has been fixed. * Added a check file to verify the slk_wset output. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libcurses/check_files/Makefile diff -u src/tests/lib/libcurses/check_files/Makefile:1.10 src/tests/lib/libcurses/check_files/Makefile:1.11 --- src/tests/lib/libcurses/check_files/Makefile:1.10 Wed Apr 20 07:43:05 2022 +++ src/tests/lib/libcurses/check_files/Makefile Tue Nov 8 06:06:54 2022 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2022/04/20 07:43:05 blymn Exp $ +# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $ NOMAN= # defined @@ -222,6 +222,7 @@ FILES+= slk3.chk FILES+= slk4.chk FILES+= slk5.chk FILES+= slk6.chk +FILES+= slk7.chk FILES+= slk_init.chk FILES+= timeout.chk FILES+= touchline1.chk Index: src/tests/lib/libcurses/tests/slk diff -u src/tests/lib/libcurses/tests/slk:1.4 src/tests/lib/libcurses/tests/slk:1.5 --- src/tests/lib/libcurses/tests/slk:1.4 Tue Jun 22 07:29:16 2021 +++ src/tests/lib/libcurses/tests/slk Tue Nov 8 06:06:54 2022 @@ -54,7 +54,7 @@ call OK slk_refresh compare slk6.chk # test slk_wset -# [buggy??] 'b' should be printed as (wcswidth(wstr) == 6) <= 8 -#wchar WSTR [0x3401, "a", 0x3401, "b"] -#call OK slk_wset 3 $WSTR 1 -#call OK slk_refresh +wchar WSTR [0x3401, "a", 0x3401, "b"] +call OK slk_wset 3 $WSTR 1 +call OK slk_refresh +compare slk7.chk Added files: Index: src/tests/lib/libcurses/check_files/slk7.chk diff -u /dev/null src/tests/lib/libcurses/check_files/slk7.chk:1.1 --- /dev/null Tue Nov 8 06:06:54 2022 +++ src/tests/lib/libcurses/check_files/slk7.chk Tue Nov 8 06:06:54 2022 @@ -0,0 +1 @@ +cup24;19Xsetaf1Xsetab2Xsmulrev 㐁a㐁b rmulsgr0op \ No newline at end of file
CVS commit: src/tests/lib/libcurses
Module Name:src Committed By: blymn Date: Tue Nov 8 06:06:54 UTC 2022 Modified Files: src/tests/lib/libcurses/check_files: Makefile src/tests/lib/libcurses/tests: slk Added Files: src/tests/lib/libcurses/check_files: slk7.chk Log Message: * Uncomment the slk_wset test which was previously commented out due to incorrect output as this bug has been fixed. * Added a check file to verify the slk_wset output. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:43:09 UTC 2022 Modified Files: src/usr.sbin/syslogd: syslogd.8 syslogd.c Log Message: syslogd: make -d accept an optional argument Make it possible to specify the debug message categories with an optional numeric argument. You'll have to read the fine source to find out what they are. The number can be specified as the usual decimal, hex (0x), or octal (0) literal with an optional ~negation. Since syslogd uses getopt(3), not getopt_long(3), do a bit of gymnastics so that both -d42 and -d 42 are accepted (I'm not inventing long names for all the existing options just to support an optional argument to -d). -d without an argument still uses the old D_DEFAULT selection just in case someone really relies on that. You can disable all debug messages with -d0 but still get syslogd not daemonized. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/syslogd/syslogd.8 cvs rdiff -u -r1.139 -r1.140 src/usr.sbin/syslogd/syslogd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:43:09 UTC 2022 Modified Files: src/usr.sbin/syslogd: syslogd.8 syslogd.c Log Message: syslogd: make -d accept an optional argument Make it possible to specify the debug message categories with an optional numeric argument. You'll have to read the fine source to find out what they are. The number can be specified as the usual decimal, hex (0x), or octal (0) literal with an optional ~negation. Since syslogd uses getopt(3), not getopt_long(3), do a bit of gymnastics so that both -d42 and -d 42 are accepted (I'm not inventing long names for all the existing options just to support an optional argument to -d). -d without an argument still uses the old D_DEFAULT selection just in case someone really relies on that. You can disable all debug messages with -d0 but still get syslogd not daemonized. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/syslogd/syslogd.8 cvs rdiff -u -r1.139 -r1.140 src/usr.sbin/syslogd/syslogd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/syslogd/syslogd.8 diff -u src/usr.sbin/syslogd/syslogd.8:1.58 src/usr.sbin/syslogd/syslogd.8:1.59 --- src/usr.sbin/syslogd/syslogd.8:1.58 Mon Nov 5 09:22:30 2018 +++ src/usr.sbin/syslogd/syslogd.8 Tue Nov 8 01:43:09 2022 @@ -1,4 +1,4 @@ -.\" $NetBSD: syslogd.8,v 1.58 2018/11/05 09:22:30 wiz Exp $ +.\" $NetBSD: syslogd.8,v 1.59 2022/11/08 01:43:09 uwe Exp $ .\" .\" Copyright (c) 1983, 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" -.Dd November 4, 2018 +.Dd November 8, 2022 .Dt SYSLOGD 8 .Os .Sh NAME @@ -37,9 +37,10 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl dnrSsTUvX +.Op Fl nrSsTUvX .Op Fl B Ar buffer_length .Op Fl b Ar bind_address +.Op Fl d Op Oo Cm \&~ Oc Ns Ar what .Op Fl f Ar config_file .Op Fl g Ar group .Op Fl m Ar mark_interval @@ -68,9 +69,20 @@ option. Specify one specific IP address or hostname to bind to. If a hostname is specified, the IPv4 or IPv6 address which corresponds to it is used. -.It Fl d -Enable debugging to the standard output, -and do not disassociate from the controlling terminal. +.It Fl d Op Oo Cm \&~ Oc Ns Ar what +Do not disassociate from the controlling terminal and +enable debugging to the standard output. +The optional +.Ar what +argument is a number that selects which categories of the debug +messages are to be enabled. +A tilde +.Pq Sq Cm \&~ +before +.Ar what +inverts its meaning so that all messages except those selected by +.Ar what +are enabled. .It Fl f Ar config_file Specify the pathname of an alternative configuration file; the default is Index: src/usr.sbin/syslogd/syslogd.c diff -u src/usr.sbin/syslogd/syslogd.c:1.139 src/usr.sbin/syslogd/syslogd.c:1.140 --- src/usr.sbin/syslogd/syslogd.c:1.139 Fri May 20 19:34:23 2022 +++ src/usr.sbin/syslogd/syslogd.c Tue Nov 8 01:43:09 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: syslogd.c,v 1.139 2022/05/20 19:34:23 andvar Exp $ */ +/* $NetBSD: syslogd.c,v 1.140 2022/11/08 01:43:09 uwe Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -__RCSID("$NetBSD: syslogd.c,v 1.139 2022/05/20 19:34:23 andvar Exp $"); +__RCSID("$NetBSD: syslogd.c,v 1.140 2022/11/08 01:43:09 uwe Exp $"); #endif #endif /* not lint */ @@ -212,6 +212,7 @@ char include_pid_buf[11]; /* init and setup */ void usage(void) __attribute__((__noreturn__)); +void set_debug(const char *); void logpath_add(char ***, int *, int *, const char *); void logpath_fileadd(char ***, int *, int *, const char *); void init(int fd, short event, void *ev); /* SIGHUP kevent dispatch routine */ @@ -318,7 +319,7 @@ main(int argc, char *argv[]) /* should we set LC_TIME="C" to ensure correct timestamps&parsing? */ (void)setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "b:B:dnsSf:m:o:p:P:ru:g:t:TUvX")) != -1) + while ((ch = getopt(argc, argv, "b:B:d::nsSf:m:o:p:P:ru:g:t:TUvX")) != -1) switch(ch) { case 'b': bindhostname = optarg; @@ -329,9 +330,27 @@ main(int argc, char *argv[]) buflen = RCVBUFLEN; break; case 'd': /* debug */ - Debug = D_DEFAULT; - /* is there a way to read the integer value - * for Debug as an optional argument? */ + if (optarg != NULL) { +/* + * getopt passes as optarg everything + * after 'd' in -darg, manually accept + * -d=arg too. + */ +if (optarg[0] == '=') + ++optarg; + } else if (optind < argc) { +/* + * :: treats "-d ..." as missing + * optarg, so look ahead manually and + * pick up the next arg if it looks + * like one. + */ +if (argv[optind][0] != '-') { + optarg = argv[optind]; +
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:05:10 UTC 2022 Modified Files: src/usr.sbin/syslogd: tls.c Log Message: tls.c: wrap debug-only data in #ifndef NDEBUG To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/syslogd/tls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:05:10 UTC 2022 Modified Files: src/usr.sbin/syslogd: tls.c Log Message: tls.c: wrap debug-only data in #ifndef NDEBUG To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/syslogd/tls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/syslogd/tls.c diff -u src/usr.sbin/syslogd/tls.c:1.20 src/usr.sbin/syslogd/tls.c:1.21 --- src/usr.sbin/syslogd/tls.c:1.20 Sun May 15 20:37:51 2022 +++ src/usr.sbin/syslogd/tls.c Tue Nov 8 01:05:10 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tls.c,v 1.20 2022/05/15 20:37:51 andvar Exp $ */ +/* $NetBSD: tls.c,v 1.21 2022/11/08 01:05:10 uwe Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include -__RCSID("$NetBSD: tls.c,v 1.20 2022/05/15 20:37:51 andvar Exp $"); +__RCSID("$NetBSD: tls.c,v 1.21 2022/11/08 01:05:10 uwe Exp $"); #ifndef DISABLE_TLS #include @@ -57,6 +57,7 @@ __RCSID("$NetBSD: tls.c,v 1.20 2022/05/1 static unsigned getVerifySetting(const char *x509verifystring); +#ifndef NDEBUG /* to output SSL error codes */ static const char *SSL_ERRCODE[] = { "SSL_ERROR_NONE", @@ -81,6 +82,7 @@ static const char *TLS_CONN_STATES[] = { "ST_CLOSING0", "ST_CLOSING1", "ST_CLOSING2"}; +#endif /* !NDEBUG */ DH *get_dh1024(void); /* DH parameter precomputed with "openssl dhparam -C -2 1024" */
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:03:27 UTC 2022 Modified Files: src/usr.sbin/syslogd: sign.c Log Message: sign.c: mark a variable used only in asserts as __diagused To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/syslogd/sign.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/syslogd
Module Name:src Committed By: uwe Date: Tue Nov 8 01:03:27 UTC 2022 Modified Files: src/usr.sbin/syslogd: sign.c Log Message: sign.c: mark a variable used only in asserts as __diagused To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/syslogd/sign.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/syslogd/sign.c diff -u src/usr.sbin/syslogd/sign.c:1.8 src/usr.sbin/syslogd/sign.c:1.9 --- src/usr.sbin/syslogd/sign.c:1.8 Sat Nov 27 22:30:26 2021 +++ src/usr.sbin/syslogd/sign.c Tue Nov 8 01:03:27 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: sign.c,v 1.8 2021/11/27 22:30:26 rillig Exp $ */ +/* $NetBSD: sign.c,v 1.9 2022/11/08 01:03:27 uwe Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__RCSID("$NetBSD: sign.c,v 1.8 2021/11/27 22:30:26 rillig Exp $"); +__RCSID("$NetBSD: sign.c,v 1.9 2022/11/08 01:03:27 uwe Exp $"); #ifndef DISABLE_SIGN #include "syslogd.h" @@ -514,7 +514,7 @@ sign_send_certificate_block(struct signa char *tstamp; char payload[SIGN_MAX_PAYLOAD_LENGTH]; char sd[SIGN_MAX_SD_LENGTH]; - size_t payload_len, sd_len, fragment_len; + size_t payload_len, fragment_len; size_t payload_index = 0; /* do nothing if CBs already sent or if there was no message in SG */ @@ -540,6 +540,7 @@ sign_send_certificate_block(struct signa fragment_len = SIGN_MAX_FRAG_LENGTH; /* format SD */ + size_t sd_len __diagused; sd_len = snprintf(sd, sizeof(sd), "[ssign-cert " "VER=\"%s\" RSID=\"%" PRIuFAST64 "\" SG=\"%d\" " "SPRI=\"%d\" TBPL=\"%zu\" INDEX=\"%zu\" "
CVS commit: src/lib/libcurses
Module Name:src Committed By: blymn Date: Mon Nov 7 21:18:49 UTC 2022 Modified Files: src/lib/libcurses: addbytes.c Log Message: Count character widths not number of bytes when calculating number of characters to add. Fixes an error detected by slk tests where a label containing wide characters was not correctly printed. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/lib/libcurses/addbytes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/addbytes.c diff -u src/lib/libcurses/addbytes.c:1.65 src/lib/libcurses/addbytes.c:1.66 --- src/lib/libcurses/addbytes.c:1.65 Wed Oct 19 06:09:27 2022 +++ src/lib/libcurses/addbytes.c Mon Nov 7 21:18:49 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: addbytes.c,v 1.65 2022/10/19 06:09:27 blymn Exp $ */ +/* $NetBSD: addbytes.c,v 1.66 2022/11/07 21:18:49 blymn Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: addbytes.c,v 1.65 2022/10/19 06:09:27 blymn Exp $"); +__RCSID("$NetBSD: addbytes.c,v 1.66 2022/11/07 21:18:49 blymn Exp $"); #endif #endif/* not lint */ @@ -177,7 +177,7 @@ _cursesi_waddbytes(WINDOW *win, const ch cc.attributes = attr; err = _cursesi_addwchar(win, &lp, py, px, &cc, char_interp); bytes += n; - count -= n; + count -= wcwidth(wc); #endif }
CVS commit: src/lib/libcurses
Module Name:src Committed By: blymn Date: Mon Nov 7 21:18:49 UTC 2022 Modified Files: src/lib/libcurses: addbytes.c Log Message: Count character widths not number of bytes when calculating number of characters to add. Fixes an error detected by slk tests where a label containing wide characters was not correctly printed. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/lib/libcurses/addbytes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:35:57 UTC 2022 Modified Files: src/sys/sys: param.h Log Message: Welcome to 9.99.106 Increase the size of dl_data[] from 12 to 24. To generate a diff of this commit: cvs rdiff -u -r1.718 -r1.719 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.718 src/sys/sys/param.h:1.719 --- src/sys/sys/param.h:1.718 Fri Nov 4 09:06:25 2022 +++ src/sys/sys/param.h Mon Nov 7 08:35:57 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.718 2022/11/04 09:06:25 ozaki-r Exp $ */ +/* $NetBSD: param.h,v 1.719 2022/11/07 08:35:57 msaitoh Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 999010500 /* NetBSD 9.99.105 */ +#define __NetBSD_Version__ 999010600 /* NetBSD 9.99.106 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src/sys/sys
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:35:57 UTC 2022 Modified Files: src/sys/sys: param.h Log Message: Welcome to 9.99.106 Increase the size of dl_data[] from 12 to 24. To generate a diff of this commit: cvs rdiff -u -r1.718 -r1.719 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libutil
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:34:31 UTC 2022 Modified Files: src/tests/lib/libutil: t_sockaddr_snprintf.c Log Message: Sync with if_dl.h rev. 1.31's change. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libutil/t_sockaddr_snprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libutil
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:34:31 UTC 2022 Modified Files: src/tests/lib/libutil: t_sockaddr_snprintf.c Log Message: Sync with if_dl.h rev. 1.31's change. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libutil/t_sockaddr_snprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libutil/t_sockaddr_snprintf.c diff -u src/tests/lib/libutil/t_sockaddr_snprintf.c:1.3 src/tests/lib/libutil/t_sockaddr_snprintf.c:1.4 --- src/tests/lib/libutil/t_sockaddr_snprintf.c:1.3 Thu Oct 27 12:59:59 2022 +++ src/tests/lib/libutil/t_sockaddr_snprintf.c Mon Nov 7 08:34:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: t_sockaddr_snprintf.c,v 1.3 2022/10/27 12:59:59 msaitoh Exp $ */ +/* $NetBSD: t_sockaddr_snprintf.c,v 1.4 2022/11/07 08:34:30 msaitoh Exp $ */ /* * Copyright (c) 2002, 2004, 2008, 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008, 2010\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sockaddr_snprintf.c,v 1.3 2022/10/27 12:59:59 msaitoh Exp $"); +__RCSID("$NetBSD: t_sockaddr_snprintf.c,v 1.4 2022/11/07 08:34:30 msaitoh Exp $"); #include /* AF_ */ #include /* sun */ @@ -169,7 +169,7 @@ ATF_TC_BODY(sockaddr_snprintf_dl, tc) (struct sockaddr *)&sdl); ATF_REQUIRE_EQ_MSG(i, 17, "bad length for sdl"); - ATF_REQUIRE_STREQ(buf, "18 20 1.2.3.4.5.6"); + ATF_REQUIRE_STREQ(buf, "18 32 1.2.3.4.5.6"); } ATF_TP_ADD_TCS(tp)
CVS commit: src/sys/net
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:32:35 UTC 2022 Modified Files: src/sys/net: if_dl.h Log Message: Increase sdl_data so that more then IFNAMSIZ bytes are available (again). COMPAT_9 is not required. - The getifaddrs(3) function has no problem. The routing message has no problem because struct rtm_msglen has rtm_msglen and we can get the next message using with it. There is no any kernel data structure which has struct sockaddr_dl foobadr[xxx] array. - A data passed from userland and a kernel data are compared with sockaddr_cmp(). The return value is used to check if the size is inadequate or not. - In the kernel, sdl_len is not directly used for the length of memcpy() but the sockaddr_dl_measure() is used for it. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/net/if_dl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if_dl.h diff -u src/sys/net/if_dl.h:1.30 src/sys/net/if_dl.h:1.31 --- src/sys/net/if_dl.h:1.30 Thu Oct 27 00:25:11 2022 +++ src/sys/net/if_dl.h Mon Nov 7 08:32:35 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dl.h,v 1.30 2022/10/27 00:25:11 msaitoh Exp $ */ +/* $NetBSD: if_dl.h,v 1.31 2022/11/07 08:32:35 msaitoh Exp $ */ /* * Copyright (c) 1990, 1993 @@ -68,11 +68,11 @@ struct dl_addr { uint8_t dl_nlen; /* interface name length, no trailing 0 reqd. */ uint8_t dl_alen; /* link level address length */ uint8_t dl_slen; /* link layer selector length */ - /* - * minimum work area, can be larger; contains both if name - * and ll address - */ - char dl_data[12]; + char dl_data[24]; /* + * minimum work area, can be larger; contains + * both if name and ll address; big enough for + * IFNAMSIZ plus 8byte ll addr. + */ }; /*
CVS commit: src/sys/net
Module Name:src Committed By: msaitoh Date: Mon Nov 7 08:32:35 UTC 2022 Modified Files: src/sys/net: if_dl.h Log Message: Increase sdl_data so that more then IFNAMSIZ bytes are available (again). COMPAT_9 is not required. - The getifaddrs(3) function has no problem. The routing message has no problem because struct rtm_msglen has rtm_msglen and we can get the next message using with it. There is no any kernel data structure which has struct sockaddr_dl foobadr[xxx] array. - A data passed from userland and a kernel data are compared with sockaddr_cmp(). The return value is used to check if the size is inadequate or not. - In the kernel, sdl_len is not directly used for the length of memcpy() but the sockaddr_dl_measure() is used for it. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/net/if_dl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.