svn commit: r360453 - head
Author: bdrewery Date: Wed Apr 29 02:18:39 2020 New Revision: 360453 URL: https://svnweb.freebsd.org/changeset/base/360453 Log: Use universe-toolchain config(8) This is a temporary hack to aid with config(8) changing in r360443. It will not work for all cases. env PATH is used because universe-toolchain is only built when worlds are built, and then only if clang is needed, so it may not exist. universe-toolchain needs to be expanded to always be built, inspected to remove non-cross-build-safe tools, used for buildworld/buildkernel, and potentially incremental build support. Sponsored by: Dell EMC Modified: head/Makefile Modified: head/Makefile == --- head/Makefile Tue Apr 28 20:34:27 2020(r360452) +++ head/Makefile Wed Apr 29 02:18:39 2020(r360453) @@ -711,6 +711,7 @@ KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ universe_kernconfs: universe_kernels_prologue .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!=cd ${KERNSRCDIR}/${TARGET}/conf && \ + env PATH=${HOST_OBJTOP}/tmp/legacy/bin:${PATH:Q} \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ grep -v WARNING: | cut -f 2 .if empty(TARGET_ARCH_${kernel}) ___ 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: r360444 - head/sys/conf
On 4/28/2020 3:30 PM, John Baldwin wrote: > On 4/28/20 9:09 AM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Apr 28 16:09:25 2020 >> New Revision: 360444 >> URL: https://svnweb.freebsd.org/changeset/base/360444 >> >> Log: >> Don't try ctfconvert on file without debug info. >> >> This was currently an ignored error but will change to a hard error >> eventually. >> >> Differential Revision: https://reviews.freebsd.org/D24536 > > FYI, this just broke make tinderbox entirely for building head on > older head or stable/12. The issue is that 'make tinderbox' uses > the host's config binary to run 'config -m' against each kernel > config file to determine it's MACHINE_ARCH, and when it gets an error > make tinderbox just dies, e.g.: > >> make tinderbox NO_CLEAN=yes JFLAG=-j2 > -- make universe started on Tue Apr 28 09:27:36 PDT 2020 > -- > -- >> Toolchain bootstrap started on Tue Apr 28 09:27:36 PDT 2020 > -- > -- >> Toolchain bootstrap completed on Tue Apr 28 09:59:35 PDT 2020 > -- >>> amd64 started on Tue Apr 28 09:59:35 PDT 2020 >>> amd64.amd64 buildworld started on Tue Apr 28 09:59:35 PDT 2020 >>> amd64.amd64 buildworld completed on Tue Apr 28 15:28:31 PDT 2020 > make[2]: "/usr/home/john/work/freebsd/clean/Makefile" line 717: "Target > architecture for amd64/conf/GENERIC unknown. config(8) likely too old." > *** Error code 1 > > The real fix is we somehow need to build a config binary as a build > tool and use that instead of the host config binary. I'm not quite > sure where to start on fixing that though. It's already in bootstrap-tools. Ah I see the problem is Makefile. Why isn't this already solved by now? The "universe-toolchain" target should be building it already. Just need to get the PATH right. I'm working on a fix. > > Previously riscv broke this when it bumped the config version for > GENERICSF, but I just reverted that bump yesterday, however riscv > dying meant you still built most of tinderbox before it dies compared > to now. > -- Regards, Bryan Drewery ___ 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: r360444 - head/sys/conf
On 4/28/20 9:09 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Apr 28 16:09:25 2020 > New Revision: 360444 > URL: https://svnweb.freebsd.org/changeset/base/360444 > > Log: > Don't try ctfconvert on file without debug info. > > This was currently an ignored error but will change to a hard error > eventually. > > Differential Revision: https://reviews.freebsd.org/D24536 FYI, this just broke make tinderbox entirely for building head on older head or stable/12. The issue is that 'make tinderbox' uses the host's config binary to run 'config -m' against each kernel config file to determine it's MACHINE_ARCH, and when it gets an error make tinderbox just dies, e.g.: > make tinderbox NO_CLEAN=yes JFLAG=-j2 -- >>> make universe started on Tue Apr 28 09:27:36 PDT 2020 -- -- > Toolchain bootstrap started on Tue Apr 28 09:27:36 PDT 2020 -- -- > Toolchain bootstrap completed on Tue Apr 28 09:59:35 PDT 2020 -- >> amd64 started on Tue Apr 28 09:59:35 PDT 2020 >> amd64.amd64 buildworld started on Tue Apr 28 09:59:35 PDT 2020 >> amd64.amd64 buildworld completed on Tue Apr 28 15:28:31 PDT 2020 make[2]: "/usr/home/john/work/freebsd/clean/Makefile" line 717: "Target architecture for amd64/conf/GENERIC unknown. config(8) likely too old." *** Error code 1 The real fix is we somehow need to build a config binary as a build tool and use that instead of the host config binary. I'm not quite sure where to start on fixing that though. Previously riscv broke this when it bumped the config version for GENERICSF, but I just reverted that bump yesterday, however riscv dying meant you still built most of tinderbox before it dies compared to now. -- John Baldwin ___ 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: r360452 - head/bin/sh
Author: jilles Date: Tue Apr 28 20:34:27 2020 New Revision: 360452 URL: https://svnweb.freebsd.org/changeset/base/360452 Log: sh: Assert INTOFF rather than applying it in ck* As I noted in https://reviews.freebsd.org/D22756, INTOFF should be in effect when calling ckmalloc/ckrealloc/ckfree to avoid memory leaks and double frees. Therefore, change the functions to check if INTOFF is in effect instead of applying it. Reviewed by: bdrewery Differential Revision:https://reviews.freebsd.org/D24599 Modified: head/bin/sh/memalloc.c Modified: head/bin/sh/memalloc.c == --- head/bin/sh/memalloc.c Tue Apr 28 20:14:38 2020(r360451) +++ head/bin/sh/memalloc.c Tue Apr 28 20:34:27 2020(r360452) @@ -50,6 +50,13 @@ __FBSDID("$FreeBSD$"); #include #include +static void +badalloc(const char *message) +{ + write(2, message, strlen(message)); + abort(); +} + /* * Like malloc, but returns an error when out of space. */ @@ -59,9 +66,9 @@ ckmalloc(size_t nbytes) { pointer p; - INTOFF; + if (!is_int_on()) + badalloc("Unsafe ckmalloc() call\n"); p = malloc(nbytes); - INTON; if (p == NULL) error("Out of space"); return p; @@ -75,9 +82,9 @@ ckmalloc(size_t nbytes) pointer ckrealloc(pointer p, int nbytes) { - INTOFF; + if (!is_int_on()) + badalloc("Unsafe ckrealloc() call\n"); p = realloc(p, nbytes); - INTON; if (p == NULL) error("Out of space"); return p; @@ -86,9 +93,9 @@ ckrealloc(pointer p, int nbytes) void ckfree(pointer p) { - INTOFF; + if (!is_int_on()) + badalloc("Unsafe ckfree() call\n"); free(p); - INTON; } ___ 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: r360450 - in head/sys: conf net net/route
Author: melifaro Date: Tue Apr 28 20:00:17 2020 New Revision: 360450 URL: https://svnweb.freebsd.org/changeset/base/360450 Log: Move route-specific ddb commands to route/route_ddb.c Currently functionality resides in rtsock.c, which is a controlling interface, partially external to the routing subsystem. Additionally, DDB-supporting functionality is > 100SLOC, which deserves a separate file. Given that, move this functionality to a newly-created net/route/ subdir. Reviewed by: cem Differential Revision:https://reviews.freebsd.org/D24561 Added: head/sys/net/route/route_ddb.c (contents, props changed) Modified: head/sys/conf/files head/sys/net/route.h head/sys/net/rtsock.c Modified: head/sys/conf/files == --- head/sys/conf/files Tue Apr 28 19:14:09 2020(r360449) +++ head/sys/conf/files Tue Apr 28 20:00:17 2020(r360450) @@ -4095,6 +4095,7 @@ net/route/nhop.c standard net/route/nhop_ctl.c standard net/route/nhop_utils.c standard net/route/route_ctl.c standard +net/route/route_ddb.c optional ddb net/route/route_helpers.c standard net/route/route_temporal.c standard net/rss_config.c optional inet rss | inet6 rss Modified: head/sys/net/route.h == --- head/sys/net/route.hTue Apr 28 19:14:09 2020(r360449) +++ head/sys/net/route.hTue Apr 28 20:00:17 2020(r360450) @@ -388,6 +388,8 @@ int rtsock_addrmsg(int, struct ifaddr *, int); intrtsock_routemsg(int, struct rtentry *, struct ifnet *ifp, int, int); intrtsock_routemsg_info(int, struct rt_addrinfo *, int); +struct sockaddr *rtsock_fix_netmask(const struct sockaddr *dst, + const struct sockaddr *smask, struct sockaddr_storage *dmask); /* * Note the following locking behavior: * Added: head/sys/net/route/route_ddb.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route/route_ddb.c Tue Apr 28 20:00:17 2020 (r360450) @@ -0,0 +1,458 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + */ + +#include +__FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Unfortunately, RTF_ values are expressed as raw masks rather than powers of + * 2, so we cannot use them as nice C99 initializer indices below. + */ +static const char * const rtf_flag_strings[] = { + "UP", + "GATEWAY", + "HOST", + "REJECT", + "DYNAMIC", + "MODIFIED", + "DONE", + "UNUSED_0x80", + "UNUSED_0x100", + "XRESOLVE", + "LLDATA", + "STATIC", + "BLACKHOLE", + "UNUSED_0x2000", + "PROTO2", + "PROTO1", + "UNUSED_0x1", + "UNUSED_0x2", + "PROTO3", + "FIXEDMTU", + "PINNED", + "LOCAL", + "BROADCAST", + "MULTICAST", + /* Big gap. */ + [28] = "STICKY", + [30] = "RNH_LOCKED", + [31] = "GWFLAG_COMPAT", +}; + +static const char * __pure +rt_flag_name(unsigned idx) +{ + if (idx >= nitems(rtf_flag_strings)) + return ("INVALID_FLAG"); + if (rtf_flag_strings[idx] == NULL) +
svn commit: r360449 - in head/sys: conf net net/route netinet netinet6 netpfil/ipfw
Author: melifaro Date: Tue Apr 28 19:14:09 2020 New Revision: 360449 URL: https://svnweb.freebsd.org/changeset/base/360449 Log: Move route_temporal.c and route_var.h to net/route. Nexthop objects implementation, defined in r359823, introduced sys/net/route directory intended to hold all routing-related code. Move recently-introduced route_temporal.c and private route_var.h header there. Differential Revision:https://reviews.freebsd.org/D24597 Added: head/sys/net/route/route_temporal.c - copied, changed from r360430, head/sys/net/route_temporal.c head/sys/net/route/route_var.h - copied unchanged from r360447, head/sys/net/route_var.h Deleted: head/sys/net/route_temporal.c head/sys/net/route_var.h Modified: head/sys/conf/files head/sys/net/radix_mpath.c head/sys/net/route.c head/sys/net/route/nhop.c head/sys/net/route/nhop_ctl.c head/sys/net/route/route_ctl.c head/sys/net/route/route_helpers.c head/sys/net/rtsock.c head/sys/netinet/in_fib.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/conf/files == --- head/sys/conf/files Tue Apr 28 18:53:49 2020(r360448) +++ head/sys/conf/files Tue Apr 28 19:14:09 2020(r360449) @@ -4091,12 +4091,12 @@ net/radix_mpath.c standard net/raw_cb.c standard net/raw_usrreq.c standard net/route.cstandard -net/route_temporal.c standard net/route/nhop.c standard net/route/nhop_ctl.c standard net/route/nhop_utils.c standard net/route/route_ctl.c standard net/route/route_helpers.c standard +net/route/route_temporal.c standard net/rss_config.c optional inet rss | inet6 rss net/rtsock.c standard net/slcompress.c optional netgraph_vjc | sppp | \ Modified: head/sys/net/radix_mpath.c == --- head/sys/net/radix_mpath.c Tue Apr 28 18:53:49 2020(r360448) +++ head/sys/net/radix_mpath.c Tue Apr 28 19:14:09 2020(r360449) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/net/route.c == --- head/sys/net/route.cTue Apr 28 18:53:49 2020(r360448) +++ head/sys/net/route.cTue Apr 28 19:14:09 2020(r360449) @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include Modified: head/sys/net/route/nhop.c == --- head/sys/net/route/nhop.c Tue Apr 28 18:53:49 2020(r360448) +++ head/sys/net/route/nhop.c Tue Apr 28 19:14:09 2020(r360449) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/net/route/nhop_ctl.c == --- head/sys/net/route/nhop_ctl.c Tue Apr 28 18:53:49 2020 (r360448) +++ head/sys/net/route/nhop_ctl.c Tue Apr 28 19:14:09 2020 (r360449) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/net/route/route_ctl.c == --- head/sys/net/route/route_ctl.c Tue Apr 28 18:53:49 2020 (r360448) +++ head/sys/net/route/route_ctl.c Tue Apr 28 19:14:09 2020 (r360449) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/net/route/route_helpers.c == --- head/sys/net/route/route_helpers.c Tue Apr 28 18:53:49 2020 (r360448) +++ head/sys/net/route/route_helpers.c Tue Apr 28 19:14:09 2020 (r360449) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Copied and modified: head/sys/net/route/route_temporal.c (from r360430, head/sys/net/route_temporal.c) == --- head/sys/net/route_temporal.c Tue Apr 28 07:25:34 2020 (r360430, copy source) +++ head/sys/net/route/route_temporal.c Tue Apr 28 19:14:09 2020 (r360449) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include /* Copied:
Re: svn commit: r360445 - head/cddl/contrib/opensolaris/tools/ctf/cvt
I did not mean to commit this yet. Likely broke non-x86. Reverting now. On 4/28/2020 9:09 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Apr 28 16:09:28 2020 > New Revision: 360445 > URL: https://svnweb.freebsd.org/changeset/base/360445 > > Log: > ctfmerge: Assert that there is enough room for types. > > Sponsord by:Dell EMC > Differential Revision: https://reviews.freebsd.org/D24537 > > Modified: > head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c > head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c > == > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 > 16:09:25 2020(r360444) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 > 16:09:28 2020(r360445) > @@ -452,6 +452,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus > if (ed.ed_tgt->t_type == FORWARD && ctdp->t_type != FORWARD) { > int id = mcd->md_tgt->td_nextid++; > > +#ifdef __FreeBSD__ > + if (CTF_TYPE_ISCHILD(id)) > + terminate("No room for additional types\n"); > +#endif > debug(3, "Creating new defn type %d <%x>\n", id, id); > add_mapping(mcd->md_ta, ctdp->t_id, id); > alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt, > @@ -473,6 +477,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus > } else { > int id = mcd->md_tgt->td_nextid++; > > +#ifdef __FreeBSD__ > + if (CTF_TYPE_ISCHILD(id)) > + terminate("No room for additional types\n"); > +#endif > debug(3, "Creating new type %d <%x>\n", id, id); > add_mapping(mcd->md_ta, ctdp->t_id, id); > hash_add(mcd->md_tdtba, ctdp); > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c > == > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/util.cTue Apr 28 > 16:09:25 2020(r360444) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/util.cTue Apr 28 > 16:09:28 2020(r360445) > @@ -148,17 +148,7 @@ terminate(const char *format, ...) > > if (getenv("CTF_ABORT_ON_TERMINATE") != NULL) > abort(); > -#if defined(__FreeBSD__) > -/* > - * For the time being just output the termination message, but don't > - * return an exit status that would cause the build to fail. We need > - * to get as much stuff built as possible before going back and > - * figuring out what is wrong with certain files. > - */ > - exit(0); > -#else > exit(1); > -#endif > } > > /*PRINTFLIKE1*/ > -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r360448 - head/cddl/contrib/opensolaris/tools/ctf/cvt
Author: bdrewery Date: Tue Apr 28 18:53:49 2020 New Revision: 360448 URL: https://svnweb.freebsd.org/changeset/base/360448 Log: Revert r360445 I did not intend to commit this yet as more work is needed for non-amd64 kernels. Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c == --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 18:42:30 2020(r360447) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 18:53:49 2020(r360448) @@ -452,10 +452,6 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus if (ed.ed_tgt->t_type == FORWARD && ctdp->t_type != FORWARD) { int id = mcd->md_tgt->td_nextid++; -#ifdef __FreeBSD__ - if (CTF_TYPE_ISCHILD(id)) - terminate("No room for additional types\n"); -#endif debug(3, "Creating new defn type %d <%x>\n", id, id); add_mapping(mcd->md_ta, ctdp->t_id, id); alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt, @@ -477,10 +473,6 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus } else { int id = mcd->md_tgt->td_nextid++; -#ifdef __FreeBSD__ - if (CTF_TYPE_ISCHILD(id)) - terminate("No room for additional types\n"); -#endif debug(3, "Creating new type %d <%x>\n", id, id); add_mapping(mcd->md_ta, ctdp->t_id, id); hash_add(mcd->md_tdtba, ctdp); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c == --- head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Apr 28 18:42:30 2020(r360447) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Apr 28 18:53:49 2020(r360448) @@ -148,7 +148,17 @@ terminate(const char *format, ...) if (getenv("CTF_ABORT_ON_TERMINATE") != NULL) abort(); +#if defined(__FreeBSD__) +/* + * For the time being just output the termination message, but don't + * return an exit status that would cause the build to fail. We need + * to get as much stuff built as possible before going back and + * figuring out what is wrong with certain files. + */ + exit(0); +#else exit(1); +#endif } /*PRINTFLIKE1*/ ___ 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: r360447 - in head/sys: net netinet6
Author: melifaro Date: Tue Apr 28 18:42:30 2020 New Revision: 360447 URL: https://svnweb.freebsd.org/changeset/base/360447 Log: Move struct rtentry definition to nhop_var.h. One of the goals of the new routing KPI defined in r359823 is to entirely hide`struct rtentry` from the consumers. It will allow to improve routing subsystem internals and deliver features much faster. This is one of the last changes, effectively moving struct rtentry definition to a net/route_var.h header, internal to the routing subsystem. Differential Revision:https://reviews.freebsd.org/D24580 Modified: head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet6/nd6.c Modified: head/sys/net/route.h == --- head/sys/net/route.hTue Apr 28 17:59:37 2020(r360446) +++ head/sys/net/route.hTue Apr 28 18:42:30 2020(r360447) @@ -35,7 +35,6 @@ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ -#include #include /* @@ -129,42 +128,6 @@ VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce * gateways are marked so that the output routines know to address the * gateway rather than the ultimate destination. */ -#ifndef RNF_NORMAL -#include -#ifdef RADIX_MPATH -#include -#endif -#endif - -#if defined(_KERNEL) -struct rtentry { - struct radix_node rt_nodes[2]; /* tree glue, and other values */ - /* -* XXX struct rtentry must begin with a struct radix_node (or two!) -* because the code does some casts of a 'struct radix_node *' -* to a 'struct rtentry *' -*/ -#definert_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key))) -#definert_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) -#definert_key_const(r) (*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_key))) -#definert_mask_const(r)(*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_mask))) - struct sockaddr *rt_gateway; /* value */ - struct ifnet *rt_ifp; /* the answer: interface to use */ - struct ifaddr *rt_ifa; /* the answer: interface address to use */ - struct nhop_object *rt_nhop; /* nexthop data */ - int rt_flags; /* up/down?, host/net */ - int rt_refcnt; /* # held references */ - u_int rt_fibnum; /* which FIB */ - u_long rt_mtu; /* MTU for this path */ - u_long rt_weight; /* absolute weight */ - u_long rt_expire; /* lifetime for route, e.g. redirect */ -#definert_endzero rt_pksent - counter_u64_t rt_pksent; /* packets sent using this route */ - struct mtx rt_mtx; /* mutex for routing entry */ - struct rtentry *rt_chain; /* pointer to next rtentry to delete */ -}; -#endif /* _KERNEL */ - #defineRTF_UP 0x1 /* route usable */ #defineRTF_GATEWAY 0x2 /* destination is a gateway */ #defineRTF_HOST0x4 /* host entry (net otherwise) */ @@ -369,53 +332,7 @@ struct rt_addrinfo { #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ || (ifp)->if_link_state == LINK_STATE_UP) -#defineRT_LOCK_INIT(_rt) \ - mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW) -#defineRT_LOCK(_rt)mtx_lock(&(_rt)->rt_mtx) -#defineRT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) -#defineRT_LOCK_DESTROY(_rt)mtx_destroy(&(_rt)->rt_mtx) -#defineRT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) -#defineRT_UNLOCK_COND(_rt) do {\ - if (mtx_owned(&(_rt)->rt_mtx)) \ - mtx_unlock(&(_rt)->rt_mtx); \ -} while (0) - -#defineRT_ADDREF(_rt) do {\ - RT_LOCK_ASSERT(_rt);\ - KASSERT((_rt)->rt_refcnt >= 0, \ - ("negative refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt++; \ -} while (0) - -#defineRT_REMREF(_rt) do {\ - RT_LOCK_ASSERT(_rt);\ - KASSERT((_rt)->rt_refcnt > 0, \ - ("bogus refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt--; \ -} while (0) - -#defineRTFREE_LOCKED(_rt) do { \ - if ((_rt)->rt_refcnt <= 1) \ - rtfree(_rt);\ - else {
Re: svn commit: r360408 - in head: share/man/man4 sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys
On 4/27/20 4:17 PM, John Baldwin wrote: > Author: jhb > Date: Mon Apr 27 23:17:19 2020 > New Revision: 360408 > URL: https://svnweb.freebsd.org/changeset/base/360408 > > Log: > Initial support for kernel offload of TLS receive. > > - Add a new TCP_RXTLS_ENABLE socket option to set the encryption and > authentication algorithms and keys as well as the initial sequence > number. > > - When reading from a socket using KTLS receive, applications must use > recvmsg(). Each successful call to recvmsg() will return a single > TLS record. A new TCP control message, TLS_GET_RECORD, will contain > the TLS record header of the decrypted record. The regular message > buffer passed to recvmsg() will receive the decrypted payload. This > is similar to the interface used by Linux's KTLS RX except that > Linux does not return the full TLS header in the control message. > > - Add plumbing to the TOE KTLS interface to request either transmit > or receive KTLS sessions. > > - When a socket is using receive KTLS, redirect reads from > soreceive_stream() into soreceive_generic(). > > - Note that this interface is currently only defined for TLS 1.1 and > 1.2, though I believe we will be able to reuse the same interface > and structures for 1.3. The OpenSSL changes required for RX support are not yet upstream, but I hope to open the pull request for those later today after retesting them against latest OpenSSL master. -- John Baldwin ___ 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: r360445 - head/cddl/contrib/opensolaris/tools/ctf/cvt
Author: bdrewery Date: Tue Apr 28 16:09:28 2020 New Revision: 360445 URL: https://svnweb.freebsd.org/changeset/base/360445 Log: ctfmerge: Assert that there is enough room for types. Sponsord by: Dell EMC Differential Revision:https://reviews.freebsd.org/D24537 Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c == --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 16:09:25 2020(r360444) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Tue Apr 28 16:09:28 2020(r360445) @@ -452,6 +452,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus if (ed.ed_tgt->t_type == FORWARD && ctdp->t_type != FORWARD) { int id = mcd->md_tgt->td_nextid++; +#ifdef __FreeBSD__ + if (CTF_TYPE_ISCHILD(id)) + terminate("No room for additional types\n"); +#endif debug(3, "Creating new defn type %d <%x>\n", id, id); add_mapping(mcd->md_ta, ctdp->t_id, id); alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt, @@ -473,6 +477,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unus } else { int id = mcd->md_tgt->td_nextid++; +#ifdef __FreeBSD__ + if (CTF_TYPE_ISCHILD(id)) + terminate("No room for additional types\n"); +#endif debug(3, "Creating new type %d <%x>\n", id, id); add_mapping(mcd->md_ta, ctdp->t_id, id); hash_add(mcd->md_tdtba, ctdp); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c == --- head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Apr 28 16:09:25 2020(r360444) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Apr 28 16:09:28 2020(r360445) @@ -148,17 +148,7 @@ terminate(const char *format, ...) if (getenv("CTF_ABORT_ON_TERMINATE") != NULL) abort(); -#if defined(__FreeBSD__) -/* - * For the time being just output the termination message, but don't - * return an exit status that would cause the build to fail. We need - * to get as much stuff built as possible before going back and - * figuring out what is wrong with certain files. - */ - exit(0); -#else exit(1); -#endif } /*PRINTFLIKE1*/ ___ 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: r360444 - head/sys/conf
Author: bdrewery Date: Tue Apr 28 16:09:25 2020 New Revision: 360444 URL: https://svnweb.freebsd.org/changeset/base/360444 Log: Don't try ctfconvert on file without debug info. This was currently an ignored error but will change to a hard error eventually. Differential Revision:https://reviews.freebsd.org/D24536 Modified: head/sys/conf/Makefile.amd64 head/sys/conf/files.amd64 Modified: head/sys/conf/Makefile.amd64 == --- head/sys/conf/Makefile.amd64Tue Apr 28 16:09:22 2020 (r360443) +++ head/sys/conf/Makefile.amd64Tue Apr 28 16:09:25 2020 (r360444) @@ -18,7 +18,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600012 +%VERSREQ= 600018 STD8X16FONT?= iso Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Tue Apr 28 16:09:22 2020(r360443) +++ head/sys/conf/files.amd64 Tue Apr 28 16:09:25 2020(r360444) @@ -113,7 +113,8 @@ amd64/amd64/initcpu.c standard amd64/amd64/io.c optionalio amd64/amd64/locore.S standardno-obj amd64/amd64/xen-locore.S optionalxenhvm \ - compile-with "${NORMAL_S} -g0" + compile-with "${NORMAL_S} -g0" \ + no-ctfconvert amd64/amd64/machdep.c standard amd64/amd64/mem.c optionalmem amd64/amd64/minidump_machdep.c standard ___ 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: r360443 - head/usr.sbin/config
Author: bdrewery Date: Tue Apr 28 16:09:22 2020 New Revision: 360443 URL: https://svnweb.freebsd.org/changeset/base/360443 Log: config: Add no-ctfconvert support. Bump CONFIGVERS to 600018 for this support. Some files may purposely have debug info disabled or are *source files* that attempt to run ctfconvert on them. Currently ctfconvert ignores these errors but I have a change to make the errors real so we can catch real problems like exceeding type limits. Sponsored by: Dell EMC Reviewed by: imp, cem, kevans Differential Revision:https://reviews.freebsd.org/D24535 Modified: head/usr.sbin/config/config.h head/usr.sbin/config/configvers.h head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/config.h == --- head/usr.sbin/config/config.h Tue Apr 28 16:09:18 2020 (r360442) +++ head/usr.sbin/config/config.h Tue Apr 28 16:09:22 2020 (r360443) @@ -82,6 +82,7 @@ struct files_name { #define NO_OBJ 2 #define BEFORE_DEPEND 4 #define NOWERROR 16 +#define NO_CTFCONVERT 32 struct device { int d_done; /* processed */ Modified: head/usr.sbin/config/configvers.h == --- head/usr.sbin/config/configvers.h Tue Apr 28 16:09:18 2020 (r360442) +++ head/usr.sbin/config/configvers.h Tue Apr 28 16:09:22 2020 (r360443) @@ -49,7 +49,7 @@ * * $FreeBSD$ */ -#defineCONFIGVERS 600017 +#defineCONFIGVERS 600018 #defineMAJOR_VERS(x) ((x) / 10) /* Last config(8) version to require envmode/hintmode */ Modified: head/usr.sbin/config/mkmakefile.c == --- head/usr.sbin/config/mkmakefile.c Tue Apr 28 16:09:18 2020 (r360442) +++ head/usr.sbin/config/mkmakefile.c Tue Apr 28 16:09:22 2020 (r360443) @@ -397,7 +397,7 @@ read_file(char *fname) char *wd, *this, *compilewith, *depends, *clean, *warning; const char *objprefix; int compile, match, nreqs, std, filetype, not, - imp_rule, no_obj, before_depend, nowerror; + imp_rule, no_ctfconvert, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); if (fp == NULL) @@ -452,6 +452,7 @@ next: warning = 0; std = 0; imp_rule = 0; + no_ctfconvert = 0; no_obj = 0; before_depend = 0; nowerror = 0; @@ -479,6 +480,10 @@ next: nreqs = 0; continue; } + if (eq(wd, "no-ctfconvert")) { + no_ctfconvert++; + continue; + } if (eq(wd, "no-obj")) { no_obj++; continue; @@ -591,8 +596,10 @@ nextparam:; tp->f_srcprefix = "$S/"; if (imp_rule) tp->f_flags |= NO_IMPLCT_RULE; + if (no_ctfconvert) + tp->f_flags |= NO_CTFCONVERT; if (no_obj) - tp->f_flags |= NO_OBJ; + tp->f_flags |= NO_OBJ | NO_CTFCONVERT; if (before_depend) tp->f_flags |= BEFORE_DEPEND; if (nowerror) @@ -805,7 +812,7 @@ do_rules(FILE *f) else fprintf(f, "\t%s\n", compilewith); - if (!(ftp->f_flags & NO_OBJ)) + if (!(ftp->f_flags & NO_CTFCONVERT)) fprintf(f, "\t${NORMAL_CTFCONVERT}\n\n"); else fprintf(f, "\n"); ___ 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: r360442 - in head/sys/modules: cxgb/cxgb cxgbe/iw_cxgbe rdma/krping sfxge
Author: bdrewery Date: Tue Apr 28 16:09:18 2020 New Revision: 360442 URL: https://svnweb.freebsd.org/changeset/base/360442 Log: None of these use opt_sched.h Modified: head/sys/modules/cxgb/cxgb/Makefile head/sys/modules/cxgbe/iw_cxgbe/Makefile head/sys/modules/rdma/krping/Makefile head/sys/modules/sfxge/Makefile Modified: head/sys/modules/cxgb/cxgb/Makefile == --- head/sys/modules/cxgb/cxgb/Makefile Tue Apr 28 16:07:15 2020 (r360441) +++ head/sys/modules/cxgb/cxgb/Makefile Tue Apr 28 16:09:18 2020 (r360442) @@ -8,7 +8,7 @@ SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael1002.c cxgb_mv SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c SRCS+= cxgb_sge.c cxgb_tn1010.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_inet6.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} Modified: head/sys/modules/cxgbe/iw_cxgbe/Makefile == --- head/sys/modules/cxgbe/iw_cxgbe/MakefileTue Apr 28 16:07:15 2020 (r360441) +++ head/sys/modules/cxgbe/iw_cxgbe/MakefileTue Apr 28 16:09:18 2020 (r360442) @@ -14,7 +14,7 @@ SRCS+=provider.c SRCS+= qp.c SRCS+= resource.c SRCS+= ${LINUXKPI_GENSRCS} -SRCS+= opt_inet.h opt_inet6.h opt_ktr.h opt_ofed.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_ktr.h opt_ofed.h CFLAGS+= -I${CXGBE} -I${SRCTOP}/sys/ofed/include -DLINUX_TYPES_DEFINED CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi Modified: head/sys/modules/rdma/krping/Makefile == --- head/sys/modules/rdma/krping/Makefile Tue Apr 28 16:07:15 2020 (r360441) +++ head/sys/modules/rdma/krping/Makefile Tue Apr 28 16:09:18 2020 (r360442) @@ -4,7 +4,7 @@ KMOD= krping SRCS= krping.c krping_dev.c getopt.c SRCS+= ${LINUXKPI_GENSRCS} -SRCS+= opt_sched.h opt_inet.h opt_inet6.h +SRCS+= opt_inet.h opt_inet6.h CFLAGS+= -I${SRCTOP}/sys/ofed/include CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include Modified: head/sys/modules/sfxge/Makefile == --- head/sys/modules/sfxge/Makefile Tue Apr 28 16:07:15 2020 (r360441) +++ head/sys/modules/sfxge/Makefile Tue Apr 28 16:09:18 2020 (r360442) @@ -5,7 +5,7 @@ KMOD= sfxge SFXGE= ${SRCTOP}/sys/dev/sfxge SRCS= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_inet6.h opt_sched.h opt_rss.h +SRCS+= opt_inet.h opt_inet6.h opt_rss.h .PATH: ${SRCTOP}/sys/dev/sfxge SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c ___ 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: r360441 - head/usr.sbin/syslogd
Author: bdrewery Date: Tue Apr 28 16:07:15 2020 New Revision: 360441 URL: https://svnweb.freebsd.org/changeset/base/360441 Log: Restore local kernel "prog" filtering lost in r332099. This behavior is most relevant for ipfw(4) as documented in syslog.conf(5). The recent addition of property-based regex filters in r359327 is a fine workaround for this but the behavior was present since 1997 and documented. This only fixes local matching of the "kernel program". It does not change the forwarded format at all. On the remote side it will still be "kernel: ipfw:" and not be parsed as a kernel message. This matches old behavior. MFC after:2 weeks Reviewed by: markj Relnotes: yes Differential Revision:https://reviews.freebsd.org/D24286 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Tue Apr 28 16:00:34 2020 (r360440) +++ head/usr.sbin/syslogd/syslogd.c Tue Apr 28 16:07:15 2020 (r360441) @@ -137,6 +137,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,6 +207,7 @@ static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INI #defineIGN_CONS0x001 /* don't print on console */ #defineSYNC_FILE 0x002 /* do fsync on file after printing */ #defineMARK0x008 /* this message is a mark */ +#defineISKERNEL0x010 /* kernel generated message */ /* Timestamps of log entries. */ struct logtime { @@ -1151,19 +1153,19 @@ parsemsg_rfc5424(const char *from, int pri, char *msg) } /* - * Trims the application name ("TAG" in RFC 3164 terminology) and - * process ID from a message if present. + * Returns the length of the application name ("TAG" in RFC 3164 + * terminology) and process ID from a message if present. */ static void -parsemsg_rfc3164_app_name_procid(char **msg, const char **app_name, -const char **procid) { - char *m, *app_name_begin, *procid_begin; +parsemsg_rfc3164_get_app_name_procid(const char *msg, size_t *app_name_length_p, +ptrdiff_t *procid_begin_offset_p, size_t *procid_length_p) +{ + const char *m, *procid_begin; size_t app_name_length, procid_length; - m = *msg; + m = msg; /* Application name. */ - app_name_begin = m; app_name_length = strspn(m, "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -1191,12 +1193,52 @@ parsemsg_rfc3164_app_name_procid(char **msg, const cha if (m[0] != ':' || m[1] != ' ') goto bad; + *app_name_length_p = app_name_length; + if (procid_begin_offset_p != NULL) + *procid_begin_offset_p = + procid_begin == NULL ? 0 : procid_begin - msg; + if (procid_length_p != NULL) + *procid_length_p = procid_length; + return; +bad: + *app_name_length_p = 0; + if (procid_begin_offset_p != NULL) + *procid_begin_offset_p = 0; + if (procid_length_p != NULL) + *procid_length_p = 0; +} + +/* + * Trims the application name ("TAG" in RFC 3164 terminology) and + * process ID from a message if present. + */ +static void +parsemsg_rfc3164_app_name_procid(char **msg, const char **app_name, +const char **procid) +{ + char *m, *app_name_begin, *procid_begin; + size_t app_name_length, procid_length; + ptrdiff_t procid_begin_offset; + + m = *msg; + app_name_begin = m; + + parsemsg_rfc3164_get_app_name_procid(app_name_begin, _name_length, + _begin_offset, _length); + if (app_name_length == 0) + goto bad; + procid_begin = procid_begin_offset == 0 ? NULL : + app_name_begin + procid_begin_offset; + /* Split strings from input. */ app_name_begin[app_name_length] = '\0'; - if (procid_begin != 0) + m += app_name_length + 1; + if (procid_begin != NULL) { procid_begin[procid_length] = '\0'; + m += procid_length + 2; + } - *msg = m + 2; + *msg = m + 1; *app_name = app_name_begin; *procid = procid_begin; return; @@ -1401,7 +1443,7 @@ printsys(char *msg) long n; int flags, isprintf, pri; - flags = SYNC_FILE; /* fsync after write */ + flags = ISKERNEL | SYNC_FILE; /* fsync after write */ p = msg; pri = DEFSPRI; isprintf = 1; @@ -1551,7 +1593,7 @@ logmsg(int pri, const struct logtime *timestamp, const struct filed *f; size_t savedlen; int fac, prilev; - char saved[MAXSVLINE]; + char saved[MAXSVLINE], kernel_app_name[100]; dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, hostname, msg); @@ -1576,6
svn commit: r360440 - in head: sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol
Author: takawata Date: Tue Apr 28 16:00:34 2020 New Revision: 360440 URL: https://svnweb.freebsd.org/changeset/base/360440 Log: Add le_read_buffer_size command and manpage. It supports both v1 and v2 command. PR:245964 Submitted by: Marc Veldman Modified: head/sys/netgraph/bluetooth/include/ng_hci.h head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/sys/netgraph/bluetooth/include/ng_hci.h == --- head/sys/netgraph/bluetooth/include/ng_hci.hTue Apr 28 15:44:39 2020(r360439) +++ head/sys/netgraph/bluetooth/include/ng_hci.hTue Apr 28 16:00:34 2020(r360440) @@ -1672,6 +1672,15 @@ typedef struct { u_int16_t connection_handle; }__attribute__ ((packed)) ng_hci_le_long_term_key_request_negative_reply_rp; +#define NG_HCI_OCF_LE_READ_BUFFER_SIZE_V2 0x0060 +/*No command parameter */ +typedef struct { + u_int8_tstatus; + u_int16_t hc_le_data_packet_length; + u_int8_thc_total_num_le_data_packets; + u_int16_t hc_iso_data_packet_length; + u_int8_thc_total_num_iso_data_packets; +} __attribute__ ((packed)) ng_hci_le_read_buffer_size_rp_v2; #define NG_HCI_OCF_LE_READ_SUPPORTED_STATES0x001c /*No command parameter*/ Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 == --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue Apr 28 15:44:39 2020(r360439) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue Apr 28 16:00:34 2020(r360440) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd April 24, 2020 +.Dd April 27, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -154,6 +154,7 @@ are: .It Cm LE_Set_Scan_Parameters .It Cm LE_Set_Scan_Enable .It Cm LE_Read_Supported_States +.It Cm LE_Read_Buffer_Size .El .Pp The currently supported node commands in Modified: head/usr.sbin/bluetooth/hccontrol/le.c == --- head/usr.sbin/bluetooth/hccontrol/le.c Tue Apr 28 15:44:39 2020 (r360439) +++ head/usr.sbin/bluetooth/hccontrol/le.c Tue Apr 28 16:00:34 2020 (r360440) @@ -554,7 +554,65 @@ le_set_advertising_data(int s, int argc, char *argv[]) return (OK); } +static int +le_read_buffer_size(int s, int argc, char *argv[]) +{ + union { + ng_hci_le_read_buffer_size_rp v1; + ng_hci_le_read_buffer_size_rp_v2v2; + } rp; + int n, ch; + uint8_t v; + uint16_t cmd; + + optreset = 1; + optind = 0; + + /* Default to version 1*/ + v = 1; + cmd = NG_HCI_OCF_LE_READ_BUFFER_SIZE; + + while ((ch = getopt(argc, argv , "v:")) != -1) { + switch(ch) { + case 'v': + v = (uint8_t)strtol(optarg, NULL, 16); + if (v == 2) + cmd = NG_HCI_OCF_LE_READ_BUFFER_SIZE_V2; + else if (v > 2) + return (USAGE); + break; + default: + v = 1; + } + } + + n = sizeof(rp); + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, cmd), + (void *), ) == ERROR) + return (ERROR); + + if (rp.v1.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.v1.status), rp.v1.status); + return (FAILED); + } + + fprintf(stdout, "ACL data packet length: %d\n", + rp.v1.hc_le_data_packet_length); + fprintf(stdout, "Number of ACL data packets: %d\n", + rp.v1.hc_total_num_le_data_packets); + + if (v == 2) { + fprintf(stdout, "ISO data packet length: %d\n", + rp.v2.hc_iso_data_packet_length); + fprintf(stdout, "Number of ISO data packets: %d\n", + rp.v2.hc_total_num_iso_data_packets); + } + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -620,5 +678,11 @@ struct hci_command le_commands[] = { "le_set_advertising_data -n $name -f $flag -u $uuid16,$uuid16 \n" "set LE device advertising packed data", _set_advertising_data + }, + { + "le_read_buffer_size", + "le_read_buffer_size [-v 1|2]\n" + "Read the maximum size of ACL and ISO data packets", + _read_buffer_size }, }; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to
svn commit: r360438 - head/sys/kern
Author: markj Date: Tue Apr 28 15:02:44 2020 New Revision: 360438 URL: https://svnweb.freebsd.org/changeset/base/360438 Log: Make sendfile(SF_SYNC)'s CV wait interruptible. Otherwise, since the CV is not signalled until data is drained from the socket, it is trivial to create an unkillable process using sendfile(SF_SYNC) and a process-private PF_LOCAL socket pair. In particular, the cv_wait() in sendfile() does not get interrupted until data is drained from the receiving socket buffer. Reported by: pho Discussed with: kib MFC after:2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c == --- head/sys/kern/kern_sendfile.c Tue Apr 28 14:33:33 2020 (r360437) +++ head/sys/kern/kern_sendfile.c Tue Apr 28 15:02:44 2020 (r360438) @@ -106,8 +106,36 @@ struct sendfile_sync { struct mtx mtx; struct cv cv; unsignedcount; + boolwaiting; }; +static void +sendfile_sync_destroy(struct sendfile_sync *sfs) +{ + KASSERT(sfs->count == 0, ("sendfile sync %p still busy", sfs)); + + cv_destroy(>cv); + mtx_destroy(>mtx); + free(sfs, M_SENDFILE); +} + +static void +sendfile_sync_signal(struct sendfile_sync *sfs) +{ + mtx_lock(>mtx); + KASSERT(sfs->count > 0, ("sendfile sync %p not busy", sfs)); + if (--sfs->count == 0) { + if (!sfs->waiting) { + /* The sendfile() waiter was interrupted by a signal. */ + sendfile_sync_destroy(sfs); + return; + } else { + cv_signal(>cv); + } + } + mtx_unlock(>mtx); +} + counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; static void @@ -153,12 +181,7 @@ sendfile_free_mext(struct mbuf *m) if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { struct sendfile_sync *sfs = m->m_ext.ext_arg2; - - mtx_lock(>mtx); - KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); - if (--sfs->count == 0) - cv_signal(>cv); - mtx_unlock(>mtx); + sendfile_sync_signal(sfs); } } @@ -186,12 +209,7 @@ sendfile_free_mext_pg(struct mbuf *m) if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { struct sendfile_sync *sfs = m->m_ext.ext_arg1; - - mtx_lock(>mtx); - KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); - if (--sfs->count == 0) - cv_signal(>cv); - mtx_unlock(>mtx); + sendfile_sync_signal(sfs); } } @@ -719,6 +737,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO); mtx_init(>mtx, "sendfile", NULL, MTX_DEF); cv_init(>cv, "sendfile"); + sfs->waiting = true; } rem = nbytes ? omin(nbytes, obj_size - offset) : obj_size - offset; @@ -1221,11 +1240,13 @@ out: if (sfs != NULL) { mtx_lock(>mtx); if (sfs->count != 0) - cv_wait(>cv, >mtx); - KASSERT(sfs->count == 0, ("sendfile sync still busy")); - cv_destroy(>cv); - mtx_destroy(>mtx); - free(sfs, M_SENDFILE); + error = cv_wait_sig(>cv, >mtx); + if (sfs->count == 0) { + sendfile_sync_destroy(sfs); + } else { + sfs->waiting = false; + mtx_unlock(>mtx); + } } #ifdef KERN_TLS if (tls != 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"
Re: svn commit: r360125 - in head/usr.bin/diff: . tests
On Tue, Apr 28, 2020 at 7:58 AM Kyle Evans wrote: > > On Tue, Apr 28, 2020 at 7:55 AM Jan Beich wrote: > > > > Gary Jennejohn writes: > > > > > On Tue, 28 Apr 2020 07:25:18 -0500 > > > Kyle Evans wrote: > > > > > >> On Tue, Apr 28, 2020 at 6:52 AM Jan Beich wrote: > > >> > > > >> > Kyle Evans writes: > > >> > > > >> > > Author: kevans > > >> > > Date: Mon Apr 20 16:14:44 2020 > > >> > > New Revision: 360125 > > >> > > URL: https://svnweb.freebsd.org/changeset/base/360125 > > >> > > > > >> > > Log: > > >> > > diff(1): reject conflicting formatting options > > >> > > > > >> > > This matches GNU diff(1) behavior and, more importantly, > > >> > > eliminates any > > >> > > source of confusion if multiple formatting options are specified. > > >> > > > > >> > > Note that the committed diff differs slightly from the submitted: > > >> > > I've > > >> > > modified it so that we initialize diff_format to something that > > >> > > isn't an > > >> > > accepted format option so that we can also reject --normal -c and > > >> > > -c > > >> > > --normal, which would've otherwise been accepted because the > > >> > > default was > > >> > > --normal. After option parsing we default it to D_NORMAL if it's > > >> > > still > > >> > > unset. > > >> > > > > >> > > PR: 243975 > > >> > > Submitted by: fehmi noyan isi > > >> > > MFC after: 1 week > > >> > > > >> > Appears to break ability to specify number of context lines e.g., > > >> > > > >> > $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h > > >> > error: conflicting output format options. > > >> > usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] > > >> > [...] > > >> > > >> Hmm, bizarre. =-\ This example works on my machine, and I don't see > > >> off-hand what would be preventing it for you: > > >> > > >> root@viper:/usr/src/usr.bin/diff# diff -U999 /usr/include/sha256.h > > >> /usr/include/sha512.h > > >> --- /usr/include/sha256.h 2020-04-22 21:38:54.0 -0500 > > >> +++ /usr/include/sha512.h 2020-04-22 21:38:54.0 -0500 > > >> @@ -1,99 +1,99 @@ > > >> /*- > > >> * Copyright 2005 Colin Percival > > >> * All rights reserved. > > >> * > > >> [... omitted ...] > > >> > > >> root@viper:/usr/src/usr.bin/diff# strings /usr/bin/diff | grep > > >> 'conflicting' > > >> error: conflicting output format options. > > >> > > > > > > My /usr/bin/diff was built and installed on April 26, after this > > > commit, and I don't see the error either. > > > > Thanks for confirming. Looks like my "diff" was aliased to "diff -up". > > Indeed, -u and -U are no longer compatible unlike GNU diff. > > Whoops, *facepalm*, you certainly shouldn't be restricted from > specifying the same output style multiple times. Will fix ASAP. > As of r360437, this is no longer an issue and the test case has been amended. Apologies for the hassle. =-) ___ 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: r360437 - in head/usr.bin/diff: . tests
Author: kevans Date: Tue Apr 28 14:33:33 2020 New Revision: 360437 URL: https://svnweb.freebsd.org/changeset/base/360437 Log: diff(1): don't reject specifying the same format multiple times This may happen, for instance, if one happens to have an alias of diff to diff -up and attempts to specify the amount of context on top of that. Aliases like this may cause other problems, but if they're really not ever generating non-unified diffs then we should at least not break that use-case. In addition, we'll now pick up a format mismatch if -p is specified with !contextual && !unified && !unset. Fix up a small trailing whitespace nit in the tests while we're here, and add tests to make sure that we can double up all the formatting options. Reported by: jbeich MFC after:3 days Modified: head/usr.bin/diff/diff.c head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/diff.c == --- head/usr.bin/diff/diff.cTue Apr 28 13:51:41 2020(r360436) +++ head/usr.bin/diff/diff.cTue Apr 28 14:33:33 2020(r360437) @@ -122,6 +122,8 @@ main(int argc, char **argv) newarg = 1; diff_context = 3; diff_format = D_UNSET; +#defineFORMAT_MISMATCHED(type) \ + (diff_format != D_UNSET && diff_format != (type)) while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) { switch (ch) { case '0': case '1': case '2': case '3': case '4': @@ -142,7 +144,7 @@ main(int argc, char **argv) break; case 'C': case 'c': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_CONTEXT)) conflicting_format(); cflag = 1; diff_format = D_CONTEXT; @@ -157,18 +159,18 @@ main(int argc, char **argv) dflags |= D_MINIMAL; break; case 'D': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_IFDEF)) conflicting_format(); diff_format = D_IFDEF; ifdefname = optarg; break; case 'e': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_EDIT)) conflicting_format(); diff_format = D_EDIT; break; case 'f': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_REVERSE)) conflicting_format(); diff_format = D_REVERSE; break; @@ -202,11 +204,20 @@ main(int argc, char **argv) Nflag = 1; break; case 'n': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_NREVERSE)) conflicting_format(); diff_format = D_NREVERSE; break; case 'p': + /* +* If it's not unset and it's not set to context or +* unified, we'll error out here as a conflicting +* format. If it's unset, we'll go ahead and set it to +* context. +*/ + if (FORMAT_MISMATCHED(D_CONTEXT) && + FORMAT_MISMATCHED(D_UNIFIED)) + conflicting_format(); if (diff_format == D_UNSET) diff_format = D_CONTEXT; dflags |= D_PROTOTYPE; @@ -218,7 +229,7 @@ main(int argc, char **argv) rflag = 1; break; case 'q': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_BRIEF)) conflicting_format(); diff_format = D_BRIEF; break; @@ -236,7 +247,7 @@ main(int argc, char **argv) break; case 'U': case 'u': - if (diff_format != D_UNSET) + if (FORMAT_MISMATCHED(D_UNIFIED)) conflicting_format(); diff_format = D_UNIFIED; if (optarg != NULL) { @@ -264,12 +275,12 @@ main(int argc, char **argv) push_excludes(optarg); break; case 'y': - if (diff_format != D_UNSET) + if
svn commit: r360436 - head/sys/vm
Author: markj Date: Tue Apr 28 13:51:41 2020 New Revision: 360436 URL: https://svnweb.freebsd.org/changeset/base/360436 Log: Re-check for wirings after busying the page in vm_page_release_locked(). A concurrent unlocked lookup can wire the page after vm_page_release_locked() releases the last wiring, in which case vm_page_release_locked() must not free the page. Once the xbusy lock is acquired, that, the object lock and the fact that the page is unmapped ensure that the wire count cannot increase, so re-check for new wirings after the page is xbusied. Update the comment above vm_page_wired() to reflect the new synchronization rules. Reported by: glebius Reviewed by: alc, jeff, kib Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D24592 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c == --- head/sys/vm/vm_page.c Tue Apr 28 13:28:58 2020(r360435) +++ head/sys/vm/vm_page.c Tue Apr 28 13:51:41 2020(r360436) @@ -4165,7 +4165,16 @@ vm_page_release_locked(vm_page_t m, int flags) if ((flags & VPR_TRYFREE) != 0 && (m->object->ref_count == 0 || !pmap_page_is_mapped(m)) && m->dirty == 0 && vm_page_tryxbusy(m)) { - vm_page_free(m); + /* +* An unlocked lookup may have wired the page before the +* busy lock was acquired, in which case the page must +* not be freed. +*/ + if (__predict_true(!vm_page_wired(m))) { + vm_page_free(m); + return; + } + vm_page_xunbusy(m); } else { vm_page_release_toq(m, PQ_INACTIVE, flags != 0); } Modified: head/sys/vm/vm_page.h == --- head/sys/vm/vm_page.h Tue Apr 28 13:28:58 2020(r360435) +++ head/sys/vm/vm_page.h Tue Apr 28 13:51:41 2020(r360436) @@ -958,8 +958,8 @@ vm_page_drop(vm_page_t m, u_int val) * * Perform a racy check to determine whether a reference prevents the page * from being reclaimable. If the page's object is locked, and the page is - * unmapped and unbusied or exclusively busied by the current thread, no - * new wirings may be created. + * unmapped and exclusively busied by the current thread, no new wirings + * may be created. */ static inline bool vm_page_wired(vm_page_t m) ___ 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: r360435 - head/usr.sbin/bluetooth/hccontrol
Author: takawata Date: Tue Apr 28 13:28:58 2020 New Revision: 360435 URL: https://svnweb.freebsd.org/changeset/base/360435 Log: Improve error handling Check return values from hci_request() Check rp.status Print error messages with hci_status2str() PR: 245769 Submitted by: Marc Veldman Modified: head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/le.c == --- head/usr.sbin/bluetooth/hccontrol/le.c Tue Apr 28 13:16:35 2020 (r360434) +++ head/usr.sbin/bluetooth/hccontrol/le.c Tue Apr 28 13:28:58 2020 (r360435) @@ -69,20 +69,20 @@ le_set_scan_param(int s, int argc, char *argv[]) int window; int adrtype; int policy; - int e, n; + int n; ng_hci_le_set_scan_parameters_cp cp; ng_hci_le_set_scan_parameters_rp rp; if (argc != 5) - return USAGE; + return (USAGE); if (strcmp(argv[0], "active") == 0) type = 1; else if (strcmp(argv[0], "passive") == 0) type = 0; else - return USAGE; + return (USAGE); interval = (int)(atof(argv[1])/0.625); interval = (interval < 4)? 4: interval; @@ -94,14 +94,14 @@ le_set_scan_param(int s, int argc, char *argv[]) else if (strcmp(argv[3], "random") == 0) adrtype = 1; else - return USAGE; + return (USAGE); if (strcmp(argv[4], "all") == 0) policy = 0; else if (strcmp(argv[4], "whitelist") == 0) policy = 1; else - return USAGE; + return (USAGE); cp.le_scan_type = type; cp.le_scan_interval = interval; @@ -109,11 +109,19 @@ le_set_scan_param(int s, int argc, char *argv[]) cp.le_scan_window = window; cp.scanning_filter_policy = policy; n = sizeof(rp); - e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), - (void *), sizeof(cp), (void *), ); + (void *), sizeof(cp), (void *), ) == ERROR) + return (ERROR); - return 0; + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); } static int @@ -121,27 +129,35 @@ le_set_scan_enable(int s, int argc, char *argv[]) { ng_hci_le_set_scan_enable_cp cp; ng_hci_le_set_scan_enable_rp rp; - int e, n, enable = 0; + int n, enable = 0; if (argc != 1) - return USAGE; + return (USAGE); if (strcmp(argv[0], "enable") == 0) enable = 1; else if (strcmp(argv[0], "disable") != 0) - return USAGE; + return (USAGE); n = sizeof(rp); cp.le_scan_enable = enable; cp.filter_duplicates = 0; - e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_SCAN_ENABLE), - (void *), sizeof(cp), (void *), ); + (void *), sizeof(cp), + (void *), ) == ERROR) + return (ERROR); - if (e != 0 || rp.status != 0) - return ERROR; + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return OK; + fprintf(stdout, "LE Scan: %s\n", + enable? "Enabled" : "Disabled"); + + return (OK); } static int @@ -197,7 +213,7 @@ parse_param(int argc, char *argv[], char *buf, int *le done: *len = curbuf - buf; - return OK; + return (OK); } static int @@ -206,7 +222,6 @@ le_set_scan_response(int s, int argc, char *argv[]) ng_hci_le_set_scan_response_data_cp cp; ng_hci_le_set_scan_response_data_rp rp; int n; - int e; int len; char buf[NG_HCI_ADVERTISING_DATA_SIZE]; @@ -216,13 +231,19 @@ le_set_scan_response(int s, int argc, char *argv[]) cp.scan_response_data_length = len; memcpy(cp.scan_response_data, buf, len); n = sizeof(rp); - e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_SCAN_RESPONSE_DATA), - (void *), sizeof(cp), (void *), ); + (void *), sizeof(cp), + (void *), ) == ERROR) + return (ERROR); - printf("SET SCAN RESPONSE %d
Re: svn commit: r360125 - in head/usr.bin/diff: . tests
On Tue, Apr 28, 2020 at 7:55 AM Jan Beich wrote: > > Gary Jennejohn writes: > > > On Tue, 28 Apr 2020 07:25:18 -0500 > > Kyle Evans wrote: > > > >> On Tue, Apr 28, 2020 at 6:52 AM Jan Beich wrote: > >> > > >> > Kyle Evans writes: > >> > > >> > > Author: kevans > >> > > Date: Mon Apr 20 16:14:44 2020 > >> > > New Revision: 360125 > >> > > URL: https://svnweb.freebsd.org/changeset/base/360125 > >> > > > >> > > Log: > >> > > diff(1): reject conflicting formatting options > >> > > > >> > > This matches GNU diff(1) behavior and, more importantly, eliminates > >> > > any > >> > > source of confusion if multiple formatting options are specified. > >> > > > >> > > Note that the committed diff differs slightly from the submitted: > >> > > I've > >> > > modified it so that we initialize diff_format to something that > >> > > isn't an > >> > > accepted format option so that we can also reject --normal -c and -c > >> > > --normal, which would've otherwise been accepted because the default > >> > > was > >> > > --normal. After option parsing we default it to D_NORMAL if it's > >> > > still > >> > > unset. > >> > > > >> > > PR: 243975 > >> > > Submitted by: fehmi noyan isi > >> > > MFC after: 1 week > >> > > >> > Appears to break ability to specify number of context lines e.g., > >> > > >> > $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h > >> > error: conflicting output format options. > >> > usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] > >> > [...] > >> > >> Hmm, bizarre. =-\ This example works on my machine, and I don't see > >> off-hand what would be preventing it for you: > >> > >> root@viper:/usr/src/usr.bin/diff# diff -U999 /usr/include/sha256.h > >> /usr/include/sha512.h > >> --- /usr/include/sha256.h 2020-04-22 21:38:54.0 -0500 > >> +++ /usr/include/sha512.h 2020-04-22 21:38:54.0 -0500 > >> @@ -1,99 +1,99 @@ > >> /*- > >> * Copyright 2005 Colin Percival > >> * All rights reserved. > >> * > >> [... omitted ...] > >> > >> root@viper:/usr/src/usr.bin/diff# strings /usr/bin/diff | grep > >> 'conflicting' > >> error: conflicting output format options. > >> > > > > My /usr/bin/diff was built and installed on April 26, after this > > commit, and I don't see the error either. > > Thanks for confirming. Looks like my "diff" was aliased to "diff -up". > Indeed, -u and -U are no longer compatible unlike GNU diff. Whoops, *facepalm*, you certainly shouldn't be restricted from specifying the same output style multiple times. Will fix ASAP. Thanks, Kyle Evans ___ 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: r360125 - in head/usr.bin/diff: . tests
Gary Jennejohn writes: > On Tue, 28 Apr 2020 07:25:18 -0500 > Kyle Evans wrote: > >> On Tue, Apr 28, 2020 at 6:52 AM Jan Beich wrote: >> > >> > Kyle Evans writes: >> > >> > > Author: kevans >> > > Date: Mon Apr 20 16:14:44 2020 >> > > New Revision: 360125 >> > > URL: https://svnweb.freebsd.org/changeset/base/360125 >> > > >> > > Log: >> > > diff(1): reject conflicting formatting options >> > > >> > > This matches GNU diff(1) behavior and, more importantly, eliminates any >> > > source of confusion if multiple formatting options are specified. >> > > >> > > Note that the committed diff differs slightly from the submitted: I've >> > > modified it so that we initialize diff_format to something that isn't >> > > an >> > > accepted format option so that we can also reject --normal -c and -c >> > > --normal, which would've otherwise been accepted because the default >> > > was >> > > --normal. After option parsing we default it to D_NORMAL if it's still >> > > unset. >> > > >> > > PR: 243975 >> > > Submitted by: fehmi noyan isi >> > > MFC after: 1 week >> > >> > Appears to break ability to specify number of context lines e.g., >> > >> > $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h >> > error: conflicting output format options. >> > usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] >> > [...] >> >> Hmm, bizarre. =-\ This example works on my machine, and I don't see >> off-hand what would be preventing it for you: >> >> root@viper:/usr/src/usr.bin/diff# diff -U999 /usr/include/sha256.h >> /usr/include/sha512.h >> --- /usr/include/sha256.h 2020-04-22 21:38:54.0 -0500 >> +++ /usr/include/sha512.h 2020-04-22 21:38:54.0 -0500 >> @@ -1,99 +1,99 @@ >> /*- >> * Copyright 2005 Colin Percival >> * All rights reserved. >> * >> [... omitted ...] >> >> root@viper:/usr/src/usr.bin/diff# strings /usr/bin/diff | grep 'conflicting' >> error: conflicting output format options. >> > > My /usr/bin/diff was built and installed on April 26, after this > commit, and I don't see the error either. Thanks for confirming. Looks like my "diff" was aliased to "diff -up". Indeed, -u and -U are no longer compatible unlike GNU diff. ___ 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: r360125 - in head/usr.bin/diff: . tests
On Tue, 28 Apr 2020 07:25:18 -0500 Kyle Evans wrote: > On Tue, Apr 28, 2020 at 6:52 AM Jan Beich wrote: > > > > Kyle Evans writes: > > > > > Author: kevans > > > Date: Mon Apr 20 16:14:44 2020 > > > New Revision: 360125 > > > URL: https://svnweb.freebsd.org/changeset/base/360125 > > > > > > Log: > > > diff(1): reject conflicting formatting options > > > > > > This matches GNU diff(1) behavior and, more importantly, eliminates any > > > source of confusion if multiple formatting options are specified. > > > > > > Note that the committed diff differs slightly from the submitted: I've > > > modified it so that we initialize diff_format to something that isn't an > > > accepted format option so that we can also reject --normal -c and -c > > > --normal, which would've otherwise been accepted because the default was > > > --normal. After option parsing we default it to D_NORMAL if it's still > > > unset. > > > > > > PR: 243975 > > > Submitted by: fehmi noyan isi > > > MFC after: 1 week > > > > Appears to break ability to specify number of context lines e.g., > > > > $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h > > error: conflicting output format options. > > usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] > > [...] > > Hmm, bizarre. =-\ This example works on my machine, and I don't see > off-hand what would be preventing it for you: > > root@viper:/usr/src/usr.bin/diff# diff -U999 /usr/include/sha256.h > /usr/include/sha512.h > --- /usr/include/sha256.h 2020-04-22 21:38:54.0 -0500 > +++ /usr/include/sha512.h 2020-04-22 21:38:54.0 -0500 > @@ -1,99 +1,99 @@ > /*- > * Copyright 2005 Colin Percival > * All rights reserved. > * > [... omitted ...] > > root@viper:/usr/src/usr.bin/diff# strings /usr/bin/diff | grep 'conflicting' > error: conflicting output format options. > My /usr/bin/diff was built and installed on April 26, after this commit, and I don't see the error either. -- Gary Jennejohn ___ 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: r360125 - in head/usr.bin/diff: . tests
On Tue, Apr 28, 2020 at 6:52 AM Jan Beich wrote: > > Kyle Evans writes: > > > Author: kevans > > Date: Mon Apr 20 16:14:44 2020 > > New Revision: 360125 > > URL: https://svnweb.freebsd.org/changeset/base/360125 > > > > Log: > > diff(1): reject conflicting formatting options > > > > This matches GNU diff(1) behavior and, more importantly, eliminates any > > source of confusion if multiple formatting options are specified. > > > > Note that the committed diff differs slightly from the submitted: I've > > modified it so that we initialize diff_format to something that isn't an > > accepted format option so that we can also reject --normal -c and -c > > --normal, which would've otherwise been accepted because the default was > > --normal. After option parsing we default it to D_NORMAL if it's still > > unset. > > > > PR: 243975 > > Submitted by: fehmi noyan isi > > MFC after: 1 week > > Appears to break ability to specify number of context lines e.g., > > $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h > error: conflicting output format options. > usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] > [...] Hmm, bizarre. =-\ This example works on my machine, and I don't see off-hand what would be preventing it for you: root@viper:/usr/src/usr.bin/diff# diff -U999 /usr/include/sha256.h /usr/include/sha512.h --- /usr/include/sha256.h 2020-04-22 21:38:54.0 -0500 +++ /usr/include/sha512.h 2020-04-22 21:38:54.0 -0500 @@ -1,99 +1,99 @@ /*- * Copyright 2005 Colin Percival * All rights reserved. * [... omitted ...] root@viper:/usr/src/usr.bin/diff# strings /usr/bin/diff | grep 'conflicting' error: conflicting output format options. Thanks, Kyle Evans ___ 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: r360125 - in head/usr.bin/diff: . tests
Kyle Evans writes: > Author: kevans > Date: Mon Apr 20 16:14:44 2020 > New Revision: 360125 > URL: https://svnweb.freebsd.org/changeset/base/360125 > > Log: > diff(1): reject conflicting formatting options > > This matches GNU diff(1) behavior and, more importantly, eliminates any > source of confusion if multiple formatting options are specified. > > Note that the committed diff differs slightly from the submitted: I've > modified it so that we initialize diff_format to something that isn't an > accepted format option so that we can also reject --normal -c and -c > --normal, which would've otherwise been accepted because the default was > --normal. After option parsing we default it to D_NORMAL if it's still > unset. > > PR: 243975 > Submitted by: fehmi noyan isi > MFC after: 1 week Appears to break ability to specify number of context lines e.g., $ diff -U999 /usr/include/sha256.h /usr/include/sha512.h error: conflicting output format options. usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case] [...] ___ 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: r360431 - in head/sys: net netinet
Author: melifaro Date: Tue Apr 28 08:06:56 2020 New Revision: 360431 URL: https://svnweb.freebsd.org/changeset/base/360431 Log: Convert rtalloc_mpath_fib() users to the new KPI. New fib[46]_lookup() functions support multipath transparently. Given that, switch the last rtalloc_mpath_fib() calls to dib4_lookup() and eliminate the function itself. Note: proper flowid generation (especially for the outbound traffic) is a bigger topic and will be handled in a separate review. This change leaves flowid generation intact. Differential Revision:https://reviews.freebsd.org/D24595 Modified: head/sys/net/radix_mpath.c head/sys/net/radix_mpath.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c Modified: head/sys/net/radix_mpath.c == --- head/sys/net/radix_mpath.c Tue Apr 28 07:25:34 2020(r360430) +++ head/sys/net/radix_mpath.c Tue Apr 28 08:06:56 2020(r360431) @@ -257,46 +257,6 @@ rt_mpath_select(struct rtentry *rte, uint32_t hash) } void -rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) -{ - struct rtentry *rt, *rt_tmp; - - /* -* XXX we don't attempt to lookup cached route again; what should -* be done for sendto(3) case? -*/ - if (ro->ro_nh && RT_LINK_IS_UP(ro->ro_nh->nh_ifp)) - return; - ro->ro_nh = NULL; - rt_tmp = rtalloc1_fib(>ro_dst, 1, 0, fibnum); - - /* if the route does not exist or it is not multipath, don't care */ - if (rt_tmp == NULL) - return; - if (rn_mpath_next((struct radix_node *)rt_tmp) == NULL) { - ro->ro_nh = rt_tmp->rt_nhop; - nhop_ref_object(ro->ro_nh); - RT_UNLOCK(rt_tmp); - return; - } - - rt = rt_mpath_selectrte(rt_tmp, hash); - /* XXX try filling rt_gwroute and avoid unreachable gw */ - - /* gw selection has failed - there must be only zero weight routes */ - if (!rt) { - RT_UNLOCK(rt_tmp); - return; - } - if (rt_tmp != rt) { - RTFREE_LOCKED(rt_tmp); - ro->ro_nh = rt->rt_nhop; - nhop_ref_object(ro->ro_nh); - } else - RT_UNLOCK(rt_tmp); -} - -void rt_mpath_init_rnh(struct rib_head *rnh) { Modified: head/sys/net/radix_mpath.h == --- head/sys/net/radix_mpath.h Tue Apr 28 07:25:34 2020(r360430) +++ head/sys/net/radix_mpath.h Tue Apr 28 08:06:56 2020(r360431) @@ -54,7 +54,6 @@ u_int32_t rn_mpath_count(struct radix_node *); struct rtentry *rt_mpath_matchgate(struct rtentry *, struct sockaddr *); int rt_mpath_conflict(struct rib_head *, struct rtentry *, struct sockaddr *); -void rtalloc_mpath_fib(struct route *, u_int32_t, u_int); struct rtentry *rt_mpath_select(struct rtentry *, uint32_t); struct rtentry *rt_mpath_selectrte(struct rtentry *, uint32_t); int rt_mpath_deldup(struct rtentry *, struct rtentry *); Modified: head/sys/netinet/ip_input.c == --- head/sys/netinet/ip_input.c Tue Apr 28 07:25:34 2020(r360430) +++ head/sys/netinet/ip_input.c Tue Apr 28 08:06:56 2020(r360431) @@ -954,6 +954,7 @@ ip_forward(struct mbuf *m, int srcrt) struct sockaddr_in *sin; struct in_addr dest; struct route ro; + uint32_t flowid; int error, type = 0, code = 0, mtu = 0; NET_EPOCH_ASSERT(); @@ -978,13 +979,11 @@ ip_forward(struct mbuf *m, int srcrt) sin->sin_len = sizeof(*sin); sin->sin_addr = ip->ip_dst; #ifdef RADIX_MPATH - rtalloc_mpath_fib(, - ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), - M_GETFIB(m)); + flowid = ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr); #else - ro.ro_nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_REF, - m->m_pkthdr.flowid); + flowid = m->m_pkthdr.flowid; #endif + ro.ro_nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_REF, flowid); if (ro.ro_nh != NULL) { ia = ifatoia(ro.ro_nh->nh_ifa); } else Modified: head/sys/netinet/ip_output.c == --- head/sys/netinet/ip_output.cTue Apr 28 07:25:34 2020 (r360430) +++ head/sys/netinet/ip_output.cTue Apr 28 08:06:56 2020 (r360431) @@ -68,9 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef RADIX_MPATH -#include -#endif #include #include @@ -470,14 +467,15 @@ again: * layer, as this is probably required in all cases * for correct operation (as it is for ARP). */ + uint32_t flowid; #ifdef
svn commit: r360430 - in head/sys: net netinet netinet6
Author: melifaro Date: Tue Apr 28 07:25:34 2020 New Revision: 360430 URL: https://svnweb.freebsd.org/changeset/base/360430 Log: Eliminate now-unused parts of old routing KPI. r360292 switched most of the remaining routing customers to a new KPI, leaving a bunch of wrappers for old routing lookup functions unused. Remove them from the tree as a part of routing cleanup. Differential Revision:https://reviews.freebsd.org/D24569 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h Modified: head/sys/net/route.c == --- head/sys/net/route.cTue Apr 28 07:23:41 2020(r360429) +++ head/sys/net/route.cTue Apr 28 07:25:34 2020(r360430) @@ -434,28 +434,6 @@ sys_setfib(struct thread *td, struct setfib_args *uap) } /* - * Packet routing routines. - */ -void -rtalloc_ign_fib(struct route *ro, u_long ignore, u_int fibnum) -{ - struct rtentry *rt; - - if (ro->ro_nh != NULL) { - if (NH_IS_VALID(ro->ro_nh)) - return; - NH_FREE(ro->ro_nh); - ro->ro_nh = NULL; - } - rt = rtalloc1_fib(>ro_dst, 1, ignore, fibnum); - if (rt != NULL) { - ro->ro_nh = rt->rt_nhop; - nhop_ref_object(rt->rt_nhop); - RT_UNLOCK(rt); - } -} - -/* * Look up the route that matches the address given * Or, at least try.. Create a cloned route if needed. * Modified: head/sys/net/route.h == --- head/sys/net/route.hTue Apr 28 07:23:41 2020(r360429) +++ head/sys/net/route.hTue Apr 28 07:25:34 2020(r360430) @@ -503,7 +503,6 @@ int rtinit(struct ifaddr *, int, int); * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. */ -voidrtalloc_ign_fib(struct route *ro, u_long ignflags, u_int fibnum); struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); int rtrequest_fib(int, struct sockaddr *, Modified: head/sys/netinet/in_rmx.c == --- head/sys/netinet/in_rmx.c Tue Apr 28 07:23:41 2020(r360429) +++ head/sys/netinet/in_rmx.c Tue Apr 28 07:25:34 2020(r360430) @@ -257,14 +257,3 @@ in_ifadown(struct ifaddr *ifa, int delete) ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */ } -/* - * inet versions of rt functions. These have fib extensions and - * for now will just reference the _fib variants. - * eventually this order will be reversed, - */ -void -in_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum) -{ - rtalloc_ign_fib(ro, ignflags, fibnum); -} - Modified: head/sys/netinet/in_var.h == --- head/sys/netinet/in_var.h Tue Apr 28 07:23:41 2020(r360429) +++ head/sys/netinet/in_var.h Tue Apr 28 07:25:34 2020(r360430) @@ -471,9 +471,6 @@ struct mbuf*ip_tryforward(struct mbuf *); void *in_domifattach(struct ifnet *); void in_domifdetach(struct ifnet *, void *); - -/* XXX */ -voidin_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum); #endif /* _KERNEL */ /* INET6 stuff */ Modified: head/sys/netinet6/in6_rmx.c == --- head/sys/netinet6/in6_rmx.c Tue Apr 28 07:23:41 2020(r360429) +++ head/sys/netinet6/in6_rmx.c Tue Apr 28 07:25:34 2020(r360430) @@ -239,23 +239,3 @@ in6_rtrequest(int req, struct sockaddr *dst, struct so return (rtrequest_fib(req, dst, gw, mask, flags, ret_nrt, fibnum)); } -void -in6_rtalloc(struct route_in6 *ro, u_int fibnum) -{ - - rtalloc_ign_fib((struct route *)ro, 0ul, fibnum); -} - -void -in6_rtalloc_ign(struct route_in6 *ro, u_long ignflags, u_int fibnum) -{ - - rtalloc_ign_fib((struct route *)ro, ignflags, fibnum); -} - -struct rtentry * -in6_rtalloc1(struct sockaddr *dst, int report, u_long ignflags, u_int fibnum) -{ - - return (rtalloc1_fib(dst, report, ignflags, fibnum)); -} Modified: head/sys/netinet6/in6_var.h == --- head/sys/netinet6/in6_var.h Tue Apr 28 07:23:41 2020(r360429) +++ head/sys/netinet6/in6_var.h Tue Apr 28 07:25:34 2020(r360430) @@ -917,9 +917,6 @@ voidin6_newaddrmsg(struct in6_ifaddr *, int); struct mbuf *ip6_tryforward(struct mbuf *); intin6_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); -void in6_rtalloc(struct route_in6 *, u_int); -void
svn commit: r360429 - head/sys/nfs
Author: melifaro Date: Tue Apr 28 07:23:41 2020 New Revision: 360429 URL: https://svnweb.freebsd.org/changeset/base/360429 Log: Remove rtable dumping code from bootp. This debugging code printing routing table data was introduced in rS25723, 22+ years ago. The last functional commit to this code was rS67534, 19 years ago. The code has been turned off by default all this time. Lastly, this code directly iterates radix tree and rtentries, which is not not a proper interaction with routing system. Differential Revision:https://reviews.freebsd.org/D24554 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c == --- head/sys/nfs/bootp_subr.c Tue Apr 28 05:10:34 2020(r360428) +++ head/sys/nfs/bootp_subr.c Tue Apr 28 07:23:41 2020(r360429) @@ -68,9 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef BOOTP_DEBUG -#include -#endif #include #include @@ -263,10 +260,6 @@ static void bootpc_tag_helper(struct bootpc_tagcontext unsigned char *start, int len, int tag); #ifdef BOOTP_DEBUG -void bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma); -void bootpboot_p_rtentry(struct rtentry *rt); -void bootpboot_p_tree(struct radix_node *rn); -void bootpboot_p_rtlist(void); void bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa); void bootpboot_p_iflist(void); #endif @@ -299,95 +292,6 @@ static __inline int bootpc_ifctx_isfailed(struct bootp */ #ifdef BOOTP_DEBUG -void -bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma) -{ - - if (sa == NULL) { - printf("(sockaddr *) "); - return; - } - switch (sa->sa_family) { - case AF_INET: - { - struct sockaddr_in *sin; - - sin = (struct sockaddr_in *) sa; - printf("inet "); - print_sin_addr(sin); - if (ma != NULL) { - sin = (struct sockaddr_in *) ma; - printf(" mask "); - print_sin_addr(sin); - } - } - break; - case AF_LINK: - { - struct sockaddr_dl *sli; - int i; - - sli = (struct sockaddr_dl *) sa; - printf("link %.*s ", sli->sdl_nlen, sli->sdl_data); - for (i = 0; i < sli->sdl_alen; i++) { - if (i > 0) - printf(":"); - printf("%x", ((unsigned char *) LLADDR(sli))[i]); - } - } - break; - default: - printf("af%d", sa->sa_family); - } -} - -void -bootpboot_p_rtentry(struct rtentry *rt) -{ - - bootpboot_p_sa(rt_key(rt), rt_mask(rt)); - printf(" "); - bootpboot_p_sa(rt->rt_gateway, NULL); - printf(" "); - printf("flags %x", (unsigned short) rt->rt_flags); - printf(" %d", (int) rt->rt_expire); - printf(" %s\n", rt->rt_ifp->if_xname); -} - -void -bootpboot_p_tree(struct radix_node *rn) -{ - - while (rn != NULL) { - if (rn->rn_bit < 0) { - if ((rn->rn_flags & RNF_ROOT) != 0) { - } else { - bootpboot_p_rtentry((struct rtentry *) rn); - } - rn = rn->rn_dupedkey; - } else { - bootpboot_p_tree(rn->rn_left); - bootpboot_p_tree(rn->rn_right); - return; - } - } -} - -void -bootpboot_p_rtlist(void) -{ - RIB_RLOCK_TRACKER; - struct rib_head *rnh; - - printf("Routing table:\n"); - rnh = rt_tables_get_rnh(0, AF_INET); - if (rnh == NULL) - return; - RIB_RLOCK(rnh); /* could sleep XXX */ - bootpboot_p_tree(rnh->rnh_treetop); - RIB_RUNLOCK(rnh); -} - void bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa) { ___ 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"