CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Thu Apr 7 04:04:47 UTC 2016 Modified Files: src/sys/net: route.c Log Message: remove useless cast. To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/net/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.159 src/sys/net/route.c:1.160 --- src/sys/net/route.c:1.159 Wed Apr 6 23:09:56 2016 +++ src/sys/net/route.c Thu Apr 7 00:04:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.159 2016/04/07 03:09:56 christos Exp $ */ +/* $NetBSD: route.c,v 1.160 2016/04/07 04:04:47 christos Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.159 2016/04/07 03:09:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.160 2016/04/07 04:04:47 christos Exp $"); #include #ifdef RTFLUSH_DEBUG @@ -413,7 +413,7 @@ miss: if (report) { struct rt_addrinfo info; - memset((void *), 0, sizeof(info)); + memset(, 0, sizeof(info)); info.rti_info[RTAX_DST] = dst; rt_missmsg(RTM_MISS, , 0, 0); }
CVS commit: src/sys
Module Name:src Committed By: christos Date: Thu Apr 7 03:31:12 UTC 2016 Modified Files: src/sys/kern: exec_subr.c kern_pax.c src/sys/sys: pax.h src/sys/uvm: uvm_mmap.c uvm_unix.c Log Message: Add PAX_MPROTECT_DEBUG To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/kern/exec_subr.c cvs rdiff -u -r1.37 -r1.38 src/sys/kern/kern_pax.c cvs rdiff -u -r1.18 -r1.19 src/sys/sys/pax.h cvs rdiff -u -r1.154 -r1.155 src/sys/uvm/uvm_mmap.c cvs rdiff -u -r1.45 -r1.46 src/sys/uvm/uvm_unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/exec_subr.c diff -u src/sys/kern/exec_subr.c:1.72 src/sys/kern/exec_subr.c:1.73 --- src/sys/kern/exec_subr.c:1.72 Sat Sep 26 12:12:24 2015 +++ src/sys/kern/exec_subr.c Wed Apr 6 23:31:12 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_subr.c,v 1.72 2015/09/26 16:12:24 maxv Exp $ */ +/* $NetBSD: exec_subr.c,v 1.73 2016/04/07 03:31:12 christos Exp $ */ /* * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.72 2015/09/26 16:12:24 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.73 2016/04/07 03:31:12 christos Exp $"); #include "opt_pax.h" @@ -184,9 +184,7 @@ vmcmd_map_pagedvn(struct lwp *l, struct prot = cmd->ev_prot; maxprot = UVM_PROT_ALL; -#ifdef PAX_MPROTECT - pax_mprotect(l, , ); -#endif /* PAX_MPROTECT */ + PAX_MPROTECT_ADJUST(l, , ); /* * check the file system's opinion about mmapping the file @@ -266,9 +264,7 @@ vmcmd_readvn(struct lwp *l, struct exec_ prot = cmd->ev_prot; maxprot = VM_PROT_ALL; -#ifdef PAX_MPROTECT - pax_mprotect(l, , ); -#endif /* PAX_MPROTECT */ + PAX_MPROTECT_ADJUST(l, , ); #ifdef PMAP_NEED_PROCWR /* @@ -326,9 +322,7 @@ vmcmd_map_zero(struct lwp *l, struct exe prot = cmd->ev_prot; maxprot = UVM_PROT_ALL; -#ifdef PAX_MPROTECT - pax_mprotect(l, , ); -#endif /* PAX_MPROTECT */ + PAX_MPROTECT_ADJUST(l, , ); error = uvm_map(>p_vmspace->vm_map, >ev_addr, round_page(cmd->ev_len), NULL, UVM_UNKNOWN_OFFSET, 0, Index: src/sys/kern/kern_pax.c diff -u src/sys/kern/kern_pax.c:1.37 src/sys/kern/kern_pax.c:1.38 --- src/sys/kern/kern_pax.c:1.37 Mon Apr 4 12:47:39 2016 +++ src/sys/kern/kern_pax.c Wed Apr 6 23:31:12 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_pax.c,v 1.37 2016/04/04 16:47:39 christos Exp $ */ +/* $NetBSD: kern_pax.c,v 1.38 2016/04/07 03:31:12 christos Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.37 2016/04/04 16:47:39 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.38 2016/04/07 03:31:12 christos Exp $"); #include "opt_pax.h" @@ -114,6 +114,9 @@ static int pax_mprotect_enabled = 1; static int pax_mprotect_global = PAX_MPROTECT; static bool pax_mprotect_elf_flags_active(uint32_t); #endif /* PAX_MPROTECT */ +#ifdef PAX_MPROTECT_DEBUG +int pax_mprotect_debug; +#endif #ifdef PAX_SEGVGUARD #ifndef PAX_SEGVGUARD_EXPIRY @@ -189,6 +192,14 @@ SYSCTL_SETUP(sysctl_security_pax_setup, "all processes."), NULL, 0, _mprotect_global, 0, CTL_CREATE, CTL_EOL); +#ifdef PAX_MPROTECT_DEBUG + sysctl_createv(clog, 0, , NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, "debug", + SYSCTL_DESCR("print mprotect changes."), + NULL, 0, _mprotect_debug, 0, + CTL_CREATE, CTL_EOL); +#endif #endif /* PAX_MPROTECT */ #ifdef PAX_SEGVGUARD @@ -354,7 +365,11 @@ pax_mprotect_elf_flags_active(uint32_t f } void -pax_mprotect(struct lwp *l, vm_prot_t *prot, vm_prot_t *maxprot) +pax_mprotect_adjust( +#ifdef PAX_MPROTECT_DEBUG +const char *file, size_t line, +#endif +struct lwp *l, vm_prot_t *prot, vm_prot_t *maxprot) { uint32_t flags; @@ -363,18 +378,24 @@ pax_mprotect(struct lwp *l, vm_prot_t *p return; if ((*prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)) != VM_PROT_EXECUTE) { -#ifdef DIAGNOSTIC +#ifdef PAX_MPROTECT_DEBUG struct proc *p = l->l_proc; - printf("%s: %d.%d (%s): clearing execute bit\n", __func__, - p->p_pid, l->l_lid, p->p_comm); + if (pax_mprotect_debug) { + printf("%s: %s,%zu: %d.%d (%s): -x\n", + __func__, file, line, + p->p_pid, l->l_lid, p->p_comm); + } #endif *prot &= ~VM_PROT_EXECUTE; *maxprot &= ~VM_PROT_EXECUTE; } else { -#ifdef DIAGNOSTIC +#ifdef PAX_MPROTECT_DEBUG struct proc *p = l->l_proc; - printf("%s: %d.%d (%s): clearing write bit\n", __func__, - p->p_pid, l->l_lid, p->p_comm); + if (pax_mprotect_debug) { + printf("%s: %s,%zu: %d.%d (%s): -w\n", + __func__, file, line, + p->p_pid, l->l_lid, p->p_comm); + } #endif *prot &= ~VM_PROT_WRITE; *maxprot &= ~VM_PROT_WRITE; Index: src/sys/sys/pax.h diff -u src/sys/sys/pax.h:1.18 src/sys/sys/pax.h:1.19 --- src/sys/sys/pax.h:1.18 Sun Mar 20
CVS commit: src/sys
Module Name:src Committed By: christos Date: Thu Apr 7 03:22:15 UTC 2016 Modified Files: src/sys/net: if_arcsubr.c if_ecosubr.c if_ethersubr.c if_fddisubr.c if_ieee1394subr.c if_tokensubr.c src/sys/netinet: if_arp.c if_inarp.h Log Message: - tidy up error messages - add a length argument to arpresolve() - add KASSERT for overflow To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/net/if_arcsubr.c cvs rdiff -u -r1.44 -r1.45 src/sys/net/if_ecosubr.c cvs rdiff -u -r1.216 -r1.217 src/sys/net/if_ethersubr.c cvs rdiff -u -r1.96 -r1.97 src/sys/net/if_fddisubr.c cvs rdiff -u -r1.51 -r1.52 src/sys/net/if_ieee1394subr.c cvs rdiff -u -r1.73 -r1.74 src/sys/net/if_tokensubr.c cvs rdiff -u -r1.204 -r1.205 src/sys/netinet/if_arp.c cvs rdiff -u -r1.47 -r1.48 src/sys/netinet/if_inarp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if_arcsubr.c diff -u src/sys/net/if_arcsubr.c:1.70 src/sys/net/if_arcsubr.c:1.71 --- src/sys/net/if_arcsubr.c:1.70 Tue Feb 9 09:43:16 2016 +++ src/sys/net/if_arcsubr.c Wed Apr 6 23:22:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_arcsubr.c,v 1.70 2016/02/09 14:43:16 ozaki-r Exp $ */ +/* $NetBSD: if_arcsubr.c,v 1.71 2016/04/07 03:22:15 christos Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.70 2016/02/09 14:43:16 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.71 2016/04/07 03:22:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -151,7 +151,8 @@ arc_output(struct ifnet *ifp, struct mbu adst = arcbroadcastaddr; /* ARCnet broadcast address */ else if (ifp->if_flags & IFF_NOARP) adst = ntohl(satocsin(dst)->sin_addr.s_addr) & 0xFF; - else if ((error = arpresolve(ifp, rt, m, dst, )) != 0) + else if ((error = arpresolve(ifp, rt, m, dst, , + sizeof(adst))) != 0) return error == EWOULDBLOCK ? 0 : error; /* If broadcasting on a simplex interface, loopback a copy */ Index: src/sys/net/if_ecosubr.c diff -u src/sys/net/if_ecosubr.c:1.44 src/sys/net/if_ecosubr.c:1.45 --- src/sys/net/if_ecosubr.c:1.44 Mon Aug 24 18:21:26 2015 +++ src/sys/net/if_ecosubr.c Wed Apr 6 23:22:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ecosubr.c,v 1.44 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: if_ecosubr.c,v 1.45 2016/04/07 03:22:15 christos Exp $ */ /*- * Copyright (c) 2001 Ben Harris @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.44 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.45 2016/04/07 03:22:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -198,7 +198,8 @@ eco_output(struct ifnet *ifp, struct mbu memcpy(ehdr.eco_dhost, eco_broadcastaddr, ECO_ADDR_LEN); - else if (!arpresolve(ifp, rt, m, dst, ehdr.eco_dhost)) + else if (!arpresolve(ifp, rt, m, dst, ehdr.eco_dhost, + sizeof(ehdr.eco_dhost))) return (0); /* if not yet resolved */ /* If broadcasting on a simplex interface, loopback a copy */ if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)) Index: src/sys/net/if_ethersubr.c diff -u src/sys/net/if_ethersubr.c:1.216 src/sys/net/if_ethersubr.c:1.217 --- src/sys/net/if_ethersubr.c:1.216 Tue Feb 9 03:32:12 2016 +++ src/sys/net/if_ethersubr.c Wed Apr 6 23:22:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.216 2016/02/09 08:32:12 ozaki-r Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.217 2016/04/07 03:22:15 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.216 2016/02/09 08:32:12 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.217 2016/04/07 03:22:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -243,7 +243,8 @@ ether_output(struct ifnet * const ifp0, (void)memcpy(edst, etherbroadcastaddr, sizeof(edst)); else if (m->m_flags & M_MCAST) ETHER_MAP_IP_MULTICAST((dst)->sin_addr, edst); - else if ((error = arpresolve(ifp, rt, m, dst, edst)) != 0) + else if ((error = arpresolve(ifp, rt, m, dst, edst, + sizeof(edst))) != 0) return error == EWOULDBLOCK ? 0 : error; /* If broadcasting on a simplex interface, loopback a copy */ if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)) Index: src/sys/net/if_fddisubr.c diff -u src/sys/net/if_fddisubr.c:1.96 src/sys/net/if_fddisubr.c:1.97 --- src/sys/net/if_fddisubr.c:1.96 Tue Feb 9 03:32:12 2016 +++ src/sys/net/if_fddisubr.c Wed Apr 6 23:22:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_fddisubr.c,v 1.96 2016/02/09 08:32:12 ozaki-r Exp $ */ +/* $NetBSD: if_fddisubr.c,v 1.97 2016/04/07 03:22:15 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD:
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Thu Apr 7 03:09:56 UTC 2016 Modified Files: src/sys/net: route.c Log Message: Don't create an RTM_MISS message for every route allocation. GC unused code and variables. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/net/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.158 src/sys/net/route.c:1.159 --- src/sys/net/route.c:1.158 Mon Apr 4 03:37:07 2016 +++ src/sys/net/route.c Wed Apr 6 23:09:56 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.158 2016/04/04 07:37:07 ozaki-r Exp $ */ +/* $NetBSD: route.c,v 1.159 2016/04/07 03:09:56 christos Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.158 2016/04/04 07:37:07 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.159 2016/04/07 03:09:56 christos Exp $"); #include #ifdef RTFLUSH_DEBUG @@ -393,33 +393,32 @@ rtalloc1(const struct sockaddr *dst, int { rtbl_t *rtbl; struct rtentry *rt; - struct rtentry *newrt = NULL; - struct rt_addrinfo info; - int s = splsoftnet(), err = 0, msgtype = RTM_MISS; + int s; + s = splsoftnet(); rtbl = rt_gettable(dst->sa_family); - if (rtbl == NULL) { - rtstat.rts_unreach++; + if (rtbl == NULL) goto miss; - } rt = rt_matchaddr(rtbl, dst); - if (rt == NULL) { - rtstat.rts_unreach++; + if (rt == NULL) goto miss; - } + rt->rt_refcnt++; - newrt = rt; + splx(s); + return rt; miss: + rtstat.rts_unreach++; if (report) { + struct rt_addrinfo info; + memset((void *), 0, sizeof(info)); info.rti_info[RTAX_DST] = dst; - rt_missmsg(msgtype, , 0, err); + rt_missmsg(RTM_MISS, , 0, 0); } - splx(s); - return newrt; + return NULL; } #ifdef DEBUG
CVS commit: src/sys/arch/mips/ingenic
Module Name:src Committed By: macallan Date: Thu Apr 7 01:00:05 UTC 2016 Modified Files: src/sys/arch/mips/ingenic: ingenic_regs.h Added Files: src/sys/arch/mips/ingenic: jzfb_regs.h Log Message: moar registers, less tpyos To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/ingenic/ingenic_regs.h cvs rdiff -u -r0 -r1.1 src/sys/arch/mips/ingenic/jzfb_regs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/ingenic/ingenic_regs.h diff -u src/sys/arch/mips/ingenic/ingenic_regs.h:1.22 src/sys/arch/mips/ingenic/ingenic_regs.h:1.23 --- src/sys/arch/mips/ingenic/ingenic_regs.h:1.22 Thu Oct 8 17:54:30 2015 +++ src/sys/arch/mips/ingenic/ingenic_regs.h Thu Apr 7 01:00:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ingenic_regs.h,v 1.22 2015/10/08 17:54:30 macallan Exp $ */ +/* $NetBSD: ingenic_regs.h,v 1.23 2016/04/07 01:00:05 macallan Exp $ */ /*- * Copyright (c) 2014 Michael Lorenz @@ -162,17 +162,25 @@ MFC0(uint32_t r, uint32_t s) #define REIM_MIRQ1_M 0x2 /* allow mailbox IRQ for core 1 */ #define REIM_IRQ0_M 0x00100 /* allow peripheral IRQ for core 0 */ #define REIM_IRQ1_M 0x00200 /* allow peripheral IRQ for core 1 */ -#define REIM_ENTRY_M 0x /* reset exception entry if RPCn=1 */ +#define REIM_ENTRY_M 0xf000 /* reset exception entry if RPCn=1 */ #define CP0_CORE_MBOX 20 /* select 0 for core 0, 1 for 1 */ +#define CP0_CORE0_MBOX _(20), 0 +#define CP0_CORE1_MBOX _(20), 1 + + + /* power management */ #define JZ_CPCCR 0x1000 /* Clock Control Register */ #define JZ_PDIV_M 0x000f /* PCLK divider mask */ #define JZ_PDIV_S 16 /* PCLK divider shift */ #define JZ_CDIV_M 0x000f /* CPU clock divider mask */ #define JZ_CDIV_S 0 /* CPU clock divider shift */ -#define JZ_CPMPCR 0x0014 /* MPLL */ +#define JZ_LPCR 0x1004 /* Low Power Control Register */ + #define JZ_PD_SCPU 0x8000 /* power down 2nd CPU */ + #define JZ_SCPUS 0x0800 /* CPU is powered down */ +#define JZ_CPMPCR 0x1014 /* MPLL */ #define JZ_PLLM_S 19 /* PLL multiplier shift */ #define JZ_PLLM_M 0xfff8 /* PLL multiplier mask */ #define JZ_PLLN_S 13 /* PLL divider shift */ @@ -182,6 +190,7 @@ MFC0(uint32_t r, uint32_t s) #define JZ_PLLON 0x0010 /* PLL is on and stable */ #define JZ_PLLBP 0x0002 /* PLL bypass */ #define JZ_PLLEN 0x0001 /* PLL enable */ +#define JZ_CPVPCR 0x101c /* VPLL */ #define JZ_CLKGR0 0x1020 /* CLocK Gating Registers */ #define CLK_NEMC (1 << 0) #define CLK_BCH (1 << 1) Added files: Index: src/sys/arch/mips/ingenic/jzfb_regs.h diff -u /dev/null src/sys/arch/mips/ingenic/jzfb_regs.h:1.1 --- /dev/null Thu Apr 7 01:00:05 2016 +++ src/sys/arch/mips/ingenic/jzfb_regs.h Thu Apr 7 01:00:05 2016 @@ -0,0 +1,89 @@ +/* $NetBSD: jzfb_regs.h,v 1.1 2016/04/07 01:00:05 macallan Exp $ */ + +/*- + * Copyright (c) 2015 Michael Lorenz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +#ifndef JZFB_REGS_H +#define JZFB_REGS_H + +#define JZ_LCDCFG 0x +#define JZ_LCDCTRL 0x0030 +#define JZ_LCDSTATE 0x0034 +#define JZ_LCDOSDC 0x0100 +#define JZ_LCDOSDCTRL 0x0104 +#define JZ_LCDOSDS 0x0108 +#define JZ_LCDBGC0 0x010C +#define JZ_LCDBGC1 0x02C4 +#define JZ_LCDKEY0 0x0110 +#define JZ_LCDKEY1 0x0114 +#define JZ_LCDALPHA 0x0118 +#define JZ_LCDIPUR 0x011C +#define JZ_LCDRGBC 0x0090 +#define JZ_LCDVAT 0x000C +#define JZ_LCDDAH 0x0010 +#define JZ_LCDDAV 0x0014 +#define JZ_LCDXYP0 0x0120 +#define JZ_LCDXYP1 0x0124 +#define JZ_LCDSIZE0 0x0128 +#define JZ_LCDSIZE1 0x012C +#define JZ_LCDVSYNC
CVS commit: [nick-nhusb] src/sys
Module Name:src Committed By: skrll Date: Wed Apr 6 22:00:03 UTC 2016 Modified Files: src/sys/ddb [nick-nhusb]: db_command.c src/sys/kern [nick-nhusb]: kern_history.c src/sys/sys [nick-nhusb]: kernhist.h Log Message: Pull across ddb(4) show kernhist updates from HEAD To generate a diff of this commit: cvs rdiff -u -r1.143.6.2 -r1.143.6.3 src/sys/ddb/db_command.c cvs rdiff -u -r1.1.36.1 -r1.1.36.2 src/sys/kern/kern_history.c cvs rdiff -u -r1.9.6.1 -r1.9.6.2 src/sys/sys/kernhist.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ddb/db_command.c diff -u src/sys/ddb/db_command.c:1.143.6.2 src/sys/ddb/db_command.c:1.143.6.3 --- src/sys/ddb/db_command.c:1.143.6.2 Sat Jun 6 14:40:06 2015 +++ src/sys/ddb/db_command.c Wed Apr 6 22:00:02 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: db_command.c,v 1.143.6.2 2015/06/06 14:40:06 skrll Exp $ */ +/* $NetBSD: db_command.c,v 1.143.6.3 2016/04/06 22:00:02 skrll Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.143.6.2 2015/06/06 14:40:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.143.6.3 2016/04/06 22:00:02 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_aio.h" @@ -1189,7 +1189,7 @@ db_kernhist_print_cmd(db_expr_t addr, bo db_expr_t count, const char *modif) { - kernhist_print(db_printf); + kernhist_print((void *)(uintptr_t)addr, db_printf); } #endif Index: src/sys/kern/kern_history.c diff -u src/sys/kern/kern_history.c:1.1.36.1 src/sys/kern/kern_history.c:1.1.36.2 --- src/sys/kern/kern_history.c:1.1.36.1 Sun Dec 27 12:10:05 2015 +++ src/sys/kern/kern_history.c Wed Apr 6 22:00:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_history.c,v 1.1.36.1 2015/12/27 12:10:05 skrll Exp $ */ +/* $NetBSD: kern_history.c,v 1.1.36.2 2016/04/06 22:00:03 skrll Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.1.36.1 2015/12/27 12:10:05 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.1.36.2 2016/04/06 22:00:03 skrll Exp $"); #include "opt_kernhist.h" #include "opt_ddb.h" @@ -77,9 +77,11 @@ int kernhist_print_enabled = 1; * prototypes */ -void kernhist_dump(struct kern_history *); +void kernhist_dump(struct kern_history *, +void (*)(const char *, ...) __printflike(1, 2)); void kernhist_dumpmask(u_int32_t); -static void kernhist_dump_histories(struct kern_history *[]); +static void kernhist_dump_histories(struct kern_history *[], +void (*)(const char *, ...) __printflike(1, 2)); /* @@ -88,14 +90,14 @@ static void kernhist_dump_histories(stru * expects the system to be quiesced, no locking */ void -kernhist_dump(struct kern_history *l) +kernhist_dump(struct kern_history *l, void (*pr)(const char *, ...)) { int lcv; lcv = l->f; do { if (l->e[lcv].fmt) - kernhist_entry_print(>e[lcv]); + kernhist_entry_print(>e[lcv], pr); lcv = (lcv + 1) % l->n; } while (lcv != l->f); } @@ -104,7 +106,7 @@ kernhist_dump(struct kern_history *l) * print a merged list of kern_history structures */ static void -kernhist_dump_histories(struct kern_history *hists[]) +kernhist_dump_histories(struct kern_history *hists[], void (*pr)(const char *, ...)) { struct timeval tv; int cur[MAXHISTS]; @@ -160,7 +162,7 @@ restart: break; /* print and move to the next entry */ - kernhist_entry_print([hi]->e[cur[hi]]); + kernhist_entry_print([hi]->e[cur[hi]], pr); cur[hi] = (cur[hi] + 1) % (hists[hi]->n); if (cur[hi] == hists[hi]->f) cur[hi] = -1; @@ -205,16 +207,44 @@ kernhist_dumpmask(u_int32_t bitmask) /* hists[i] = NULL; - kernhist_dump_histories(hists); + kernhist_dump_histories(hists, printf); } /* * kernhist_print: ddb hook to print kern history */ void -kernhist_print(void (*pr)(const char *, ...)) +kernhist_print(void *addr, void (*pr)(const char *, ...) __printflike(1,2)) { - kernhist_dump(LIST_FIRST(_histories)); + struct kern_history *h; + + LIST_FOREACH(h, _histories, list) { + if (h == addr) + break; + } + + if (h == NULL) { + struct kern_history *hists[MAXHISTS + 1]; + int i = 0; +#ifdef UVMHIST + hists[i++] = + hists[i++] = + hists[i++] = + hists[i++] = +#endif +#ifdef USB_DEBUG + hists[i++] = +#endif + +#ifdef SYSCALL_DEBUG + hists[i++] = +#endif + hists[i] = NULL; + + kernhist_dump_histories(hists, pr); + } else { + kernhist_dump(h, pr); + } } #endif Index: src/sys/sys/kernhist.h diff -u src/sys/sys/kernhist.h:1.9.6.1 src/sys/sys/kernhist.h:1.9.6.2 --- src/sys/sys/kernhist.h:1.9.6.1 Sun Dec 27 12:10:18 2015 +++ src/sys/sys/kernhist.h Wed Apr 6 22:00:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kernhist.h,v 1.9.6.1 2015/12/27 12:10:18 skrll Exp $ */ +/* $NetBSD: kernhist.h,v 1.9.6.2
CVS commit: src/sys
Module Name:src Committed By: skrll Date: Wed Apr 6 21:56:25 UTC 2016 Modified Files: src/sys/ddb: db_command.c src/sys/kern: kern_history.c src/sys/sys: kernhist.h Log Message: Improve ddb(4) show kernhist 1) really prints all the histories merged together (rather than just the "first" when no argument specified 2) dumps a single history when an argument is given, e.g. "show kernhist usbhist" 3) uses db_printf correctly To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/ddb/db_command.c cvs rdiff -u -r1.3 -r1.4 src/sys/kern/kern_history.c cvs rdiff -u -r1.10 -r1.11 src/sys/sys/kernhist.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ddb/db_command.c diff -u src/sys/ddb/db_command.c:1.145 src/sys/ddb/db_command.c:1.146 --- src/sys/ddb/db_command.c:1.145 Thu May 21 08:23:22 2015 +++ src/sys/ddb/db_command.c Wed Apr 6 21:56:24 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: db_command.c,v 1.145 2015/05/21 08:23:22 mrg Exp $ */ +/* $NetBSD: db_command.c,v 1.146 2016/04/06 21:56:24 skrll Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.145 2015/05/21 08:23:22 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.146 2016/04/06 21:56:24 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_aio.h" @@ -1189,7 +1189,7 @@ db_kernhist_print_cmd(db_expr_t addr, bo db_expr_t count, const char *modif) { - kernhist_print(db_printf); + kernhist_print((void *)(uintptr_t)addr, db_printf); } #endif Index: src/sys/kern/kern_history.c diff -u src/sys/kern/kern_history.c:1.3 src/sys/kern/kern_history.c:1.4 --- src/sys/kern/kern_history.c:1.3 Thu Oct 29 18:40:19 2015 +++ src/sys/kern/kern_history.c Wed Apr 6 21:56:24 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_history.c,v 1.3 2015/10/29 18:40:19 mrg Exp $ */ +/* $NetBSD: kern_history.c,v 1.4 2016/04/06 21:56:24 skrll Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.3 2015/10/29 18:40:19 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.4 2016/04/06 21:56:24 skrll Exp $"); #include "opt_kernhist.h" #include "opt_ddb.h" @@ -77,9 +77,11 @@ int kernhist_print_enabled = 1; * prototypes */ -void kernhist_dump(struct kern_history *); +void kernhist_dump(struct kern_history *, +void (*)(const char *, ...) __printflike(1, 2)); void kernhist_dumpmask(u_int32_t); -static void kernhist_dump_histories(struct kern_history *[]); +static void kernhist_dump_histories(struct kern_history *[], +void (*)(const char *, ...) __printflike(1, 2)); /* @@ -88,14 +90,14 @@ static void kernhist_dump_histories(stru * expects the system to be quiesced, no locking */ void -kernhist_dump(struct kern_history *l) +kernhist_dump(struct kern_history *l, void (*pr)(const char *, ...)) { int lcv; lcv = l->f; do { if (l->e[lcv].fmt) - kernhist_entry_print(>e[lcv]); + kernhist_entry_print(>e[lcv], pr); lcv = (lcv + 1) % l->n; } while (lcv != l->f); } @@ -104,7 +106,7 @@ kernhist_dump(struct kern_history *l) * print a merged list of kern_history structures */ static void -kernhist_dump_histories(struct kern_history *hists[]) +kernhist_dump_histories(struct kern_history *hists[], void (*pr)(const char *, ...)) { struct timeval tv; int cur[MAXHISTS]; @@ -160,7 +162,7 @@ restart: break; /* print and move to the next entry */ - kernhist_entry_print([hi]->e[cur[hi]]); + kernhist_entry_print([hi]->e[cur[hi]], pr); cur[hi] = (cur[hi] + 1) % (hists[hi]->n); if (cur[hi] == hists[hi]->f) cur[hi] = -1; @@ -205,16 +207,44 @@ kernhist_dumpmask(u_int32_t bitmask) /* hists[i] = NULL; - kernhist_dump_histories(hists); + kernhist_dump_histories(hists, printf); } /* * kernhist_print: ddb hook to print kern history */ void -kernhist_print(void (*pr)(const char *, ...)) +kernhist_print(void *addr, void (*pr)(const char *, ...) __printflike(1,2)) { - kernhist_dump(LIST_FIRST(_histories)); + struct kern_history *h; + + LIST_FOREACH(h, _histories, list) { + if (h == addr) + break; + } + + if (h == NULL) { + struct kern_history *hists[MAXHISTS + 1]; + int i = 0; +#ifdef UVMHIST + hists[i++] = + hists[i++] = + hists[i++] = + hists[i++] = +#endif +#ifdef USB_DEBUG + hists[i++] = +#endif + +#ifdef SYSCALL_DEBUG + hists[i++] = +#endif + hists[i] = NULL; + + kernhist_dump_histories(hists, pr); + } else { + kernhist_dump(h, pr); + } } #endif Index: src/sys/sys/kernhist.h diff -u src/sys/sys/kernhist.h:1.10 src/sys/sys/kernhist.h:1.11 --- src/sys/sys/kernhist.h:1.10 Thu Oct 29 00:27:08 2015 +++ src/sys/sys/kernhist.h Wed Apr 6 21:56:24 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: kernhist.h,v 1.10 2015/10/29
CVS commit: src
Module Name:src Committed By: roy Date: Wed Apr 6 19:45:46 UTC 2016 Modified Files: src/share/man/man4: unix.4 src/sys/compat/common: Makefile src/sys/compat/sys: socket.h src/sys/kern: uipc_usrreq.c src/sys/modules/compat: Makefile src/sys/sys: socket.h un.h unpcb.h Added Files: src/sys/compat/common: uipc_usrreq_70.c Log Message: Add sc_pid to sockcred so that SOCK_DGRAM and LOCAL_CREDS socket option can learn the process id of the AF_LOCAL sender. Add compat glue for old structure. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/share/man/man4/unix.4 cvs rdiff -u -r1.55 -r1.56 src/sys/compat/common/Makefile cvs rdiff -u -r0 -r1.1 src/sys/compat/common/uipc_usrreq_70.c cvs rdiff -u -r1.12 -r1.13 src/sys/compat/sys/socket.h cvs rdiff -u -r1.179 -r1.180 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.12 -r1.13 src/sys/modules/compat/Makefile cvs rdiff -u -r1.118 -r1.119 src/sys/sys/socket.h cvs rdiff -u -r1.56 -r1.57 src/sys/sys/un.h cvs rdiff -u -r1.17 -r1.18 src/sys/sys/unpcb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/unix.4 diff -u src/share/man/man4/unix.4:1.24 src/share/man/man4/unix.4:1.25 --- src/share/man/man4/unix.4:1.24 Sun May 29 08:46:42 2011 +++ src/share/man/man4/unix.4 Wed Apr 6 19:45:46 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: unix.4,v 1.24 2011/05/29 08:46:42 wiz Exp $ +.\" $NetBSD: unix.4,v 1.25 2016/04/06 19:45:46 roy Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" -.Dd May 29, 2011 +.Dd March 31, 2016 .Dt UNIX 4 .Os .Sh NAME @@ -198,6 +198,7 @@ length sockcred structure, defined in as follows: .Bd -literal struct sockcred { + pid_t sc_pid; /* process id */ uid_t sc_uid; /* real user id */ uid_t sc_euid; /* effective user id */ gid_t sc_gid; /* real group id */ @@ -289,3 +290,8 @@ macro, the following definition is recom .%A Chris Torek .Re .Pq see Pa /usr/share/doc/psd/21.ipc +.Sh HISTORY +The +.Ar sc_pid +field was introduced in +.Nx 8.0 . Index: src/sys/compat/common/Makefile diff -u src/sys/compat/common/Makefile:1.55 src/sys/compat/common/Makefile:1.56 --- src/sys/compat/common/Makefile:1.55 Tue Mar 22 08:25:23 2016 +++ src/sys/compat/common/Makefile Wed Apr 6 19:45:45 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.55 2016/03/22 08:25:23 mrg Exp $ +# $NetBSD: Makefile,v 1.56 2016/04/06 19:45:45 roy Exp $ LIB= compat NOPIC= # defined @@ -47,6 +47,9 @@ SRCS+= kern_50.c kern_time_50.c kern_sel # Compatibility code for NetBSD 6.0 SRCS+= kern_sa_60.c tty_60.c kern_time_60.c +# Compatibility code for NetBSD 7.0 +SRCS+= uipc_usrreq_70.c + # really, all machines where sizeof(int) != sizeof(long) (LP64) .if (${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "sparc64" \ && ${MACHINE_ARCH} != "x86_64") Index: src/sys/compat/sys/socket.h diff -u src/sys/compat/sys/socket.h:1.12 src/sys/compat/sys/socket.h:1.13 --- src/sys/compat/sys/socket.h:1.12 Fri Feb 13 22:41:04 2009 +++ src/sys/compat/sys/socket.h Wed Apr 6 19:45:45 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: socket.h,v 1.12 2009/02/13 22:41:04 apb Exp $ */ +/* $NetBSD: socket.h,v 1.13 2016/04/06 19:45:45 roy Exp $ */ /* * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 @@ -47,6 +47,10 @@ #define COMPAT_OSOCK #endif +#ifdef COMPAT_70 +#define COMPAT_SOCKCRED70 +#endif + #else #define COMPAT_OSOCK #endif @@ -71,12 +75,28 @@ struct omsghdr { int msg_accrightslen; }; +/* + * 7.0 compat sockcred + */ +struct sockcred70 { + uid_t sc_uid; /* real user id */ + uid_t sc_euid; /* effective user id */ + gid_t sc_gid; /* real group id */ + gid_t sc_egid; /* effective group id */ + int sc_ngroups; /* number of supplemental groups */ + gid_t sc_groups[1]; /* variable length */ +}; +#define SOCKCRED70SIZE(ngrps) \ + (/*CONSTCOND*/sizeof(struct sockcred70) + (sizeof(gid_t) * \ + ((ngrps) ? ((ngrps) - 1) : 0))) + #ifdef _KERNEL #define SO_OSNDTIMEO 0x1005 #define SO_ORCVTIMEO 0x1006 #define SO_OTIMESTAMP 0x0400 #define SCM_OTIMESTAMP 0x2 +#define SCM_OCREDS 0x4 __BEGIN_DECLS struct socket; @@ -84,6 +104,8 @@ struct proc; u_long compat_cvtcmd(u_long cmd); int compat_ifioctl(struct socket *, u_long, u_long, void *, struct lwp *); int compat43_set_accrights(struct msghdr *, void *, int); + +struct mbuf * compat_70_unp_addsockcred(struct lwp *, struct mbuf *); __END_DECLS #else int __socket30(int, int, int); Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.179 src/sys/kern/uipc_usrreq.c:1.180 --- src/sys/kern/uipc_usrreq.c:1.179 Sat May 2 17:18:03 2015 +++ src/sys/kern/uipc_usrreq.c Wed Apr 6 19:45:45 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.179 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.180
CVS commit: src/lib/libutil
Module Name:src Committed By: christos Date: Wed Apr 6 18:08:16 UTC 2016 Modified Files: src/lib/libutil: sockaddr_snprintf.c Log Message: pretty-print link addresses. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libutil/sockaddr_snprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libutil/sockaddr_snprintf.c diff -u src/lib/libutil/sockaddr_snprintf.c:1.11 src/lib/libutil/sockaddr_snprintf.c:1.12 --- src/lib/libutil/sockaddr_snprintf.c:1.11 Tue Dec 31 07:58:02 2013 +++ src/lib/libutil/sockaddr_snprintf.c Wed Apr 6 14:08:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: sockaddr_snprintf.c,v 1.11 2013/12/31 12:58:02 mlelstv Exp $ */ +/* $NetBSD: sockaddr_snprintf.c,v 1.12 2016/04/06 18:08:16 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.11 2013/12/31 12:58:02 mlelstv Exp $"); +__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.12 2016/04/06 18:08:16 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -159,10 +159,17 @@ sockaddr_snprintf(char * const sbuf, con break; case AF_LINK: sdl = ((const struct sockaddr_dl *)(const void *)sa); - (void)strlcpy(addr = abuf, link_ntoa(sdl), sizeof(abuf)); - if ((w = strchr(addr, ':')) != 0) { - *w++ = '\0'; - addr = w; + addr = abuf; + if (sdl->sdl_slen == 0 && sdl->sdl_nlen == 0 + && sdl->sdl_alen == 0) { + (void)snprintf(abuf, sizeof(abuf), "link#%hu", + sdl->sdl_index); + } else { + (void)strlcpy(abuf, link_ntoa(sdl), sizeof(abuf)); + if ((w = strchr(addr, ':')) != 0) { + *w++ = '\0'; + addr = w; + } } break; default:
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Wed Apr 6 18:04:58 UTC 2016 Modified Files: src/sys/net: dl_print.c Log Message: pretty-print link addresses. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/net/dl_print.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/dl_print.c diff -u src/sys/net/dl_print.c:1.2 src/sys/net/dl_print.c:1.3 --- src/sys/net/dl_print.c:1.2 Tue Dec 2 14:34:33 2014 +++ src/sys/net/dl_print.c Wed Apr 6 14:04:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: dl_print.c,v 1.2 2014/12/02 19:34:33 christos Exp $ */ +/* $NetBSD: dl_print.c,v 1.3 2016/04/06 18:04:58 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -29,10 +29,10 @@ #include #ifdef _KERNEL -__KERNEL_RCSID(0, "$NetBSD: dl_print.c,v 1.2 2014/12/02 19:34:33 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dl_print.c,v 1.3 2016/04/06 18:04:58 christos Exp $"); #include #else -__RCSID("$NetBSD: dl_print.c,v 1.2 2014/12/02 19:34:33 christos Exp $"); +__RCSID("$NetBSD: dl_print.c,v 1.3 2016/04/06 18:04:58 christos Exp $"); #include static const uint8_t hexdigits[] = "0123456789abcdef"; #endif @@ -83,6 +83,9 @@ sdl_print(char *buf, size_t len, const v const struct sockaddr_dl *sdl = v; char abuf[LINK_ADDRSTRLEN]; + if (sdl->sdl_slen == 0 && sdl->sdl_nlen == 0 && sdl->sdl_alen == 0) + return snprintf(buf, len, "link#%hu", sdl->sdl_index); + dl_print(abuf, sizeof(abuf), >sdl_addr); return snprintf(buf, len, "[%s]:%hu", abuf, sdl->sdl_index); }
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Wed Apr 6 17:34:33 UTC 2016 Modified Files: src/sys/net: rtsock.c Log Message: Don't interpret routing requests by interface index as arp entry additions! To generate a diff of this commit: cvs rdiff -u -r1.179 -r1.180 src/sys/net/rtsock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/rtsock.c diff -u src/sys/net/rtsock.c:1.179 src/sys/net/rtsock.c:1.180 --- src/sys/net/rtsock.c:1.179 Tue Apr 5 06:03:33 2016 +++ src/sys/net/rtsock.c Wed Apr 6 13:34:33 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: rtsock.c,v 1.179 2016/04/05 10:03:33 ozaki-r Exp $ */ +/* $NetBSD: rtsock.c,v 1.180 2016/04/06 17:34:33 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.179 2016/04/05 10:03:33 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.180 2016/04/06 17:34:33 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -568,13 +568,18 @@ COMPATNAME(route_output)(struct mbuf *m, #ifdef INET /* support for new ARP code with keeping backcompat */ if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) { - int sdl_index = - satocsdl(info.rti_info[RTAX_GATEWAY])->sdl_index; + const struct sockaddr_dl *sdlp = + satocsdl(info.rti_info[RTAX_GATEWAY]); + /* Allow routing requests by interface index */ + if (sdlp->sdl_nlen == 0 && sdlp->sdl_alen == 0 + && sdlp->sdl_slen == 0) +goto fallback; /* * Old arp binaries don't set the sdl_index * so we have to complement it. */ + int sdl_index = sdlp->sdl_index; if (sdl_index == 0) { error = route_get_sdl_index(, _index); if (error != 0)
CVS commit: src/sys/dev/ic
Module Name:src Committed By: roy Date: Wed Apr 6 15:10:35 UTC 2016 Modified Files: src/sys/dev/ic: ath.c Log Message: Fix rssi To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/dev/ic/ath.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/ath.c diff -u src/sys/dev/ic/ath.c:1.117 src/sys/dev/ic/ath.c:1.118 --- src/sys/dev/ic/ath.c:1.117 Sat Oct 18 08:33:27 2014 +++ src/sys/dev/ic/ath.c Wed Apr 6 15:10:35 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ath.c,v 1.117 2014/10/18 08:33:27 snj Exp $ */ +/* $NetBSD: ath.c,v 1.118 2016/04/06 15:10:35 roy Exp $ */ /*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.117 2014/10/18 08:33:27 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.118 2016/04/06 15:10:35 roy Exp $"); #endif /* @@ -158,7 +158,7 @@ static int ath_desc_alloc(struct ath_sof static void ath_desc_free(struct ath_softc *); static struct ieee80211_node *ath_node_alloc(struct ieee80211_node_table *); static void ath_node_free(struct ieee80211_node *); -static u_int8_t ath_node_getrssi(const struct ieee80211_node *); +static int8_t ath_node_getrssi(const struct ieee80211_node *); static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); static void ath_recv_mgmt(struct ieee80211com *ic, struct mbuf *m, struct ieee80211_node *ni, @@ -2797,7 +2797,7 @@ ath_node_free(struct ieee80211_node *ni) sc->sc_node_free(ni); } -static u_int8_t +static int8_t ath_node_getrssi(const struct ieee80211_node *ni) { #define HAL_EP_RND(x, mul) \
CVS commit: src/sys/net80211
Module Name:src Committed By: roy Date: Wed Apr 6 14:42:16 UTC 2016 Modified Files: src/sys/net80211: ieee80211_ioctl.h ieee80211_node.c ieee80211_node.h ieee80211_rssadapt.h ieee80211_var.h Log Message: ieee80211 users in Other OS export rssi and noise as int8_t. We should not be the odd one out for no good reason and the majority of the ieee80211 drivers treat rssi as int8_t. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/net80211/ieee80211_ioctl.h cvs rdiff -u -r1.69 -r1.70 src/sys/net80211/ieee80211_node.c cvs rdiff -u -r1.25 -r1.26 src/sys/net80211/ieee80211_node.h cvs rdiff -u -r1.7 -r1.8 src/sys/net80211/ieee80211_rssadapt.h cvs rdiff -u -r1.28 -r1.29 src/sys/net80211/ieee80211_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/ieee80211_ioctl.h diff -u src/sys/net80211/ieee80211_ioctl.h:1.21 src/sys/net80211/ieee80211_ioctl.h:1.22 --- src/sys/net80211/ieee80211_ioctl.h:1.21 Sun Sep 6 06:01:01 2015 +++ src/sys/net80211/ieee80211_ioctl.h Wed Apr 6 14:42:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_ioctl.h,v 1.21 2015/09/06 06:01:01 dholland Exp $ */ +/* $NetBSD: ieee80211_ioctl.h,v 1.22 2016/04/06 14:42:16 roy Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -356,7 +356,7 @@ struct ieee80211req_sta_info { u_int16_t isi_flags; /* channel flags */ u_int16_t isi_state; /* state flags */ u_int8_t isi_authmode; /* authentication algorithm */ - u_int8_t isi_rssi; + int8_t isi_rssi; u_int8_t isi_capinfo; /* capabilities */ u_int8_t isi_erp; /* ERP element */ u_int8_t isi_macaddr[IEEE80211_ADDR_LEN]; @@ -524,8 +524,8 @@ struct ieee80211req_scan_result { u_int16_t isr_len; /* length (mult of 4) */ u_int16_t isr_freq; /* MHz */ u_int16_t isr_flags; /* channel flags */ - u_int8_t isr_noise; - u_int8_t isr_rssi; + int8_t isr_noise; + int8_t isr_rssi; u_int8_t isr_intval; /* beacon interval */ u_int8_t isr_capinfo; /* capabilities */ u_int8_t isr_erp; /* ERP element */ Index: src/sys/net80211/ieee80211_node.c diff -u src/sys/net80211/ieee80211_node.c:1.69 src/sys/net80211/ieee80211_node.c:1.70 --- src/sys/net80211/ieee80211_node.c:1.69 Mon Aug 24 22:21:26 2015 +++ src/sys/net80211/ieee80211_node.c Wed Apr 6 14:42:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_node.c,v 1.69 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: ieee80211_node.c,v 1.70 2016/04/06 14:42:16 roy Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.65 2005/08/13 17:50:21 sam Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.69 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.70 2016/04/06 14:42:16 roy Exp $"); #endif #ifdef _KERNEL_OPT @@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: ieee80211_no static struct ieee80211_node *node_alloc(struct ieee80211_node_table *); static void node_cleanup(struct ieee80211_node *); static void node_free(struct ieee80211_node *); -static u_int8_t node_getrssi(const struct ieee80211_node *); +static int8_t node_getrssi(const struct ieee80211_node *); static void ieee80211_setup_node(struct ieee80211_node_table *, struct ieee80211_node *, const u_int8_t *); @@ -589,7 +589,7 @@ ieee80211_node_compare(struct ieee80211c const struct ieee80211_node *b) { u_int8_t maxa, maxb; - u_int8_t rssia, rssib; + int8_t rssia, rssib; int weight; /* privacy support preferred */ @@ -1001,7 +1001,7 @@ node_free(struct ieee80211_node *ni) free(ni, M_80211_NODE); } -static u_int8_t +static int8_t node_getrssi(const struct ieee80211_node *ni) { return ni->ni_rssi; @@ -2347,12 +2347,12 @@ done: ieee80211_free_node(ni); } -u_int8_t +int8_t ieee80211_getrssi(struct ieee80211com *ic) { #define NZ(x) ((x) == 0 ? 1 : (x)) struct ieee80211_node_table *nt = >ic_sta; - u_int32_t rssi_samples, rssi_total; + int32_t rssi_samples, rssi_total; struct ieee80211_node *ni; rssi_total = 0; Index: src/sys/net80211/ieee80211_node.h diff -u src/sys/net80211/ieee80211_node.h:1.25 src/sys/net80211/ieee80211_node.h:1.26 --- src/sys/net80211/ieee80211_node.h:1.25 Sat Oct 18 08:33:29 2014 +++ src/sys/net80211/ieee80211_node.h Wed Apr 6 14:42:16 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_node.h,v 1.25 2014/10/18 08:33:29 snj Exp $ */ +/* $NetBSD: ieee80211_node.h,v 1.26 2016/04/06 14:42:16 roy Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -120,7 +120,7 @@ struct ieee80211_node { /* hardware */ u_int32_t ni_rstamp; /* recv timestamp */ - u_int8_t ni_rssi; /* recv ssi */ + int8_t ni_rssi; /* recv ssi */ /* header */ u_int8_t
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: roy Date: Wed Apr 6 11:07:58 UTC 2016 Modified Files: src/lib/libc/stdlib: reallocarray.c Log Message: Revert prior, no idea why it was causing me problems, but it no longer does. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/stdlib/reallocarray.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/reallocarray.c diff -u src/lib/libc/stdlib/reallocarray.c:1.6 src/lib/libc/stdlib/reallocarray.c:1.7 --- src/lib/libc/stdlib/reallocarray.c:1.6 Tue Apr 5 15:01:26 2016 +++ src/lib/libc/stdlib/reallocarray.c Wed Apr 6 11:07:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: reallocarray.c,v 1.6 2016/04/05 15:01:26 roy Exp $ */ +/* $NetBSD: reallocarray.c,v 1.7 2016/04/06 11:07:58 roy Exp $ */ /* $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $ */ /*- @@ -31,29 +31,23 @@ */ #include -__RCSID("$NetBSD: reallocarray.c,v 1.6 2016/04/05 15:01:26 roy Exp $"); +__RCSID("$NetBSD: reallocarray.c,v 1.7 2016/04/06 11:07:58 roy Exp $"); #define _OPENBSD_SOURCE #include -#include #include -#define SQRT_SIZE_MAX (((size_t)1) << (sizeof(size_t) * CHAR_BIT / 2)) void * reallocarray(void *optr, size_t nmemb, size_t size) { + int e; - /* - * Try to avoid division here. - * - * It isn't possible to overflow during multiplication if neither - * operand uses any of the most significant half of the bits. - */ - if (__predict_false((nmemb | size) >= SQRT_SIZE_MAX && - nmemb > SIZE_MAX / size)) - { - errno = EOVERFLOW; - return NULL; - } - return realloc(optr, nmemb * size); + if (nmemb == 0 || size == 0) + return realloc(optr, 0); + + e = reallocarr(, nmemb, size); + if (e == 0) + return optr; + errno = e; + return NULL; }
CVS commit: src/usr.bin/make
Module Name:src Committed By: gson Date: Wed Apr 6 09:57:00 UTC 2016 Modified Files: src/usr.bin/make: arch.c parse.c str.c Log Message: Fully avoid the nonstandard types u_char, u_int, and u_long, which were only used inconsistently in a few places anyway. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/usr.bin/make/arch.c cvs rdiff -u -r1.213 -r1.214 src/usr.bin/make/parse.c cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/str.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.68 src/usr.bin/make/arch.c:1.69 --- src/usr.bin/make/arch.c:1.68 Thu Feb 18 18:29:14 2016 +++ src/usr.bin/make/arch.c Wed Apr 6 09:57:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"); #endif #endif /* not lint */ #endif @@ -785,7 +785,7 @@ ArchSVR4Entry(Arch *ar, char *name, size } if (DEBUG(ARCH)) { fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + (unsigned long)entry); } return 0; } @@ -803,7 +803,7 @@ ArchSVR4Entry(Arch *ar, char *name, size if (entry >= ar->fnamesize) { if (DEBUG(ARCH)) { fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); + name, (unsigned long)ar->fnamesize); } return 2; } Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.213 src/usr.bin/make/parse.c:1.214 --- src/usr.bin/make/parse.c:1.213 Fri Mar 11 13:54:47 2016 +++ src/usr.bin/make/parse.c Wed Apr 6 09:57:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $ */ +/* $NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"); +__RCSID("$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $"); #endif #endif /* not lint */ #endif @@ -795,11 +795,11 @@ ParseMessage(char *line) return FALSE; } -while (isalpha((u_char)*line)) +while (isalpha((unsigned char)*line)) line++; -if (!isspace((u_char)*line)) +if (!isspace((unsigned char)*line)) return FALSE; /* not for us */ -while (isspace((u_char)*line)) +while (isspace((unsigned char)*line)) line++; line = Var_Subst(NULL, line, VAR_CMD, VARF_WANTRES); Index: src/usr.bin/make/str.c diff -u src/usr.bin/make/str.c:1.35 src/usr.bin/make/str.c:1.36 --- src/usr.bin/make/str.c:1.35 Wed Feb 12 01:35:56 2014 +++ src/usr.bin/make/str.c Wed Apr 6 09:57:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $ */ +/* $NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $"; +static char rcsid[] = "$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else -__RCSID("$NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $"); +__RCSID("$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"); #endif #endif/* not lint */ #endif @@ -102,7 +102,7 @@ str_concat(const char *s1, const char *s len2 = strlen(s2); /* allocate length plus separator plus EOS */ - result = bmake_malloc((u_int)(len1 + len2 + 2)); + result = bmake_malloc((unsigned int)(len1 + len2 + 2)); /* copy first string into place */ memcpy(result, s1, len1);
CVS commit: src/sys/net
Module Name:src Committed By: ozaki-r Date: Wed Apr 6 08:45:47 UTC 2016 Modified Files: src/sys/net: if_llatbl.c Log Message: Fill rtm_addrs properly This fixes that arp(8) on some archs (only 32bit?) shows "(weird)" for every entries unexpectedly. Confirmed on evbarm by ryo@ and i386 by me. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/net/if_llatbl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if_llatbl.c diff -u src/sys/net/if_llatbl.c:1.12 src/sys/net/if_llatbl.c:1.13 --- src/sys/net/if_llatbl.c:1.12 Wed Apr 6 07:59:26 2016 +++ src/sys/net/if_llatbl.c Wed Apr 6 08:45:46 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_llatbl.c,v 1.12 2016/04/06 07:59:26 ozaki-r Exp $ */ +/* $NetBSD: if_llatbl.c,v 1.13 2016/04/06 08:45:46 ozaki-r Exp $ */ /* * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. * Copyright (c) 2004-2008 Qing Li. All rights reserved. @@ -111,6 +111,7 @@ lltable_dump_entry(struct lltable *llt, rtm->rtm_flags |= (lle->la_flags & LLE_STATIC) ? RTF_STATIC : 0; if (lle->la_flags & LLE_PUB) rtm->rtm_flags |= RTF_ANNOUNCE; + rtm->rtm_addrs = info.rti_addrs; if ((error = copyout(rtm, w->w_where, size)) != 0) w->w_where = NULL; else
CVS commit: src/lib/libc/sys
Module Name:src Committed By: wiz Date: Wed Apr 6 08:18:35 UTC 2016 Modified Files: src/lib/libc/sys: wait.2 Log Message: Drop trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/wait.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/wait.2 diff -u src/lib/libc/sys/wait.2:1.31 src/lib/libc/sys/wait.2:1.32 --- src/lib/libc/sys/wait.2:1.31 Wed Apr 6 04:09:10 2016 +++ src/lib/libc/sys/wait.2 Wed Apr 6 08:18:35 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: wait.2,v 1.31 2016/04/06 04:09:10 christos Exp $ +.\" $NetBSD: wait.2,v 1.32 2016/04/06 08:18:35 wiz Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -510,7 +510,7 @@ or if the child process is being traced .Xr ptrace 2 ) . .It Fn WIFCONTINUED status True if the process has not terminated, but has been continued via the -delivery of the +delivery of the .Dv SIGCONT signal. This macro can be true only if the wait call specified the
CVS commit: src/sys/net
Module Name:src Committed By: ozaki-r Date: Wed Apr 6 07:59:26 UTC 2016 Modified Files: src/sys/net: if_llatbl.c Log Message: Fill sdl with sockaddr_dl_init And add an assertion of if_addrlen and ll_addr. >From christos@ To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/net/if_llatbl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if_llatbl.c diff -u src/sys/net/if_llatbl.c:1.11 src/sys/net/if_llatbl.c:1.12 --- src/sys/net/if_llatbl.c:1.11 Mon Apr 4 07:37:07 2016 +++ src/sys/net/if_llatbl.c Wed Apr 6 07:59:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_llatbl.c,v 1.11 2016/04/04 07:37:07 ozaki-r Exp $ */ +/* $NetBSD: if_llatbl.c,v 1.12 2016/04/06 07:59:26 ozaki-r Exp $ */ /* * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. * Copyright (c) 2004-2008 Qing Li. All rights reserved. @@ -79,25 +79,20 @@ lltable_dump_entry(struct lltable *llt, struct rt_walkarg *w, struct sockaddr *sa) { struct ifnet *ifp = llt->llt_ifp; - int error = 0; + int error; + void *a; struct sockaddr_dl sdl; int size; struct rt_addrinfo info; memset(, 0, sizeof(info)); info.rti_info[RTAX_DST] = sa; - memset(, 0, sizeof(sdl)); - sdl.sdl_family = AF_LINK; - sdl.sdl_len = sizeof(sdl); - sdl.sdl_index = ifp->if_index; - sdl.sdl_type = ifp->if_type; - if ((lle->la_flags & LLE_VALID) == LLE_VALID) { - sdl.sdl_alen = ifp->if_addrlen; - memcpy(LLADDR(), >ll_addr, ifp->if_addrlen); - } else { - sdl.sdl_alen = 0; - memset(LLADDR(), 0, ifp->if_addrlen); - } + + a = (lle->la_flags & LLE_VALID) == LLE_VALID ? >ll_addr : NULL; + if (sockaddr_dl_init(, sizeof(sdl), ifp->if_index, ifp->if_type, + NULL, 0, a, ifp->if_addrlen) == NULL) + return EINVAL; + info.rti_info[RTAX_GATEWAY] = sstocsa(); if (sa->sa_family == AF_INET && lle->la_flags & LLE_PUB) { struct sockaddr_inarp *sin; @@ -643,7 +638,7 @@ lla_rt_output(const u_char rtm_type, con return (ENOMEM); } - + KASSERT(ifp->if_addrlen <= sizeof(lle->ll_addr)); memcpy(>ll_addr, CLLADDR(dl), ifp->if_addrlen); if ((rtm_flags & RTF_ANNOUNCE)) lle->la_flags |= LLE_PUB;
CVS commit: [nick-nhusb] src/sys/dev/usb
Module Name:src Committed By: skrll Date: Wed Apr 6 07:01:37 UTC 2016 Modified Files: src/sys/dev/usb [nick-nhusb]: usb.h Log Message: Remove FreeBSD RCSId tag To generate a diff of this commit: cvs rdiff -u -r1.111.2.8 -r1.111.2.9 src/sys/dev/usb/usb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb.h diff -u src/sys/dev/usb/usb.h:1.111.2.8 src/sys/dev/usb/usb.h:1.111.2.9 --- src/sys/dev/usb/usb.h:1.111.2.8 Sun Jun 7 07:55:30 2015 +++ src/sys/dev/usb/usb.h Wed Apr 6 07:01:37 2016 @@ -1,5 +1,4 @@ -/* $NetBSD: usb.h,v 1.111.2.8 2015/06/07 07:55:30 skrll Exp $ */ -/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */ +/* $NetBSD: usb.h,v 1.111.2.9 2016/04/06 07:01:37 skrll Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc.