svn commit: r315623 - head/sys/dev/rtwn
Author: avos Date: Mon Mar 20 08:10:35 2017 New Revision: 315623 URL: https://svnweb.freebsd.org/changeset/base/315623 Log: rtwn: fix node id assignment. Do not assign new id if node is reused. Tested with RTL8821AU, HOSTAP mode + RTL8188EU, STA mode (with inactivity timeout == 90) Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c == --- head/sys/dev/rtwn/if_rtwn.c Mon Mar 20 06:12:55 2017(r315622) +++ head/sys/dev/rtwn/if_rtwn.c Mon Mar 20 08:10:35 2017(r315623) @@ -1718,13 +1718,13 @@ rtwn_node_alloc(struct ieee80211vap *vap } static void -rtwn_newassoc(struct ieee80211_node *ni, int isnew) +rtwn_newassoc(struct ieee80211_node *ni, int isnew __unused) { struct rtwn_softc *sc = ni->ni_ic->ic_softc; struct rtwn_node *un = RTWN_NODE(ni); int id; - if (!isnew) + if (un->id != RTWN_MACID_UNDEFINED) return; RTWN_NT_LOCK(sc); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315636 - in head: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib...
Author: mm Date: Mon Mar 20 13:02:27 2017 New Revision: 315636 URL: https://svnweb.freebsd.org/changeset/base/315636 Log: MFV r315633, 315635: Sync libarchive with vendor Vendor changes/bugfixes (FreeBSD-related): PR 867 (bsdcpio): show numeric uid/gid when names are not found PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers PR 880 (pax): Fix handling of "size" pax header keyword PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser Break ACL read/write code into platform-specific source files Unbreak static dependency on libbz2 MFC after:1 week Added: head/contrib/libarchive/libarchive/archive_acl_maps.h - copied, changed from r315633, vendor/libarchive/dist/libarchive/archive_acl_maps.h head/contrib/libarchive/libarchive/archive_acl_maps_freebsd.c - copied, changed from r315633, vendor/libarchive/dist/libarchive/archive_acl_maps_freebsd.c head/contrib/libarchive/libarchive/archive_platform_acl.h - copied unchanged from r315633, vendor/libarchive/dist/libarchive/archive_platform_acl.h head/contrib/libarchive/libarchive/archive_read_disk_acl_freebsd.c - copied unchanged from r315633, vendor/libarchive/dist/libarchive/archive_read_disk_acl_freebsd.c head/contrib/libarchive/libarchive/archive_version_details.c - copied unchanged from r315633, vendor/libarchive/dist/libarchive/archive_version_details.c head/contrib/libarchive/libarchive/archive_write_disk_acl_freebsd.c - copied unchanged from r315633, vendor/libarchive/dist/libarchive/archive_write_disk_acl_freebsd.c Deleted: head/contrib/libarchive/libarchive/archive_write_disk_acl.c Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive_entry.3 head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_random.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_private.h head/contrib/libarchive/libarchive/archive_read_open.3 head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_disk_private.h head/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/test/test_option_acls.c head/contrib/libarchive/test_utils/test_common.h head/contrib/libarchive/test_utils/test_main.c head/lib/libarchive/Makefile head/lib/libarchive/config_freebsd.h head/usr.bin/bsdcat/tests/Makefile head/usr.bin/cpio/tests/Makefile head/usr.bin/tar/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS == --- head/contrib/libarchive/NEWSMon Mar 20 11:55:03 2017 (r315635) +++ head/contrib/libarchive/NEWSMon Mar 20 13:02:27 2017 (r315636) @@ -1,3 +1,5 @@ +Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) + Feb 26, 2017: libarchive 3.3.1 released Security & Feature release @@ -293,7 +295,7 @@ May 04, 2008: libarchive 2.5.3b released * libarchive: Mark which entry strings are set; be accurate about distinguishing empty strings ("") from unset ones (NULL) * tar: Don't crash reading entries with empty filenames - * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults: + * libarchive_test, bsdtar_test, bsdcpio_test: Better defaults: run all tests, delete temp dirs, summarize repeated failures * -no-undefined to libtool for Cygwin * libarchive_test: Skip large file tests on systems with 32-bit off_t Modified: head/contrib/libarchive/cpio/cpio.c == --- head/contrib/libarchive/cpio/cpio.c Mon Mar 20 11:55:03 2017 (r315635) +++ head/contrib/libarchive/cpio/cpio.c Mon Mar 20 13:02:27 2017 (r315636) @@ -1344,23 +1344,23 @@ lookup_name(struct cpio *cpio, struct na cache->cache[slot].name = NULL; } - if (lookup_fn(cpio, &name, id) == 0) { - if (name == NULL || name[0] == '\0') { - /* If lookup failed, format it as a number. */ - snprintf(asnum, sizeof(asnum), "%u", (unsigned)id); - name = asnum; - } - ca
svn commit: r315639 - head/lib/libcam
Author: ngie Date: Mon Mar 20 16:30:02 2017 New Revision: 315639 URL: https://svnweb.freebsd.org/changeset/base/315639 Log: libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers This is being done to avoid potential double frees with the values. Differential Revision:D9970 MFC after:1 week Reviewed by: imp Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c == --- head/lib/libcam/camlib.cMon Mar 20 14:17:00 2017(r315638) +++ head/lib/libcam/camlib.cMon Mar 20 16:30:02 2017(r315639) @@ -308,6 +308,7 @@ cam_open_btl(path_id_t path_id, target_i snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); + ccb.cdm.matches = NULL; close(fd); return(NULL); } @@ -371,7 +372,9 @@ cam_open_btl(path_id_t path_id, target_i periph_result = &ccb.cdm.matches[0].result.periph_result; pass_unit = periph_result->unit_number; free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); sprintf(dev_path, "/dev/pass%d", pass_unit); return(cam_real_open_device(dev_path, flags, device, NULL, @@ -388,7 +391,9 @@ cam_open_btl(path_id_t path_id, target_i btl_bailout: free(ccb.cdm.matches); + ccb.cdm.matches = NULL; free(ccb.cdm.patterns); + ccb.cdm.patterns = NULL; close(fd); return(NULL); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315640 - in head: lib/libnetbsd usr.bin usr.bin/getaddrinfo
Author: vangyzen Date: Mon Mar 20 16:44:55 2017 New Revision: 315640 URL: https://svnweb.freebsd.org/changeset/base/315640 Log: Port the getaddrinfo(1) utility from NetBSD Submitted by: Lohith Bellad Reviewed by: hiren (earlier rev), ae Obtained from:NetBSD MFC after:1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision:https://reviews.freebsd.org/D9365 Added: head/lib/libnetbsd/sockaddr_snprintf.c (contents, props changed) head/usr.bin/getaddrinfo/ head/usr.bin/getaddrinfo/Makefile (contents, props changed) head/usr.bin/getaddrinfo/getaddrinfo.1 (contents, props changed) head/usr.bin/getaddrinfo/getaddrinfo.c (contents, props changed) head/usr.bin/getaddrinfo/tables.awk (contents, props changed) Modified: head/lib/libnetbsd/Makefile head/lib/libnetbsd/util.h head/usr.bin/Makefile Modified: head/lib/libnetbsd/Makefile == --- head/lib/libnetbsd/Makefile Mon Mar 20 16:30:02 2017(r315639) +++ head/lib/libnetbsd/Makefile Mon Mar 20 16:44:55 2017(r315640) @@ -7,7 +7,7 @@ LIB=netbsd CFLAGS+= -I${.CURDIR} -SRCS+= strsuftoll.c util.c util.h +SRCS+= sockaddr_snprintf.c strsuftoll.c util.c util.h INTERNALLIB= Added: head/lib/libnetbsd/sockaddr_snprintf.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetbsd/sockaddr_snprintf.c Mon Mar 20 16:44:55 2017 (r315640) @@ -0,0 +1,317 @@ +/* $NetBSD: sockaddr_snprintf.c,v 1.14 2016/12/29 18:30:55 christos Exp $ */ + +/*- + * Copyright (c) 2004, 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``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 FOUNDATION OR CONTRIBUTORS + * 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. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#ifdef HAVE_NET_IF_DL_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef BSD4_4 +# define SALEN(sa) ((sa)->sa ## _len) +#else +# define SALEN(sa) ((unsigned)sizeof(*sa)) +#endif + +static int +debug_in(char *str, size_t len, const struct sockaddr_in *sin) +{ + return snprintf(str, len, "sin_len=%u, sin_family=%u, sin_port=%u, " + "sin_addr.s_addr=%08x", + SALEN(sin), sin->sin_family, sin->sin_port, + sin->sin_addr.s_addr); +} + +static int +debug_in6(char *str, size_t len, const struct sockaddr_in6 *sin6) +{ + const uint8_t *s = sin6->sin6_addr.s6_addr; + + return snprintf(str, len, "sin6_len=%u, sin6_family=%u, sin6_port=%u, " + "sin6_flowinfo=%u, " + "sin6_addr=%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" + "%02x:%02x:%02x:%02x:%02x:%02x, sin6_scope_id=%u", + SALEN(sin6), sin6->sin6_family, sin6->sin6_port, + sin6->sin6_flowinfo, s[0x0], s[0x1], s[0x2], s[0x3], s[0x4], s[0x5], + s[0x6], s[0x7], s[0x8], s[0x9], s[0xa], s[0xb], s[0xc], s[0xd], + s[0xe], s[0xf], sin6->sin6_scope_id); +} + +static int +debug_un(char *str, size_t len, const struct sockaddr_un *sun) +{ + return snprintf(str, len, "sun_len=%u, sun_family=%u, sun_path=%*s", + SALEN(sun), sun->sun_family, (int)sizeof(sun->sun_path), + sun->sun_path); +} + +#ifdef HAVE_NET_IF_DL_H +static int +debug_dl(char *str, size_t len, const struct sockaddr_dl *sdl) +{ + const uint8_t *s = (const void *)sdl->sdl_data; + +
svn commit: r315641 - head/contrib/bsnmp/lib
Author: ngie Date: Mon Mar 20 17:17:54 2017 New Revision: 315641 URL: https://svnweb.freebsd.org/changeset/base/315641 Log: bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure MFC after:1 week Sponsored by: Dell EMC Isilon Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c == --- head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 16:44:55 2017 (r315640) +++ head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 17:17:54 2017 (r315641) @@ -947,6 +947,8 @@ open_client_udp(const char *host, const if ((res = res->ai_next) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); freeaddrinfo(res0); + (void)close(snmp_client.fd); + snmp_client.fd = -1; return (-1); } } else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315642 - head/contrib/bsnmp/lib
Author: ngie Date: Mon Mar 20 17:26:13 2017 New Revision: 315642 URL: https://svnweb.freebsd.org/changeset/base/315642 Log: bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..) open_client_* returns -1 on failure; 0 on success. Ensure that the return value is 0 -- otherwise exit snmp_open(..). MFC after:1 week Sponsored by: Dell EMC Isilon Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c == --- head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 17:17:54 2017 (r315641) +++ head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 17:26:13 2017 (r315642) @@ -1068,13 +1068,13 @@ snmp_open(const char *host, const char * switch (snmp_client.trans) { case SNMP_TRANS_UDP: - if (open_client_udp(host, port)) + if (open_client_udp(host, port) != 0) return (-1); break; case SNMP_TRANS_LOC_DGRAM: case SNMP_TRANS_LOC_STREAM: - if (open_client_local(host)) + if (open_client_local(host) != 0) return (-1); break; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315643 - head/usr.sbin/syslogd
Author: hrs Date: Mon Mar 20 17:46:33 2017 New Revision: 315643 URL: https://svnweb.freebsd.org/changeset/base/315643 Log: Fix a regression which prevented an IPv6 address in a -b option from working. PR: 217939 Differential Revision:https://reviews.freebsd.org/D10064 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Mar 20 17:26:13 2017 (r315642) +++ head/usr.sbin/syslogd/syslogd.c Mon Mar 20 17:46:33 2017 (r315643) @@ -477,7 +477,15 @@ main(int argc, char *argv[]) break; case 'b': bflag = 1; - if ((p = strchr(optarg, ':')) == NULL) { + p = strchr(optarg, ']'); + if (p != NULL) + p = strchr(p + 1, ':'); + else { + p = strchr(optarg, ':'); + if (p != NULL && strchr(p + 1, ':') != NULL) + p = NULL; /* backward compatibility */ + } + if (p == NULL) { /* A hostname or filename only. */ addpeer(&(struct peer){ .pe_name = optarg, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r315643 - head/usr.sbin/syslogd
> On Mar 20, 2017, at 10:46, Hiroki Sato wrote: > > Author: hrs > Date: Mon Mar 20 17:46:33 2017 > New Revision: 315643 > URL: https://svnweb.freebsd.org/changeset/base/315643 > > Log: > Fix a regression which prevented an IPv6 address in a -b option from > working. > > PR: 217939 > Differential Revision: https://reviews.freebsd.org/D10064 Thank you very much — I’ll see if I can write tests for this and other things to avoid future regressions. -Ngie signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r315644 - head/usr.sbin/inetd
Author: hrs Date: Mon Mar 20 17:57:24 2017 New Revision: 315644 URL: https://svnweb.freebsd.org/changeset/base/315644 Log: Simplify a pipe for signal handling. Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c == --- head/usr.sbin/inetd/inetd.c Mon Mar 20 17:46:33 2017(r315643) +++ head/usr.sbin/inetd/inetd.c Mon Mar 20 17:57:24 2017(r315644) @@ -214,7 +214,6 @@ __FBSDID("$FreeBSD$"); #endif static voidclose_sep(struct servtab *); static voidflag_signal(int); -static voidflag_config(int); static voidconfig(void); static int cpmip(const struct servtab *, int); static voidendconfig(void); @@ -224,11 +223,9 @@ static struct servtab *getconfigent(void static int matchservent(const char *, const char *, const char *); static char*nextline(FILE *); static voidaddchild(struct servtab *, int); -static voidflag_reapchild(int); static voidreapchild(void); static voidenable(struct servtab *); static voiddisable(struct servtab *); -static voidflag_retry(int); static voidretry(void); static int setconfig(void); static voidsetup(struct servtab *); @@ -532,17 +529,17 @@ main(int argc, char **argv) } #endif - sa.sa_flags = 0; + sa = (struct sigaction){ + .sa_flags = 0, + .sa_handler = flag_signal, + }; sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGALRM); sigaddset(&sa.sa_mask, SIGCHLD); sigaddset(&sa.sa_mask, SIGHUP); - sa.sa_handler = flag_retry; sigaction(SIGALRM, &sa, &saalrm); config(); - sa.sa_handler = flag_config; sigaction(SIGHUP, &sa, &sahup); - sa.sa_handler = flag_reapchild; sigaction(SIGCHLD, &sa, &sachld); sa.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sa, &sapipe); @@ -591,30 +588,34 @@ main(int argc, char **argv) } /* handle any queued signal flags */ if (FD_ISSET(signalpipe[0], &readable)) { - int nsig; + int nsig, signo; + if (ioctl(signalpipe[0], FIONREAD, &nsig) != 0) { - syslog(LOG_ERR, "ioctl: %m"); - exit(EX_OSERR); + syslog(LOG_ERR, "ioctl: %m"); + exit(EX_OSERR); } + nsig /= sizeof(signo); while (--nsig >= 0) { - char c; - if (read(signalpipe[0], &c, 1) != 1) { - syslog(LOG_ERR, "read: %m"); - exit(EX_OSERR); - } - if (debug) - warnx("handling signal flag %c", c); - switch(c) { - case 'A': /* sigalrm */ - retry(); - break; - case 'C': /* sigchld */ - reapchild(); - break; - case 'H': /* sighup */ - config(); - break; - } + size_t len; + + len = read(signalpipe[0], &signo, sizeof(signo)); + if (len != sizeof(signo)) { + syslog(LOG_ERR, "read: %m"); + exit(EX_OSERR); + } + if (debug) + warnx("handling signal flag %d", signo); + switch (signo) { + case SIGALRM: + retry(); + break; + case SIGCHLD: + reapchild(); + break; + case SIGHUP: + config(); + break; + } } } for (sep = servtab; n && sep; sep = sep->se_next) @@ -900,11 +901,12 @@ main(int argc, char **argv) */ static void -flag_signal(int c) +flag_signal(int signo) { - char ch = c; + size_t len; - if (write(signalpipe[1], &ch, 1) != 1) { + len = write(signalpipe[1], &signo, sizeof(signo)); + if (len != sizeof(signo)) { syslog(LOG_ERR, "write: %m"); _exit(EX_OSERR); } @@ -932,16 +934,6 @@ addchild(struct servtab *sep, pid_t pid) disable(sep); } -/* - * Some child process has exited. See if it's on somebody's list. - */ - -static void -flag_reapchild(int signo __unused) -{ - flag_signal('C'); -} - static void reapchild(void) { @@ -981,12 +973,6 @@ reapchild(void) } static void -flag_config(int signo __unused) -{ - flag_signal('H'); -} - -static void config(void) { struct servtab *sep, *new, **sepp;
svn commit: r315645 - head/sys/boot/userboot/userboot
Author: tsoome Date: Mon Mar 20 18:03:40 2017 New Revision: 315645 URL: https://svnweb.freebsd.org/changeset/base/315645 Log: loader: disk_cleanup was left in userboot_disk.c In r315408, disk_cleanup was removed, which is called at sys/boot/userboot/userboot/userboot_disk.c:113. This causes bhyveload to fail. PR: 217935 Reported by: Fabian Freyer Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision:https://reviews.freebsd.org/D10060 Modified: head/sys/boot/userboot/userboot/userboot_disk.c Modified: head/sys/boot/userboot/userboot/userboot_disk.c == --- head/sys/boot/userboot/userboot/userboot_disk.c Mon Mar 20 17:57:24 2017(r315644) +++ head/sys/boot/userboot/userboot/userboot_disk.c Mon Mar 20 18:03:40 2017(r315645) @@ -110,7 +110,6 @@ userdisk_cleanup(void) if (userdisk_maxunit > 0) free(ud_info); - disk_cleanup(&userboot_disk); } /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315646 - head/sys/boot/i386/libi386
Author: tsoome Date: Mon Mar 20 18:15:36 2017 New Revision: 315646 URL: https://svnweb.freebsd.org/changeset/base/315646 Log: loader: pxe.h constants have wrong values FLTR_PRMSCS should be 0x4 and FLTR_SRC_RTG should be 0x8 PXE Specification 2.1 PXENV_UNDI_OPEN, page 59. http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision:https://reviews.freebsd.org/D10056 Modified: head/sys/boot/i386/libi386/pxe.h Modified: head/sys/boot/i386/libi386/pxe.h == --- head/sys/boot/i386/libi386/pxe.hMon Mar 20 18:03:40 2017 (r315645) +++ head/sys/boot/i386/libi386/pxe.hMon Mar 20 18:15:36 2017 (r315646) @@ -175,8 +175,8 @@ typedef struct { uint16_tPktFilter; # define FLTR_DIRECTED0x0001 # define FLTR_BRDCST 0x0002 -# define FLTR_PRMSCS 0x0003 -# define FLTR_SRC_RTG 0x0004 +# define FLTR_PRMSCS 0x0004 +# define FLTR_SRC_RTG 0x0008 t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; } PACKED t_PXENV_UNDI_OPEN; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315647 - head/lib/libkvm
Author: ngie Date: Mon Mar 20 18:28:22 2017 New Revision: 315647 URL: https://svnweb.freebsd.org/changeset/base/315647 Log: Handle kd == NULL gracefully with kvm_close(3) Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return -1 and set errno to EINVAL. Document this new behavior explicitly. MFC after:1 week Reviewed by: vangyzen Sponsored by: Dell EMC Isilon Differential Revision:D10065 Modified: head/lib/libkvm/kvm.c head/lib/libkvm/kvm_open.3 Modified: head/lib/libkvm/kvm.c == --- head/lib/libkvm/kvm.c Mon Mar 20 18:15:36 2017(r315646) +++ head/lib/libkvm/kvm.c Mon Mar 20 18:28:22 2017(r315647) @@ -272,6 +272,10 @@ kvm_close(kvm_t *kd) { int error = 0; + if (kd == NULL) { + errno = EINVAL; + return (-1); + } if (kd->vmst != NULL) kd->arch->ka_freevtop(kd); if (kd->pmfd >= 0) Modified: head/lib/libkvm/kvm_open.3 == --- head/lib/libkvm/kvm_open.3 Mon Mar 20 18:15:36 2017(r315646) +++ head/lib/libkvm/kvm_open.3 Mon Mar 20 18:28:22 2017(r315647) @@ -32,7 +32,7 @@ .\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd March 19, 2017 +.Dd March 20, 2017 .Dt KVM_OPEN 3 .Os .Sh NAME @@ -227,10 +227,29 @@ and write the error message into .Fa errbuf . .Pp +.Rv -std kvm_close +.Sh ERRORS The .Fn kvm_close -function returns 0 on success and -1 on failure. +function may fail and set the global variable +.Va errno +for any of the errors specified for +.Xr close 2 . +.Pp +The +.Fn kvm_close +function may also fail and set +.Va errno +if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value passed via +.Fa kd +was +.Dv NULL . +.El .Sh SEE ALSO +.Xr close 2 , .Xr open 2 , .Xr kvm 3 , .Xr kvm_getargv 3 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315648 - head/lib/libstand
Author: tsoome Date: Mon Mar 20 19:16:28 2017 New Revision: 315648 URL: https://svnweb.freebsd.org/changeset/base/315648 Log: libstand: verify value provided by nfs.read_size Implement simple value check and feedback. Reviewed by: allanjude, rpokala Approved by: allanjude (mentor) Differential Revision:https://reviews.freebsd.org/D8491 Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c == --- head/lib/libstand/nfs.c Mon Mar 20 18:28:22 2017(r315647) +++ head/lib/libstand/nfs.c Mon Mar 20 19:16:28 2017(r315648) @@ -214,6 +214,38 @@ struct fs_ops nfs_fsops = { static int nfs_read_size = NFSREAD_MIN_SIZE; +/* + * Improve boot performance over NFS + */ +static void +set_nfs_read_size(void) +{ + char *env, *end; + char buf[10]; + + if ((env = getenv("nfs.read_size")) != NULL) { + errno = 0; + nfs_read_size = (int)strtol(env, &end, 0); + if (errno != 0 || *env == '\0' || *end != '\0') { + printf("%s: bad value: \"%s\", defaulting to %d\n", + "nfs.read_size", env, NFSREAD_MIN_SIZE); + nfs_read_size = NFSREAD_MIN_SIZE; + } + } + if (nfs_read_size < NFSREAD_MIN_SIZE) { + printf("%s: bad value: \"%d\", defaulting to %d\n", + "nfs.read_size", nfs_read_size, NFSREAD_MIN_SIZE); + nfs_read_size = NFSREAD_MIN_SIZE; + } + if (nfs_read_size > NFSREAD_MAX_SIZE) { + printf("%s: bad value: \"%d\", defaulting to %d\n", + "nfs.read_size", nfs_read_size, NFSREAD_MIN_SIZE); + nfs_read_size = NFSREAD_MAX_SIZE; + } + snprintf(buf, sizeof (buf), "%d", nfs_read_size); + setenv("nfs.read_size", buf, 1); +} + #ifdef OLD_NFSV2 /* * Fetch the root file handle (call mount daemon) @@ -269,16 +301,7 @@ nfs_getrootfh(struct iodesc *d, char *pa return (ntohl(repl->errno)); bcopy(repl->fh, fhp, sizeof(repl->fh)); - /* -* Improve boot performance over NFS -*/ - if (getenv("nfs.read_size") != NULL) - nfs_read_size = strtol(getenv("nfs.read_size"), NULL, 0); - if (nfs_read_size < NFSREAD_MIN_SIZE) - nfs_read_size = NFSREAD_MIN_SIZE; - if (nfs_read_size > NFSREAD_MAX_SIZE) - nfs_read_size = NFSREAD_MAX_SIZE; - + set_nfs_read_size(); return (0); } @@ -885,6 +908,8 @@ nfs_getrootfh(struct iodesc *d, char *pa return (ntohl(repl->errno)); *fhlenp = ntohl(repl->fhsize); bcopy(repl->fh, fhp, *fhlenp); + + set_nfs_read_size(); return (0); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315649 - head/usr.bin/diff
Author: bapt Date: Mon Mar 20 19:24:16 2017 New Revision: 315649 URL: https://svnweb.freebsd.org/changeset/base/315649 Log: Cache tzdata when running under capsicum PR: 217957 Reported by: tobik@ Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c == --- head/usr.bin/diff/diffreg.c Mon Mar 20 19:16:28 2017(r315648) +++ head/usr.bin/diff/diffreg.c Mon Mar 20 19:24:16 2017(r315649) @@ -440,6 +440,7 @@ diffreg(char *file1, char *file2, int fl err(2, "unable to limit stdio"); caph_cache_catpages(); + caph_cache_tzdata(); if (cap_enter() < 0 && errno != ENOSYS) err(2, "unable to enter capability mode"); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315651 - in head/sys/dev/bhnd/cores: chipc pmu
Author: landonf Date: Mon Mar 20 19:27:35 2017 New Revision: 315651 URL: https://svnweb.freebsd.org/changeset/base/315651 Log: Integrate BCM4706 PMU (rev6) support, derived from the ISC-licensed Broadcom sbchipc.h and hndpmu.c sources included in the RT-N16 and later firmware source drops. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h == --- head/sys/dev/bhnd/cores/chipc/chipcreg.hMon Mar 20 19:25:42 2017 (r315650) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.hMon Mar 20 19:27:35 2017 (r315651) @@ -1,11 +1,11 @@ /*- * Copyright (c) 2015-2016 Landon Fuller - * Copyright (c) 2010 Broadcom Corporation + * Copyright (c) 2010-2015 Broadcom Corporation * All rights reserved. * - * This file is derived from the sbchipc.h header distributed with - * Broadcom's initial brcm80211 Linux driver release, as - * contributed to the Linux staging repository. + * This file is derived from the sbchipc.h header contributed by Broadcom + * to to the Linux staging repository, as well as later revisions of sbchipc.h + * distributed with the Asus RT-N16 firmware source code release. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -928,6 +928,29 @@ enum { #defineCHIPC_CST43228_SDIO_OTP_PRESENT 0x10 #defineCHIPC_CST43228_SDIO_RESET 0x20 +/* 4706 chipstatus reg bits */ +#defineCHIPC_CST4706_LOWCOST_PKG (1<<0) /* 0: full-featured package 1: low-cost package */ +#defineCHIPC_CST4706_SFLASH_PRESENT(1<<1) /* 0: parallel, 1: serial flash is present */ +#defineCHIPC_CST4706_SFLASH_TYPE (1<<2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ +#defineCHIPC_CST4706_MIPS_BENDIAN (1<<3) /* 0: little, 1: big endian */ +#defineCHIPC_CST4706_PCIE1_DISABLE (1<<5) /* PCIE1 enable strap pin */ + +/* 4706 flashstrconfig reg bits */ +#defineCHIPC_FLSTRCF4706_MASK 0x00ff +#defineCHIPC_FLSTRCF4706_SF1 0x0001 /* 2nd serial flash present */ +#defineCHIPC_FLSTRCF4706_PF1 0x0002 /* 2nd parallel flash present */ +#defineCHIPC_FLSTRCF4706_SF1_TYPE 0x0004 /* 2nd serial flash type : 0 : ST, 1 : Atmel */ +#defineCHIPC_FLSTRCF4706_NF1 0x0008 /* 2nd NAND flash present */ +#defineCHIPC_FLSTRCF4706_1ST_MADDR_SEG_MASK0x00f0 /* Valid value mask */ +#defineCHIPC_FLSTRCF4706_1ST_MADDR_SEG_SHIFT 4 +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_4MB 0x1 /* 4MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_8MB 0x2 /* 8MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_16MB 0x3 /* 16MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_32MB 0x4 /* 32MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_64MB 0x5 /* 64MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_128MB 0x6 /* 128MB */ +#define CHIPC_FLSTRCF4706_1ST_MADDR_SEG_256MB 0x7 /* 256MB */ + /* * Register eci_inputlo bitfield values. * - BT packet type information bits [7:0] Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c == --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Mon Mar 20 19:25:42 2017 (r315650) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Mon Mar 20 19:27:35 2017 (r315651) @@ -69,6 +69,9 @@ static uint32_t bhnd_pmu1_alpclk0(struct static uint32_tbhnd_pmu5_clock(struct bhnd_pmu_query *sc, u_int pll0, u_int m); +static uint32_tbhnd_pmu6_4706_clock(struct bhnd_pmu_query *sc, u_int pll0, + u_int m); + /* PMU resources */ static boolbhnd_pmu_res_depfltr_bb(struct bhnd_pmu_softc *sc); static boolbhnd_pmu_res_depfltr_ncb(struct bhnd_pmu_softc *sc); @@ -2329,6 +2332,47 @@ bhnd_pmu5_clock(struct bhnd_pmu_query *s return ((fc / div) * 100); } +static uint32_t +bhnd_pmu6_4706_clock(struct bhnd_pmu_query *sc, u_int pll0, u_int m) +{ + uint32_t chipst, clock; + uint32_t ndiv, p1div, p2div, tmp; + + /* Get N, P1 and P2 dividers to determine CPU clock */ + BHND_PMU_WRITE_4(sc, BHND_PMU_PLL_CONTROL_ADDR, + pll0 + BHND_PMU6_4706_PROCPLL_OFF); + BHND_PMU_READ_4(sc, BHND_PMU_PLL_CONTROL_ADDR); + + tmp = BHND_PMU_READ_4(sc, BHND_PMU_PLL_CONTROL_DATA); + ndiv = BHND_PMU_GET_BITS(tmp, BHND_PMU6_4706_PROC_N
svn commit: r315650 - head/sys/arm/freescale/imx
Author: andrew Date: Mon Mar 20 19:25:42 2017 New Revision: 315650 URL: https://svnweb.freebsd.org/changeset/base/315650 Log: Use tc_priv to find the softc in the i.MX timer driver. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c == --- head/sys/arm/freescale/imx/imx_gpt.cMon Mar 20 19:24:16 2017 (r315649) +++ head/sys/arm/freescale/imx/imx_gpt.cMon Mar 20 19:25:42 2017 (r315650) @@ -271,6 +271,7 @@ imx_gpt_attach(device_t dev) /* Register as a timecounter. */ imx_gpt_timecounter.tc_frequency = sc->clkfreq; + imx_gpt_timecounter.tc_priv = sc; tc_init(&imx_gpt_timecounter); /* If this is the first unit, store the softc for use in DELAY. */ @@ -368,14 +369,13 @@ imx_gpt_intr(void *arg) return (FILTER_HANDLED); } -u_int +static u_int imx_gpt_get_timecount(struct timecounter *tc) { + struct imx_gpt_softc *sc; - if (imx_gpt_sc == NULL) - return (0); - - return (READ4(imx_gpt_sc, IMX_GPT_CNT)); + sc = tc->tc_priv; + return (READ4(sc, IMX_GPT_CNT)); } static device_method_t imx_gpt_methods[] = { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315652 - head/sys/dev/isp
Author: mav Date: Mon Mar 20 20:44:14 2017 New Revision: 315652 URL: https://svnweb.freebsd.org/changeset/base/315652 Log: Remove some more dead code. MFC after:2 weeks Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp_freebsd.c == --- head/sys/dev/isp/isp_freebsd.c Mon Mar 20 19:27:35 2017 (r315651) +++ head/sys/dev/isp/isp_freebsd.c Mon Mar 20 20:44:14 2017 (r315652) @@ -294,7 +294,6 @@ isp_attach(ispsoftc_t *isp) callout_init_mtx(&isp->isp_osinfo.tmo, &isp->isp_osinfo.lock, 0); isp_timer_count = hz >> 2; callout_reset(&isp->isp_osinfo.tmo, isp_timer_count, isp_timer, isp); - isp->isp_osinfo.timer_active = 1; isp->isp_osinfo.cdev = make_dev(&isp_cdevsw, du, UID_ROOT, GID_OPERATOR, 0600, "%s", nu); if (isp->isp_osinfo.cdev) { @@ -315,10 +314,6 @@ unwind: ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } - if (isp->isp_osinfo.cdev) { - destroy_dev(isp->isp_osinfo.cdev); - isp->isp_osinfo.cdev = NULL; - } cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; return (-1); @@ -327,35 +322,20 @@ unwind: int isp_detach(ispsoftc_t *isp) { - struct cam_sim *sim; int chan; - ISP_LOCK(isp); - for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { - ISP_GET_PC(isp, chan, sim, sim); - if (sim->refcount > 2) { - ISP_UNLOCK(isp); - return (EBUSY); - } + if (isp->isp_osinfo.cdev) { + destroy_dev(isp->isp_osinfo.cdev); + isp->isp_osinfo.cdev = NULL; } + ISP_LOCK(isp); /* Tell spawned threads that we're exiting. */ isp->isp_osinfo.is_exiting = 1; - if (isp->isp_osinfo.timer_active) { - callout_stop(&isp->isp_osinfo.tmo); - isp->isp_osinfo.timer_active = 0; - } for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) isp_detach_chan(isp, chan); ISP_UNLOCK(isp); - - if (isp->isp_osinfo.cdev) { - destroy_dev(isp->isp_osinfo.cdev); - isp->isp_osinfo.cdev = NULL; - } - if (isp->isp_osinfo.devq != NULL) { - cam_simq_free(isp->isp_osinfo.devq); - isp->isp_osinfo.devq = NULL; - } + callout_drain(&isp->isp_osinfo.tmo); + cam_simq_free(isp->isp_osinfo.devq); return (0); } Modified: head/sys/dev/isp/isp_freebsd.h == --- head/sys/dev/isp/isp_freebsd.h Mon Mar 20 19:27:35 2017 (r315651) +++ head/sys/dev/isp/isp_freebsd.h Mon Mar 20 20:44:14 2017 (r315652) @@ -297,16 +297,7 @@ struct isposinfo { struct isp_pcmd * pcmd_pool; struct isp_pcmd * pcmd_free; - uint32_t -#ifdef ISP_TARGET_MODE - tmwanted: 1, - tmbusy : 1, -#else - : 2, -#endif - sixtyfourbit: 1,/* sixtyfour bit platform */ - timer_active: 1, - autoconf: 1; + int sixtyfourbit; /* sixtyfour bit platform */ int mbox_sleeping; int mbox_sleep_ok; int mboxbsy; Modified: head/sys/dev/isp/ispvar.h == --- head/sys/dev/isp/ispvar.h Mon Mar 20 19:27:35 2017(r315651) +++ head/sys/dev/isp/ispvar.h Mon Mar 20 20:44:14 2017(r315652) @@ -532,9 +532,8 @@ struct ispsoftc { uint32_tisp_maxluns;/* maximum luns supported */ uint32_tisp_clock : 8,/* input clock */ - : 4, + : 5, isp_port: 1,/* 23XX/24XX only */ - isp_open: 1,/* opened (ioctl) */ isp_bustype : 1,/* SBus or PCI */ isp_loaded_fw : 1,/* loaded firmware */ isp_dblev : 16; /* debug log mask */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315653 - in head: lib/libstand sys/boot/common sys/boot/i386/libi386
Author: tsoome Date: Mon Mar 20 22:20:17 2017 New Revision: 315653 URL: https://svnweb.freebsd.org/changeset/base/315653 Log: loader: verify the value from dhcp.interface-mtu and use snprintf to set mtu Since the uset can set dhcp.interface-mtu, we need to try to validate the value. So we verify if the conversion to int is successful and we will not allow to set value greater than max IPv4 packet size. Also use snprintf for safety. Reviewed by: allanjude, bapt Approved by: allanjude (mentor) Differential Revision:https://reviews.freebsd.org/D8492 Modified: head/lib/libstand/bootp.c head/sys/boot/common/dev_net.c head/sys/boot/i386/libi386/pxe.c Modified: head/lib/libstand/bootp.c == --- head/lib/libstand/bootp.c Mon Mar 20 20:44:14 2017(r315652) +++ head/lib/libstand/bootp.c Mon Mar 20 22:20:17 2017(r315653) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -403,11 +404,29 @@ vend_rfc1048(cp, len) strlcpy(hostname, val, sizeof(hostname)); } if (tag == TAG_INTF_MTU) { + intf_mtu = 0; if ((val = getenv("dhcp.interface-mtu")) != NULL) { - intf_mtu = (u_int)strtoul(val, NULL, 0); - } else { - intf_mtu = be16dec(cp); + unsigned long tmp; + char *end; + + errno = 0; + /* +* Do not allow MTU to exceed max IPv4 packet +* size, max value of 16-bit word. +*/ + tmp = strtoul(val, &end, 0); + if (errno != 0 || + *val == '\0' || *end != '\0' || + tmp > USHRT_MAX) { + printf("%s: bad value: \"%s\", " + "ignoring\n", + "dhcp.interface-mtu", val); + } else { + intf_mtu = (u_int)tmp; + } } + if (intf_mtu <= 0) + intf_mtu = be16dec(cp); } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { Modified: head/sys/boot/common/dev_net.c == --- head/sys/boot/common/dev_net.c Mon Mar 20 20:44:14 2017 (r315652) +++ head/sys/boot/common/dev_net.c Mon Mar 20 22:20:17 2017 (r315653) @@ -175,7 +175,7 @@ net_open(struct open_file *f, ...) } if (intf_mtu != 0) { char mtu[16]; - sprintf(mtu, "%u", intf_mtu); + snprintf(mtu, sizeof(mtu), "%u", intf_mtu); setenv("boot.netif.mtu", mtu, 1); } Modified: head/sys/boot/i386/libi386/pxe.c == --- head/sys/boot/i386/libi386/pxe.cMon Mar 20 20:44:14 2017 (r315652) +++ head/sys/boot/i386/libi386/pxe.cMon Mar 20 22:20:17 2017 (r315653) @@ -342,7 +342,7 @@ pxe_open(struct open_file *f, ...) } if (intf_mtu != 0) { char mtu[16]; - sprintf(mtu, "%u", intf_mtu); + snprintf(sizeof(mtu), mtu, "%u", intf_mtu); setenv("boot.netif.mtu", mtu, 1); } printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315654 - head/rescue/rescue
Author: ngie Date: Mon Mar 20 22:33:22 2017 New Revision: 315654 URL: https://svnweb.freebsd.org/changeset/base/315654 Log: Fix linking /rescue/rescue to multiple programs in usr.bin after r315113 I meant for the line that conditionally added in /usr/bin/nc support to be `+=', not `=`. This restores hardlinks for all programs in usr.bin specified before nc(1), e.g., bunzip2 and tar. Reported by: Andrzej Tobola Submitted by: Scott Allendorf Pointyhat to: ngie MFC after:3 days Sponsored by: Dell EMC Isilon Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile == --- head/rescue/rescue/Makefile Mon Mar 20 22:20:17 2017(r315653) +++ head/rescue/rescue/Makefile Mon Mar 20 22:33:22 2017(r315654) @@ -210,7 +210,7 @@ CRUNCH_LIBS+= -lcrypto CRUNCH_LIBS+= -lmd .if ${MK_NETCAT} != "no" -CRUNCH_PROGS_usr.bin= nc +CRUNCH_PROGS_usr.bin+= nc .endif .if ${MK_VI} != "no" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315655 - head/usr.sbin/lpr/chkprintcap
Author: gad Date: Mon Mar 20 22:36:28 2017 New Revision: 315655 URL: https://svnweb.freebsd.org/changeset/base/315655 Log: Fixes to chkprintcap: - Check the return from a call to malloc() in skim_printcap(), and return a NULL if that fails. - Fix a small memory leak in main() that happens if skim_printcap() returns an error, including the new error-return of NULL. Submitted by: Tom Rix Reviewed by: pfg, ngie MFC after:4 weeks Sponsored by: Dell EMC Isilon, Juniper Differential Revision:D9954, D9982 Modified: head/usr.sbin/lpr/chkprintcap/chkprintcap.c head/usr.sbin/lpr/chkprintcap/skimprintcap.c Modified: head/usr.sbin/lpr/chkprintcap/chkprintcap.c == --- head/usr.sbin/lpr/chkprintcap/chkprintcap.c Mon Mar 20 22:33:22 2017 (r315654) +++ head/usr.sbin/lpr/chkprintcap/chkprintcap.c Mon Mar 20 22:36:28 2017 (r315655) @@ -113,8 +113,13 @@ main(int argc, char **argv) * the printcap file. */ skres = skim_printcap(pcap_fname, verbosity); - if (skres->fatalerr) - return (skres->fatalerr); + if (skres == NULL) { + problems = 1; + goto main_ret; + } else if (skres->fatalerr) { + problems = skres->fatalerr; + goto main_ret; + } /* * Now use the standard capability-db routines to check the values @@ -156,6 +161,9 @@ next: warnx("WARNING: but only found %d queues to process!", queuecnt); } + +main_ret: + free(pcap_fname); return (problems); } Modified: head/usr.sbin/lpr/chkprintcap/skimprintcap.c == --- head/usr.sbin/lpr/chkprintcap/skimprintcap.cMon Mar 20 22:33:22 2017(r315654) +++ head/usr.sbin/lpr/chkprintcap/skimprintcap.cMon Mar 20 22:36:28 2017(r315655) @@ -82,6 +82,8 @@ skim_printcap(const char *pcap_fname, in enum {CMNT_LINE, ENTRY_LINE, TAB_LINE, TABERR_LINE} is_type, had_type; skinf = malloc(sizeof(struct skiminfo)); + if (skinf == NULL) + return (NULL); memset(skinf, 0, sizeof(struct skiminfo)); pc_file = fopen(pcap_fname, "r"); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315656 - head/tests/sys/netinet
Author: asomers Date: Mon Mar 20 23:07:34 2017 New Revision: 315656 URL: https://svnweb.freebsd.org/changeset/base/315656 Log: Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6 This test was failing if run twice because rtadvd takes too long to die. The rtadvd process from the first run was still running when the second run created its interfaces. The solution is to use SIGKILL during the cleanup instead of SIGTERM so rtadvd will die faster. While I'm here, randomize the addresses used for the test, which makes bugs like this easier to spot, and fix the cleanup order to be the opposite of the setup order PR: 217871 MFC after:18 days X-MFC-With: 315458 Sponsored by: Spectra Logic Corp Modified: head/tests/sys/netinet/fibs_test.sh Modified: head/tests/sys/netinet/fibs_test.sh == --- head/tests/sys/netinet/fibs_test.sh Mon Mar 20 22:36:28 2017 (r315655) +++ head/tests/sys/netinet/fibs_test.sh Mon Mar 20 23:07:34 2017 (r315656) @@ -451,12 +451,12 @@ slaac_on_nondefault_fib6_head() } slaac_on_nondefault_fib6_body() { - atf_skip "BUG217871 SLAAC on a newly created epair sometimes fails to add routes" # Configure the epair interfaces to use nonrouteable RFC3849 # addresses and non-default FIBs - ADDR="2001:db8::2" - GATEWAY="2001:db8::1" - SUBNET="2001:db8:" + PREFIX="2001:db8:$(printf "%x" `jot -r 1 0 65535`):$(printf "%x" `jot -r 1 0 65535`)" + ADDR="$PREFIX::2" + GATEWAY="$PREFIX::1" + SUBNET="$PREFIX:" MASK="64" # Check system configuration @@ -509,19 +509,23 @@ slaac_on_nondefault_fib6_body() } slaac_on_nondefault_fib6_cleanup() { - cleanup_ifaces if [ -f "rtadvd.pid" ]; then - pkill -F rtadvd.pid + # rtadvd can take a long time to shutdown. Use SIGKILL to kill + # it right away. The downside to using SIGKILL is that it + # won't send final RAs to all interfaces, but we don't care + # because we're about to destroy its interface anyway. + pkill -kill -F rtadvd.pid rm -f rtadvd.pid fi - if [ -f "rfc6204w3.state" ] ; then - sysctl "net.inet6.ip6.rfc6204w3"=`cat "rfc6204w3.state"` - rm "rfc6204w3.state" - fi + cleanup_ifaces if [ -f "forwarding.state" ] ; then sysctl "net.inet6.ip6.forwarding"=`cat "forwarding.state"` rm "forwarding.state" fi + if [ -f "rfc6204w3.state" ] ; then + sysctl "net.inet6.ip6.rfc6204w3"=`cat "rfc6204w3.state"` + rm "rfc6204w3.state" + fi } # Regression test for kern/187550 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r315656 - head/tests/sys/netinet
On Mon, Mar 20, 2017 at 4:07 PM, Alan Somers wrote: > Author: asomers > Date: Mon Mar 20 23:07:34 2017 > New Revision: 315656 > URL: https://svnweb.freebsd.org/changeset/base/315656 > > Log: > Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6 > > This test was failing if run twice because rtadvd takes too long to die. > The rtadvd process from the first run was still running when the > second run created its interfaces. The solution is to use SIGKILL during > the cleanup instead of SIGTERM so rtadvd will die faster. > > While I'm here, randomize the addresses used for the test, which makes bugs > like this easier to spot, and fix the cleanup order to be the opposite of > the setup order > > PR: 217871 > MFC after:18 days > X-MFC-With: 315458 > Sponsored by: Spectra Logic Corp Hi Alan, I wonder if another seatbelt needs to be added for this scenario because running a separate copy of rtadvd could adversely affect the running system behavior... Thanks, -Ngie ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r315656 - head/tests/sys/netinet
On Mon, Mar 20, 2017 at 6:55 PM, Ngie Cooper wrote: > On Mon, Mar 20, 2017 at 4:07 PM, Alan Somers wrote: >> Author: asomers >> Date: Mon Mar 20 23:07:34 2017 >> New Revision: 315656 >> URL: https://svnweb.freebsd.org/changeset/base/315656 >> >> Log: >> Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6 >> >> This test was failing if run twice because rtadvd takes too long to die. >> The rtadvd process from the first run was still running when the >> second run created its interfaces. The solution is to use SIGKILL during >> the cleanup instead of SIGTERM so rtadvd will die faster. >> >> While I'm here, randomize the addresses used for the test, which makes bugs >> like this easier to spot, and fix the cleanup order to be the opposite of >> the setup order >> >> PR: 217871 >> MFC after:18 days >> X-MFC-With: 315458 >> Sponsored by: Spectra Logic Corp > > Hi Alan, > I wonder if another seatbelt needs to be added for this scenario > because running a separate copy of rtadvd could adversely affect the > running system behavior... > Thanks, > -Ngie I thought about that, but I decided against it, because rtadvd(8) requires you to specify which interfaces it should operate on, either on the command line or with rtadvctl(8). This test always creates a new interface and only runs rtadvd on the new interface. Also, rtadvd(8) allows you to override the default pidfile, configfile, and socket file, which this test does. So I don't think that the test rtadvd and the system rtadvd can ever affect each other. -Alan ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r315662 - in head: contrib/bsnmp/snmp_mibII contrib/ipfilter/ipsend lib/libprocstat sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat usr.bin/systat usr.sbin/tcpdrop usr.sbin/trpt
Author: glebius Date: Tue Mar 21 06:39:49 2017 New Revision: 315662 URL: https://svnweb.freebsd.org/changeset/base/315662 Log: Hide struct inpcb, struct tcpcb from the userland. This is a painful change, but it is needed. On the one hand, we avoid modifying them, and this slows down some ideas, on the other hand we still eventually modify them and tools like netstat(1) never work on next version of FreeBSD. We maintain a ton of spares in them, and we already got some ifdef hell at the end of tcpcb. Details: - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. - Make struct xinpcb, struct xtcpcb pure API structures, not including kernel structures inpcb and tcpcb inside. Export into these structures the fields from inpcb and tcpcb that are known to be used, and put there a ton of spare space. - Make kernel and userland utilities compilable after these changes. - Bump __FreeBSD_version. Reviewed by: rrs, gnn Differential Revision:D10018 Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c head/contrib/bsnmp/snmp_mibII/mibII_udp.c head/contrib/ipfilter/ipsend/sock.c head/lib/libprocstat/libprocstat.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/sys/param.h head/usr.bin/netstat/inet.c head/usr.bin/sockstat/sockstat.c head/usr.bin/systat/extern.h head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.sbin/tcpdrop/tcpdrop.c head/usr.sbin/trpt/trpt.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c == --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Mar 21 05:15:10 2017 (r315661) +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Mar 21 06:39:49 2017 (r315662) @@ -310,7 +310,7 @@ op_tcpconn(struct snmp_context *ctx __un switch (value->var.subs[sub - 1]) { case LEAF_tcpConnState: - switch (tcpoids[i].tp->xt_tp.t_state) { + switch (tcpoids[i].tp->t_state) { case TCPS_CLOSED: value->v.integer = 1; Modified: head/contrib/bsnmp/snmp_mibII/mibII_udp.c == --- head/contrib/bsnmp/snmp_mibII/mibII_udp.c Tue Mar 21 05:15:10 2017 (r315661) +++ head/contrib/bsnmp/snmp_mibII/mibII_udp.c Tue Mar 21 06:39:49 2017 (r315662) @@ -105,8 +105,8 @@ fetch_udp(void) ptr->xig_len > sizeof(struct xinpgen); ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { inp = (struct xinpcb *)ptr; - if (inp->xi_inp.inp_gencnt > xinpgen->xig_gen || - (inp->xi_inp.inp_vflag & INP_IPV4) == 0) + if (inp->inp_gencnt > xinpgen->xig_gen || + (inp->inp_vflag & INP_IPV4) == 0) continue; udp_total++; @@ -128,17 +128,17 @@ fetch_udp(void) ptr->xig_len > sizeof(struct xinpgen); ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { inp = (struct xinpcb *)ptr; - if (inp->xi_inp.inp_gencnt > xinpgen->xig_gen || - (inp->xi_inp.inp_vflag & INP_IPV4) == 0) + if (inp->inp_gencnt > xinpgen->xig_gen || + (inp->inp_vflag & INP_IPV4) == 0) continue; oid->inp = inp; oid->index.len = 5; - inaddr = ntohl(inp->xi_inp.inp_laddr.s_addr); + inaddr = ntohl(inp->inp_laddr.s_addr); oid->index.subs[0] = (inaddr >> 24) & 0xff; oid->index.subs[1] = (inaddr >> 16) & 0xff; oid->index.subs[2] = (inaddr >> 8) & 0xff; oid->index.subs[3] = (inaddr >> 0) & 0xff; - oid->index.subs[4] = ntohs(inp->xi_inp.inp_lport); + oid->index.subs[4] = ntohs(inp->inp_lport); oid++; } Modified: head/contrib/ipfilter/ipsend/sock.c == --- head/contrib/ipfilter/ipsend/sock.c Tue Mar 21 05:15:10 2017 (r315661) +++ head/contrib/ipfilter/ipsend/sock.c Tue Mar 21 06:39:49 2017 (r315662) @@ -78,8 +78,10 @@ typedef int boolean_t; # include #endif #include +#define_WANT_INPCB #include #include +#define_WANT_TCPCB #include #include #include Modified: head/lib/libprocstat/libprocstat.c == --- head/lib/libprocstat/libprocstat.c Tue Mar 21 05:15:10 2017 (r315661) +++ head/lib/libprocstat/libp
Re: svn commit: r315662 - in head: contrib/bsnmp/snmp_mibII contrib/ipfilter/ipsend lib/libprocstat sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat usr.bin/systat usr.sbin/tcpdrop usr.sbin/trpt
Hi! This change is known to break a ton of ports. More than 100 if counting depends. I'm sorry for that and I already started to fix them. Please send all new breakages to me. On Tue, Mar 21, 2017 at 06:39:49AM +, Gleb Smirnoff wrote: T> Author: glebius T> Date: Tue Mar 21 06:39:49 2017 T> New Revision: 315662 T> URL: https://svnweb.freebsd.org/changeset/base/315662 T> T> Log: T> Hide struct inpcb, struct tcpcb from the userland. T> T> This is a painful change, but it is needed. On the one hand, we avoid T> modifying them, and this slows down some ideas, on the other hand we still T> eventually modify them and tools like netstat(1) never work on next version of T> FreeBSD. We maintain a ton of spares in them, and we already got some ifdef T> hell at the end of tcpcb. T> T> Details: T> - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. T> - Make struct xinpcb, struct xtcpcb pure API structures, not including T> kernel structures inpcb and tcpcb inside. Export into these structures T> the fields from inpcb and tcpcb that are known to be used, and put there T> a ton of spare space. T> - Make kernel and userland utilities compilable after these changes. T> - Bump __FreeBSD_version. T> T> Reviewed by: rrs, gnn T> Differential Revision: D10018 T> T> Modified: T> head/contrib/bsnmp/snmp_mibII/mibII_tcp.c T> head/contrib/bsnmp/snmp_mibII/mibII_udp.c T> head/contrib/ipfilter/ipsend/sock.c T> head/lib/libprocstat/libprocstat.c T> head/sys/netinet/in_pcb.c T> head/sys/netinet/in_pcb.h T> head/sys/netinet/ip_divert.c T> head/sys/netinet/raw_ip.c T> head/sys/netinet/tcp_subr.c T> head/sys/netinet/tcp_syncache.c T> head/sys/netinet/tcp_timer.c T> head/sys/netinet/tcp_timer.h T> head/sys/netinet/tcp_var.h T> head/sys/netinet/udp_usrreq.c T> head/sys/sys/param.h T> head/usr.bin/netstat/inet.c T> head/usr.bin/sockstat/sockstat.c T> head/usr.bin/systat/extern.h T> head/usr.bin/systat/netcmds.c T> head/usr.bin/systat/netstat.c T> head/usr.sbin/tcpdrop/tcpdrop.c T> head/usr.sbin/trpt/trpt.c T> T> Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c T> == T> --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.cTue Mar 21 05:15:10 2017(r315661) T> +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.cTue Mar 21 06:39:49 2017(r315662) T> @@ -310,7 +310,7 @@ op_tcpconn(struct snmp_context *ctx __un T> switch (value->var.subs[sub - 1]) { T> T>case LEAF_tcpConnState: T> -switch (tcpoids[i].tp->xt_tp.t_state) { T> +switch (tcpoids[i].tp->t_state) { T> T>case TCPS_CLOSED: T> value->v.integer = 1; T> T> Modified: head/contrib/bsnmp/snmp_mibII/mibII_udp.c T> == T> --- head/contrib/bsnmp/snmp_mibII/mibII_udp.cTue Mar 21 05:15:10 2017(r315661) T> +++ head/contrib/bsnmp/snmp_mibII/mibII_udp.cTue Mar 21 06:39:49 2017(r315662) T> @@ -105,8 +105,8 @@ fetch_udp(void) T> ptr->xig_len > sizeof(struct xinpgen); T> ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { T> inp = (struct xinpcb *)ptr; T> -if (inp->xi_inp.inp_gencnt > xinpgen->xig_gen || T> -(inp->xi_inp.inp_vflag & INP_IPV4) == 0) T> +if (inp->inp_gencnt > xinpgen->xig_gen || T> +(inp->inp_vflag & INP_IPV4) == 0) T> continue; T> T> udp_total++; T> @@ -128,17 +128,17 @@ fetch_udp(void) T> ptr->xig_len > sizeof(struct xinpgen); T> ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { T> inp = (struct xinpcb *)ptr; T> -if (inp->xi_inp.inp_gencnt > xinpgen->xig_gen || T> -(inp->xi_inp.inp_vflag & INP_IPV4) == 0) T> +if (inp->inp_gencnt > xinpgen->xig_gen || T> +(inp->inp_vflag & INP_IPV4) == 0) T> continue; T> oid->inp = inp; T> oid->index.len = 5; T> -inaddr = ntohl(inp->xi_inp.inp_laddr.s_addr); T> +inaddr = ntohl(inp->inp_laddr.s_addr); T> oid->index.subs[0] = (inaddr >> 24) & 0xff; T> oid->index.subs[1] = (inaddr >> 16) & 0xff; T> oid->index.subs[2] = (inaddr >> 8) & 0xff; T> oid->index.subs[3] = (inaddr >> 0) & 0xff; T> -oid->index.subs[4] = ntohs(inp->xi_inp.inp_lport); T> +oid->index.subs[4] = ntohs(inp->inp_lport); T> oid++; T> } T> T> T> Modified: head/contrib/ipfilter/ipsend/sock.c T> == T> --- head/contrib/ipfilter/ipsend/sock.c Tue Mar 21 05:15:10 2017 (r315661) T> +++ head/co
Re: svn commit: r315662 - in head: contrib/bsnmp/snmp_mibII contrib/ipfilter/ipsend lib/libprocstat sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat usr.bin/systat usr.sbin/tcpdrop usr.sbin/trpt
On Tue, Mar 21, 2017 at 7:41 AM, Gleb Smirnoff wrote: > Hi! > > This change is known to break a ton of ports. More than 100 if > counting depends. I'm sorry for that and I already started to fix > them. > > Please send all new breakages to me. Hi, Exp-runs should happen before breakage happens, not after. If you already know that it breaks hundreds of ports, please revert and request an exp-run. Antoine (with hat: portmgr) > On Tue, Mar 21, 2017 at 06:39:49AM +, Gleb Smirnoff wrote: > T> Author: glebius > T> Date: Tue Mar 21 06:39:49 2017 > T> New Revision: 315662 > T> URL: https://svnweb.freebsd.org/changeset/base/315662 > T> > T> Log: > T> Hide struct inpcb, struct tcpcb from the userland. > T> > T> This is a painful change, but it is needed. On the one hand, we avoid > T> modifying them, and this slows down some ideas, on the other hand we > still > T> eventually modify them and tools like netstat(1) never work on next > version of > T> FreeBSD. We maintain a ton of spares in them, and we already got some > ifdef > T> hell at the end of tcpcb. > T> > T> Details: > T> - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. > T> - Make struct xinpcb, struct xtcpcb pure API structures, not including > T> kernel structures inpcb and tcpcb inside. Export into these structures > T> the fields from inpcb and tcpcb that are known to be used, and put > there > T> a ton of spare space. > T> - Make kernel and userland utilities compilable after these changes. > T> - Bump __FreeBSD_version. > T> > T> Reviewed by: rrs, gnn > T> Differential Revision: D10018 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r315662 - in head: contrib/bsnmp/snmp_mibII contrib/ipfilter/ipsend lib/libprocstat sys/netinet sys/sys usr.bin/netstat usr.bin/sockstat usr.bin/systat usr.sbin/tcpdrop usr.sbin/trpt
On Tue, Mar 21, 2017 at 07:50:32AM +0100, Antoine Brodin wrote: A> > This change is known to break a ton of ports. More than 100 if A> > counting depends. I'm sorry for that and I already started to fix A> > them. A> > A> > Please send all new breakages to me. A> A> Hi, A> A> Exp-runs should happen before breakage happens, not after. A> If you already know that it breaks hundreds of ports, please revert A> and request an exp-run. The exp-run has already been made: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210673 Wasn't very helpful. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"