CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: maxv Date: Sat Jan 20 07:43:28 UTC 2018 Modified Files: src/sys/arch/amd64/amd64: machdep.c Log Message: Improve two comments and a KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.291 -r1.292 src/sys/arch/amd64/amd64/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/amd64
Module Name:src Committed By: maxv Date: Sat Jan 20 07:43:28 UTC 2018 Modified Files: src/sys/arch/amd64/amd64: machdep.c Log Message: Improve two comments and a KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.291 -r1.292 src/sys/arch/amd64/amd64/machdep.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/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.291 src/sys/arch/amd64/amd64/machdep.c:1.292 --- src/sys/arch/amd64/amd64/machdep.c:1.291 Thu Jan 18 07:25:34 2018 +++ src/sys/arch/amd64/amd64/machdep.c Sat Jan 20 07:43:28 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.291 2018/01/18 07:25:34 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.292 2018/01/20 07:43:28 maxv Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 @@ -110,7 +110,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.291 2018/01/18 07:25:34 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.292 2018/01/20 07:43:28 maxv Exp $"); /* #define XENDEBUG_LOW */ @@ -2478,7 +2478,7 @@ svs_pmap_sync(struct pmap *pmap, int ind KASSERT(pmap != pmap_kernel()); KASSERT(mutex_owned(pmap->pm_lock)); KASSERT(kpreempt_disabled()); - KASSERT(index <= 255); + KASSERT(index < 255); for (CPU_INFO_FOREACH(cii, ci)) { cid = cpu_index(ci); @@ -2530,9 +2530,8 @@ svs_lwp_switch(struct lwp *oldlwp, struc (ci->ci_svs_ursp0 % PAGE_SIZE)); /* - * Enter the user rsp0. We don't need to flush the TLB here, it will - * be implicitly flushed when we reload CR3 next time we return to - * userland. + * Enter the user rsp0. We don't need to flush the TLB here, since + * the user page tables are not loaded. */ pte = ci->ci_svs_rsp0_pte; *pte = L1_BASE[pl1_i(va)]; @@ -2549,7 +2548,7 @@ svs_pte_atomic_read(struct pmap *pmap, s /* * We may come here with the pmap unlocked. So read its PTEs atomically. If - * a remote CPU is updating them at the same time, it's not that bad: the + * a remote CPU is updating them at the same time, it's not a problem: the * remote CPU will call svs_pmap_sync afterwards, and our updirpa will be * synchronized properly. */
CVS commit: src/sys/arch/powerpc/include
Module Name:src Committed By: simonb Date: Sat Jan 20 03:50:29 UTC 2018 Modified Files: src/sys/arch/powerpc/include: spr.h Log Message: Add a copyright (approx 16.5 years later). To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/spr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/include
Module Name:src Committed By: simonb Date: Sat Jan 20 03:50:29 UTC 2018 Modified Files: src/sys/arch/powerpc/include: spr.h Log Message: Add a copyright (approx 16.5 years later). To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/spr.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/powerpc/include/spr.h diff -u src/sys/arch/powerpc/include/spr.h:1.47 src/sys/arch/powerpc/include/spr.h:1.48 --- src/sys/arch/powerpc/include/spr.h:1.47 Fri Jul 7 22:50:02 2017 +++ src/sys/arch/powerpc/include/spr.h Sat Jan 20 03:50:28 2018 @@ -1,4 +1,29 @@ -/* $NetBSD: spr.h,v 1.47 2017/07/07 22:50:02 macallan Exp $ */ +/* $NetBSD: spr.h,v 1.48 2018/01/20 03:50:28 simonb Exp $ */ + +/* + * Copyright (c) 2001, The NetBSD Foundation, Inc. + * 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 AUTHOR ``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 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 _POWERPC_SPR_H_ #define _POWERPC_SPR_H_
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: mrg Date: Sat Jan 20 01:32:45 UTC 2018 Modified Files: src/sys/dev/raidframe: raidframeio.h rf_compat32.h rf_compat80.c rf_compat80.h rf_netbsdkintf.c Log Message: fixes for the previous, noted by nakayama@. - RAIDFRAME_CONFIGURE needs to be versioned as the rows was removed, adding RAIDFRAME_CONFIGURE80, rf_config80() etc. - RAIDFRAME_CONFIGURE32 changes to match - rf_get_info80() passed the wrong source to copyout() some fixes to my original change were independantly made by nakayama@ who confirmed the changes work properly now. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/raidframe/raidframeio.h cvs rdiff -u -r1.1 -r1.2 src/sys/dev/raidframe/rf_compat32.h \ src/sys/dev/raidframe/rf_compat80.c src/sys/dev/raidframe/rf_compat80.h cvs rdiff -u -r1.354 -r1.355 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/raidframeio.h diff -u src/sys/dev/raidframe/raidframeio.h:1.8 src/sys/dev/raidframe/raidframeio.h:1.9 --- src/sys/dev/raidframe/raidframeio.h:1.8 Thu Jan 18 00:32:49 2018 +++ src/sys/dev/raidframe/raidframeio.h Sat Jan 20 01:32:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: raidframeio.h,v 1.8 2018/01/18 00:32:49 mrg Exp $ */ +/* $NetBSD: raidframeio.h,v 1.9 2018/01/20 01:32:45 mrg Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -123,7 +123,7 @@ #define RAIDFRAME_CHECK_RECON_STATUS_EXT _IOWR('r', 32, RF_ProgressInfo_t) #define RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT _IOWR ('r', 33, RF_ProgressInfo_t) #define RAIDFRAME_CHECK_COPYBACK_STATUS_EXT _IOWR ('r', 34, RF_ProgressInfo_t) -#define RAIDFRAME_CONFIGURE _IOW ('r', 35, void *) /* configure the driver */ +/* 35 was RAIDFRAME_CONFIGURE */ /* 36 was RAIDFRAME_GET_INFO */ #define RAIDFRAME_PARITYMAP_STATUS _IOR('r', 37, struct rf_pmstat) @@ -132,5 +132,6 @@ #define RAIDFRAME_PARITYMAP_SET_PARAMS _IOW('r', 40, struct rf_pmparams) #define RAIDFRAME_SET_LAST_UNIT _IOW('r', 41, int) #define RAIDFRAME_GET_INFO _IOWR('r', 42, RF_DeviceConfig_t *) /* get configuration */ +#define RAIDFRAME_CONFIGURE _IOW ('r', 43, void *) /* configure the driver */ #endif/* !_RF_RAIDFRAMEIO_H_ */ Index: src/sys/dev/raidframe/rf_compat32.h diff -u src/sys/dev/raidframe/rf_compat32.h:1.1 src/sys/dev/raidframe/rf_compat32.h:1.2 --- src/sys/dev/raidframe/rf_compat32.h:1.1 Thu Jan 18 00:32:49 2018 +++ src/sys/dev/raidframe/rf_compat32.h Sat Jan 20 01:32:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_compat32.h,v 1.1 2018/01/18 00:32:49 mrg Exp $ */ +/* $NetBSD: rf_compat32.h,v 1.2 2018/01/20 01:32:45 mrg Exp $ */ /* * Copyright (c) 2017 Matthew R. Green @@ -33,7 +33,7 @@ #include -#define RAIDFRAME_CONFIGURE32 _IOW ('r', 35, netbsd32_pointer_t) /* configure the driver */ +#define RAIDFRAME_CONFIGURE32 _IOW ('r', 43, netbsd32_pointer_t) /* configure the driver */ #define RAIDFRAME_GET_INFO32 _IOWR('r', 42, netbsd32_pointer_t) /* get configuration */ int rf_config_netbsd32(void *data, RF_Config_t *k_cfg); Index: src/sys/dev/raidframe/rf_compat80.c diff -u src/sys/dev/raidframe/rf_compat80.c:1.1 src/sys/dev/raidframe/rf_compat80.c:1.2 --- src/sys/dev/raidframe/rf_compat80.c:1.1 Thu Jan 18 00:32:49 2018 +++ src/sys/dev/raidframe/rf_compat80.c Sat Jan 20 01:32:45 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_compat80.c,v 1.1 2018/01/18 00:32:49 mrg Exp $ */ +/* $NetBSD: rf_compat80.c,v 1.2 2018/01/20 01:32:45 mrg Exp $ */ /* * Copyright (c) 2017 Matthew R. Green @@ -112,7 +112,7 @@ rf_get_info80(RF_Raid_t *raidPtr, void * rf_copy_raiddisk80(>spares[i], >spares[i]); } - rv = copyout(, *configPtr80, sizeof *config80); + rv = copyout(config80, *configPtr80, sizeof *config80); } RF_Free(config, sizeof(RF_DeviceConfig_t)); RF_Free(config80, sizeof(RF_DeviceConfig_t80)); @@ -146,3 +146,74 @@ rf_get_component_label80(RF_Raid_t *raid return retcode; } + +int +rf_config80(RF_Raid_t *raidPtr, int unit, void *data, RF_Config_t **k_cfgp) +{ + RF_Config_t80 *u80_cfg, *k80_cfg; + RF_Config_t *k_cfg; + size_t i, j; + int error; + + if (raidPtr->valid) { + /* There is a valid RAID set running on this unit! */ + printf("raid%d: Device already configured!\n", unit); + return EINVAL; + } + + /* copy-in the configuration information */ + /* data points to a pointer to the configuration structure */ + + u80_cfg = *((RF_Config_t80 **) data); + RF_Malloc(k80_cfg, sizeof(RF_Config_t80), (RF_Config_t80 *)); + if (k80_cfg == NULL) + return ENOMEM; + + error = copyin(u80_cfg, k80_cfg, sizeof(RF_Config_t80)); + if (error) { + RF_Free(k80_cfg, sizeof(RF_Config_t80)); + return error; + } + RF_Malloc(k_cfg, sizeof(RF_Config_t), (RF_Config_t *)); + if (k_cfg == NULL) { + RF_Free(k80_cfg, sizeof(RF_Config_t80));
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: mrg Date: Sat Jan 20 01:32:45 UTC 2018 Modified Files: src/sys/dev/raidframe: raidframeio.h rf_compat32.h rf_compat80.c rf_compat80.h rf_netbsdkintf.c Log Message: fixes for the previous, noted by nakayama@. - RAIDFRAME_CONFIGURE needs to be versioned as the rows was removed, adding RAIDFRAME_CONFIGURE80, rf_config80() etc. - RAIDFRAME_CONFIGURE32 changes to match - rf_get_info80() passed the wrong source to copyout() some fixes to my original change were independantly made by nakayama@ who confirmed the changes work properly now. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/raidframe/raidframeio.h cvs rdiff -u -r1.1 -r1.2 src/sys/dev/raidframe/rf_compat32.h \ src/sys/dev/raidframe/rf_compat80.c src/sys/dev/raidframe/rf_compat80.h cvs rdiff -u -r1.354 -r1.355 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: macallan Date: Fri Jan 19 23:38:56 UTC 2018 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: add conversion goop for WSDISPLAYIO_LDFONT and _SFONT tested on mips64 To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.90 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.91 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.90 Sun Nov 26 17:46:13 2017 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Fri Jan 19 23:38:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.90 2017/11/26 17:46:13 jmcneill Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.91 2018/01/19 23:38:56 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.90 2017/11/26 17:46:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.91 2018/01/19 23:38:56 macallan Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -400,6 +400,31 @@ netbsd32_to_wsdisplay_cmap(struct netbsd } static inline void +netbsd32_to_wsdisplay_font(struct netbsd32_wsdisplay_font *f32, + struct wsdisplay_font *f, + u_long cmd) +{ + f->name = NETBSD32PTR64(f32->name); + f->firstchar = f32->firstchar; + f->numchars = f32->numchars; + f->encoding = f32->encoding; + f->fontwidth = f32->fontwidth; + f->fontheight = f32->fontheight; + f->stride = f32->stride; + f->bitorder = f32->bitorder; + f->byteorder = f32->byteorder; + f->data = NETBSD32PTR64(f32->data); +} + +static inline void +netbsd32_to_wsdisplay_usefontdata(struct netbsd32_wsdisplay_usefontdata *f32, + struct wsdisplay_usefontdata *f, + u_long cmd) +{ + f->name = NETBSD32PTR64(f32->name); +} + +static inline void netbsd32_to_clockctl_settimeofday( const struct netbsd32_clockctl_settimeofday *s32p, struct clockctl_settimeofday *p, @@ -767,6 +792,20 @@ netbsd32_from_wsdisplay_cmap(struct wsdi } static inline void +netbsd32_from_wsdisplay_font(struct wsdisplay_font *f, + struct netbsd32_wsdisplay_font *f32, + u_long cmd) +{ +} + +static inline void +netbsd32_from_wsdisplay_usefontdata(struct wsdisplay_usefontdata *f, + struct netbsd32_wsdisplay_usefontdata *f32, + u_long cmd) +{ +} + +static inline void netbsd32_from_ieee80211req(struct ieee80211req *ireq, struct netbsd32_ieee80211req *ireq32, u_long cmd) { @@ -1317,6 +1356,11 @@ netbsd32_ioctl(struct lwp *l, const stru case WSDISPLAYIO_PUTCMAP32: IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_PUTCMAP, wsdisplay_cmap); + case WSDISPLAYIO_LDFONT32: + IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_LDFONT, wsdisplay_font); + case WSDISPLAYIO_SFONT32: + IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_SFONT, wsdisplay_usefontdata); + case SIOCS8021132: IOCTL_STRUCT_CONV_TO(SIOCS80211, ieee80211req); case SIOCG8021132: Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.57 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.58 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.57 Sun Nov 26 17:46:13 2017 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Fri Jan 19 23:38:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.57 2017/11/26 17:46:13 jmcneill Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.58 2018/01/19 23:38:56 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -179,6 +179,21 @@ struct netbsd32_wsdisplay_cursor { #define WSDISPLAYIO_GCURSOR32 _IOWR('W', 73, struct netbsd32_wsdisplay_cursor) #define WSDISPLAYIO_SCURSOR32 _IOW('W', 74, struct netbsd32_wsdisplay_cursor) +struct netbsd32_wsdisplay_font { + netbsd32_charp name; + int firstchar, numchars; + int encoding; + u_int fontwidth, fontheight, stride; + int bitorder, byteorder; + netbsd32_charp data; +}; +#define WSDISPLAYIO_LDFONT32 _IOW('W', 77, struct netbsd32_wsdisplay_font) + +struct netbsd32_wsdisplay_usefontdata { + netbsd32_charp name; +}; +#define WSDISPLAYIO_SFONT32 _IOW('W', 80, struct netbsd32_wsdisplay_usefontdata) + /* can wait! */ #if 0 dev/ccdvar.h:219:#define CCDIOCSET _IOWR('F', 16, struct ccd_ioctl) /* enable ccd */
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: macallan Date: Fri Jan 19 23:38:56 UTC 2018 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: add conversion goop for WSDISPLAYIO_LDFONT and _SFONT tested on mips64 To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci/voyager
Module Name:src Committed By: macallan Date: Fri Jan 19 23:37:36 UTC 2018 Modified Files: src/sys/dev/pci/voyager: voyagerfb.c Log Message: enable font loading To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/voyager/voyagerfb.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/pci/voyager/voyagerfb.c diff -u src/sys/dev/pci/voyager/voyagerfb.c:1.28 src/sys/dev/pci/voyager/voyagerfb.c:1.29 --- src/sys/dev/pci/voyager/voyagerfb.c:1.28 Wed Jan 13 15:56:05 2016 +++ src/sys/dev/pci/voyager/voyagerfb.c Fri Jan 19 23:37:36 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: voyagerfb.c,v 1.28 2016/01/13 15:56:05 macallan Exp $ */ +/* $NetBSD: voyagerfb.c,v 1.29 2018/01/19 23:37:36 macallan Exp $ */ /* * Copyright (c) 2009, 2011 Michael Lorenz @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.28 2016/01/13 15:56:05 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.29 2018/01/19 23:37:36 macallan Exp $"); #include #include @@ -287,7 +287,8 @@ voyagerfb_attach(device_t parent, device 0, 0, NULL, 8, 16, - WSSCREEN_WSCOLORS | WSSCREEN_HILIT, + WSSCREEN_WSCOLORS | WSSCREEN_HILIT | WSSCREEN_UNDERLINE | + WSSCREEN_RESIZE, NULL }; sc->sc_screens[0] = >sc_defaultscreen_descr; @@ -298,6 +299,8 @@ voyagerfb_attach(device_t parent, device vcons_init(>vd, sc, >sc_defaultscreen_descr, _accessops); sc->vd.init_screen = voyagerfb_init_screen; + sc->vd.show_screen_cookie = >sc_gc; + sc->vd.show_screen_cb = glyphcache_adapt; /* backlight control */ voyagerfb_setup_backlight(sc); @@ -586,7 +589,7 @@ voyagerfb_init_screen(void *cookie, stru if (sc->sc_depth == 8) { ri->ri_flg |= RI_8BIT_IS_RGB; #ifdef VOYAGERFB_ANTIALIAS - ri->ri_flg |= RI_ENABLE_ALPHA; + ri->ri_flg |= RI_ENABLE_ALPHA | RI_PREFER_ALPHA; #endif } if (sc->sc_depth == 32) { @@ -602,8 +605,11 @@ voyagerfb_init_screen(void *cookie, stru ri->ri_bpos = 0; } + scr->scr_flags |= VCONS_LOADFONT; + rasops_init(ri, 0, 0); - ri->ri_caps = WSSCREEN_WSCOLORS; + ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_HILIT | WSSCREEN_UNDERLINE | + WSSCREEN_RESIZE; rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight, sc->sc_width / ri->ri_font->fontwidth);
CVS commit: src/sys/dev/pci/voyager
Module Name:src Committed By: macallan Date: Fri Jan 19 23:37:36 UTC 2018 Modified Files: src/sys/dev/pci/voyager: voyagerfb.c Log Message: enable font loading To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/voyager/voyagerfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/libexec/ld.elf_so/arch/mips
Module Name:src Committed By: christos Date: Fri Jan 19 23:17:41 UTC 2018 Modified Files: src/libexec/ld.elf_so/arch/mips: mips_reloc.c Log Message: don't forget to eat the high bits. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/libexec/ld.elf_so/arch/mips/mips_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/arch/mips/mips_reloc.c diff -u src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.71 src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.72 --- src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.71 Mon Dec 25 00:29:27 2017 +++ src/libexec/ld.elf_so/arch/mips/mips_reloc.c Fri Jan 19 18:17:41 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_reloc.c,v 1.71 2017/12/25 05:29:27 maya Exp $ */ +/* $NetBSD: mips_reloc.c,v 1.72 2018/01/19 23:17:41 christos Exp $ */ /* * Copyright 1997 Michael L. Hitch@@ -30,7 +30,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mips_reloc.c,v 1.71 2017/12/25 05:29:27 maya Exp $"); +__RCSID("$NetBSD: mips_reloc.c,v 1.72 2018/01/19 23:17:41 christos Exp $"); #endif /* not lint */ #include @@ -319,7 +319,7 @@ _rtld_relocate_nonplt_objects(Obj_Entry where = obj->relocbase + rel->r_offset; - switch (ELF_R_TYPE(rel->r_info)) { + switch (ELF_R_TYPE(rel->r_info) & 0xff) { #if ELFSIZE == 64 case R_TYPE(TLS_DTPMOD64): case R_TYPE(TLS_DTPREL64): @@ -342,7 +342,7 @@ _rtld_relocate_nonplt_objects(Obj_Entry break; } - switch (ELF_R_TYPE(rel->r_info)) { + switch (ELF_R_TYPE(rel->r_info) & 0xff) { case R_TYPE(NONE): break;
CVS commit: src/libexec/ld.elf_so/arch/mips
Module Name:src Committed By: christos Date: Fri Jan 19 23:17:41 UTC 2018 Modified Files: src/libexec/ld.elf_so/arch/mips: mips_reloc.c Log Message: don't forget to eat the high bits. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/libexec/ld.elf_so/arch/mips/mips_reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
re: CVS commit: src
oh, i think i see what the problem is. not sure how i missed that, though much of my earlier testing was done without that change in place, it was only after review from oster@ that we pushed to remove more of the unused 'row' stuff. .mrg.
re: CVS commit: src
> The kernel with this changes cannot configure the RAIDframe device > with old raidctl(8) as follows, since RF_Config_s has been changed > (remove numRow) but no compat code. > > | dk_lookup on device: failed! > | RAIDFRAME: failed rf_ConfigureDisks with 2 > | raidctl: ioctl (RAIDFRAME_CONFIGURE) failed: No such file or directory hmm, this should work. it's supposed to have compat and i did test this. the above message is missing devName: error = dk_lookup(pb, curlwp, ); pathbuf_destroy(pb); if (error) { printf("dk_lookup on device: %s failed!\n", diskPtr->devname); so something rather odd is happening here. can you send me more details about your setup? is it autoconfig? is there a raidN.conf you're using? for a working kernel, can you send me the raidctl -g and -s output? thanks. .mrg.
CVS commit: src/sys/net
Module Name:src Committed By: maxv Date: Fri Jan 19 15:04:29 UTC 2018 Modified Files: src/sys/net: if_mpls.c Log Message: Several changes: * Declare TRIM_LABEL as a function. * In mpls_unlabel_inet, copy the label locally. It's not incorrect to keep a pointer on the mbuf, but it's bug-friendly. * In mpls_label_inetX, fix the length check. Meanwhile add an XXX: we just want to make sure that m_copydata won't fail, but if we were guaranteed that m has M_PKTHDR set, we could simply check the length against m->m_pkthdr.len. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_mpls.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_mpls.c diff -u src/sys/net/if_mpls.c:1.32 src/sys/net/if_mpls.c:1.33 --- src/sys/net/if_mpls.c:1.32 Sat Dec 9 10:30:30 2017 +++ src/sys/net/if_mpls.c Fri Jan 19 15:04:29 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mpls.c,v 1.32 2017/12/09 10:30:30 maxv Exp $ */ +/* $NetBSD: if_mpls.c,v 1.33 2018/01/19 15:04:29 maxv Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.32 2017/12/09 10:30:30 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.33 2018/01/19 15:04:29 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -74,22 +74,12 @@ __KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v #include "ioconf.h" -#define TRIM_LABEL do { \ - m_adj(m, sizeof(union mpls_shim)); \ - if (m->m_len < sizeof(union mpls_shim) && \ - (m = m_pullup(m, sizeof(union mpls_shim))) == NULL) \ - goto done; \ - dst.smpls_addr.s_addr = ntohl(mtod(m, union mpls_shim *)->s_addr); \ - } while (/* CONSTCOND */ 0) - - static int mpls_clone_create(struct if_clone *, int); static int mpls_clone_destroy(struct ifnet *); static struct if_clone mpls_if_cloner = IF_CLONE_INITIALIZER("mpls", mpls_clone_create, mpls_clone_destroy); - static void mpls_input(struct ifnet *, struct mbuf *); static int mpls_output(struct ifnet *, struct mbuf *, const struct sockaddr *, const struct rtentry *); @@ -303,7 +293,7 @@ mpls_output(struct ifnet *ifp, struct mb ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; - if ((rt1=rtalloc1(rt->rt_gateway, 1)) == NULL) { + if ((rt1 = rtalloc1(rt->rt_gateway, 1)) == NULL) { m_freem(m); return EHOSTUNREACH; } @@ -347,6 +337,20 @@ mpls_ioctl(struct ifnet *ifp, u_long cmd return error; } +static inline struct mbuf * +mpls_trim_label(struct mbuf *m, union mpls_shim *sh) +{ + m_adj(m, sizeof(union mpls_shim)); + + if (m->m_len < sizeof(union mpls_shim) && + (m = m_pullup(m, sizeof(union mpls_shim))) == NULL) + return NULL; + + sh->s_addr = ntohl(mtod(m, union mpls_shim *)->s_addr); + + return m; +} + /* * MPLS Label Switch Engine */ @@ -384,14 +388,21 @@ mpls_lse(struct mbuf *m) if (mpls_rfc4182 != 0) { while ((dst.smpls_addr.shim.label == MPLS_LABEL_IPV4NULL || dst.smpls_addr.shim.label == MPLS_LABEL_IPV6NULL) && - __predict_false(dst.smpls_addr.shim.bos == 0)) - TRIM_LABEL; + __predict_false(dst.smpls_addr.shim.bos == 0)) { + m = mpls_trim_label(m, _addr); + if (m == NULL) { +goto done; + } + } } /* RFC 3032 Section 2.1 Page 4 */ if (__predict_false(dst.smpls_addr.shim.label == MPLS_LABEL_RTALERT) && dst.smpls_addr.shim.bos == 0) { - TRIM_LABEL; + m = mpls_trim_label(m, _addr); + if (m == NULL) { + goto done; + } push_back_alert = true; } @@ -428,9 +439,9 @@ mpls_lse(struct mbuf *m) goto done; /* Get a route to dst */ - dst.smpls_addr.shim.ttl = - dst.smpls_addr.shim.bos = - dst.smpls_addr.shim.exp = 0; + dst.smpls_addr.shim.ttl = 0; + dst.smpls_addr.shim.bos = 0; + dst.smpls_addr.shim.exp = 0; dst.smpls_addr.s_addr = htonl(dst.smpls_addr.s_addr); if ((rt = rtalloc1((const struct sockaddr*), 1)) == NULL) goto done; @@ -537,13 +548,12 @@ static struct mbuf * mpls_unlabel_inet(struct mbuf *m, int *error) { struct ip *iph; - union mpls_shim *ms; + union mpls_shim ms; int iphlen; if (mpls_mapttl_inet || mpls_mapprec_inet) { /* get shim info */ - ms = mtod(m, union mpls_shim *); - ms->s_addr = ntohl(ms->s_addr); + ms.s_addr = ntohl(mtod(m, union mpls_shim *)->s_addr); /* and get rid of it */ m_adj(m, sizeof(union mpls_shim)); @@ -576,12 +586,12 @@ mpls_unlabel_inet(struct mbuf *m, int *e /* set IP ttl from MPLS ttl */ if (mpls_mapttl_inet) - iph->ip_ttl = ms->shim.ttl; + iph->ip_ttl = ms.shim.ttl; /* set IP Precedence from MPLS Exp */ if (mpls_mapprec_inet) { iph->ip_tos = (iph->ip_tos << 3) >> 3; - iph->ip_tos |= ms->shim.exp << 5; + iph->ip_tos |= ms.shim.exp << 5; } /* reset ipsum because we modified TTL and TOS */ @@ -611,9 +621,11 @@ mpls_label_inet(struct mbuf *m, union mp struct ip iphdr; if (mpls_mapttl_inet || mpls_mapprec_inet) { -
CVS commit: src/sys/net
Module Name:src Committed By: maxv Date: Fri Jan 19 15:04:29 UTC 2018 Modified Files: src/sys/net: if_mpls.c Log Message: Several changes: * Declare TRIM_LABEL as a function. * In mpls_unlabel_inet, copy the label locally. It's not incorrect to keep a pointer on the mbuf, but it's bug-friendly. * In mpls_label_inetX, fix the length check. Meanwhile add an XXX: we just want to make sure that m_copydata won't fail, but if we were guaranteed that m has M_PKTHDR set, we could simply check the length against m->m_pkthdr.len. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_mpls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src
>>> "matthew green"wrote > Module Name: src > Committed By: mrg > Date: Thu Jan 18 00:32:49 UTC 2018 > > Modified Files: > src/sbin/raidctl: raidctl.8 raidctl.c rf_configure.c > src/sys/conf: files > src/sys/dev/raidframe: files.raidframe raidframeio.h raidframevar.h > rf_compat50.c rf_decluster.c rf_decluster.h rf_kintf.h > rf_netbsdkintf.c rf_reconutil.c > src/sys/modules/raid: Makefile > src/sys/rump: Makefile.rump > src/sys/rump/dev/lib/libraidframe: Makefile > src/tests/dev/raidframe: t_raid.sh > Added Files: > src/sys/dev/raidframe: rf_compat32.c rf_compat32.h rf_compat80.c > rf_compat80.h > > Log Message: > implement 32-bit compat support for raidframe. > > convert several raidframe ioctls to be bitsize idempotent so that > they work the same in 32 and 64 bit worlds, allowing netbsd32 to > configure and query raid properly. remove useless 'row' in a few > places. add COMPAT_80 and put the old ioctls there. > > raidframeio.h: > RAIDFRAME_TEST_ACC > - remove, unused > RAIDFRAME_GET_COMPONENT_LABEL > - convert to label not pointer to label > RAIDFRAME_CHECK_RECON_STATUS_EXT > RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT > RAIDFRAME_CHECK_COPYBACK_STATUS_EXT > - convert to progress info not pointer to info > RAIDFRAME_GET_INFO > - version entirely. > raidframevar.h: > - rf_recon_req{} has row, flags and raidPtr removed (they're > not a useful part of this interface.) > - RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed. > - RF_RaidDisk_s{} is re-ordered slightly to fix alignment > padding - the actual data was already OK. > - InstallSpareTable() loses row argument > > rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used > by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32. > > rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and > RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK, > RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT, > RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT, > RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO. > > move several of the per-ioctl code blocks into separate functions. > > add rf_recon_req_internal{} to replace old usage of global > rf_recon_req{} that had unused void * in the structure, ruining > it's 32/64 bit ABI. > > add missing case for RAIDFRAME_GET_INFO50. > > adjust raid tests to use the new .conf format, and add a case to > test the old method as well. > > raidctl: > deal with lack of 'row' members in a couple of places. > fail request no longer takes row. > handle "START array" sections with just "numCol numSpare", ie > no "numRow" specified. for now, generate old-style configuration > but update raidctl.8 to specify the new style (keeping reference > to the old style.) > > note that: RF_ComponentLabel_s::{row,num_rows} and > RF_SingleComponent_s::row are obsolete but not removed yet. > > > To generate a diff of this commit: > cvs rdiff -u -r1.73 -r1.74 src/sbin/raidctl/raidctl.8 > cvs rdiff -u -r1.65 -r1.66 src/sbin/raidctl/raidctl.c > cvs rdiff -u -r1.32 -r1.33 src/sbin/raidctl/rf_configure.c > cvs rdiff -u -r1.1191 -r1.1192 src/sys/conf/files > cvs rdiff -u -r1.9 -r1.10 src/sys/dev/raidframe/files.raidframe > cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/raidframeio.h \ > src/sys/dev/raidframe/rf_decluster.h > cvs rdiff -u -r1.17 -r1.18 src/sys/dev/raidframe/raidframevar.h > cvs rdiff -u -r0 -r1.1 src/sys/dev/raidframe/rf_compat32.c \ > src/sys/dev/raidframe/rf_compat32.h src/sys/dev/raidframe/rf_compat80.c \ > src/sys/dev/raidframe/rf_compat80.h > cvs rdiff -u -r1.2 -r1.3 src/sys/dev/raidframe/rf_compat50.c > cvs rdiff -u -r1.24 -r1.25 src/sys/dev/raidframe/rf_decluster.c \ > src/sys/dev/raidframe/rf_kintf.h > cvs rdiff -u -r1.352 -r1.353 src/sys/dev/raidframe/rf_netbsdkintf.c > cvs rdiff -u -r1.35 -r1.36 src/sys/dev/raidframe/rf_reconutil.c > cvs rdiff -u -r1.1 -r1.2 src/sys/modules/raid/Makefile > cvs rdiff -u -r1.122 -r1.123 src/sys/rump/Makefile.rump > cvs rdiff -u -r1.10 -r1.11 src/sys/rump/dev/lib/libraidframe/Makefile > cvs rdiff -u -r1.12 -r1.13 src/tests/dev/raidframe/t_raid.sh > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. The kernel with this changes cannot configure the RAIDframe device with old raidctl(8) as follows, since RF_Config_s has been changed (remove numRow) but no compat code. | dk_lookup on device: failed! | RAIDFRAME: failed rf_ConfigureDisks with 2 | raidctl: ioctl (RAIDFRAME_CONFIGURE) failed: No such file or directory -- Takeshi Nakayama
CVS commit: src/usr.sbin/traceroute
Module Name:src Committed By: maxv Date: Fri Jan 19 14:30:09 UTC 2018 Modified Files: src/usr.sbin/traceroute: traceroute.c Log Message: Fix build failure, the structure is already defined now. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/usr.sbin/traceroute/traceroute.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/traceroute
Module Name:src Committed By: maxv Date: Fri Jan 19 14:30:09 UTC 2018 Modified Files: src/usr.sbin/traceroute: traceroute.c Log Message: Fix build failure, the structure is already defined now. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/usr.sbin/traceroute/traceroute.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/traceroute/traceroute.c diff -u src/usr.sbin/traceroute/traceroute.c:1.83 src/usr.sbin/traceroute/traceroute.c:1.84 --- src/usr.sbin/traceroute/traceroute.c:1.83 Wed Feb 17 19:57:01 2016 +++ src/usr.sbin/traceroute/traceroute.c Fri Jan 19 14:30:09 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: traceroute.c,v 1.83 2016/02/17 19:57:01 christos Exp $ */ +/* $NetBSD: traceroute.c,v 1.84 2018/01/19 14:30:09 maxv Exp $ */ /* * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000 @@ -30,7 +30,7 @@ static const char rcsid[] = __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997,\ 1998, 1999, 2000\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: traceroute.c,v 1.83 2016/02/17 19:57:01 christos Exp $"); +__RCSID("$NetBSD: traceroute.c,v 1.84 2018/01/19 14:30:09 maxv Exp $"); #endif #endif @@ -292,34 +292,13 @@ struct outdata { * * http://www.ietf.org/proceedings/01aug/I-D/draft-ietf-mpls-icmp-02.txt */ +#ifdef ICMP_EXT_OFFSET +#undef ICMP_EXT_OFFSET +#endif #define ICMP_EXT_OFFSET8 /* ICMP type, code, checksum, unused */ + \ 128 /* original datagram */ -#define ICMP_EXT_VERSION 2 -/* - * ICMP extensions, common header - */ -struct icmp_ext_cmn_hdr { -#if BYTE_ORDER == BIG_ENDIAN - unsigned char version:4; - unsigned char reserved1:4; -#else - unsigned char reserved1:4; - unsigned char version:4; -#endif - unsigned char reserved2; - unsigned short checksum; -}; - -/* - * ICMP extensions, object header - */ -struct icmp_ext_obj_hdr { -u_short length; -u_char class_num; #define MPLS_STACK_ENTRY_CLASS 1 -u_char c_type; #define MPLS_STACK_ENTRY_C_TYPE 1 -}; struct mpls_header { #if BYTE_ORDER == BIG_ENDIAN @@ -1124,7 +1103,7 @@ wait_for_reply(int sock, struct sockaddr static void decode_extensions(unsigned char *buf, int ip_len) { -struct icmp_ext_cmn_hdr *cmn_hdr; +struct icmp_ext_hdr *cmn_hdr; struct icmp_ext_obj_hdr *obj_hdr; union { struct mpls_header mpls; @@ -1136,7 +1115,7 @@ decode_extensions(unsigned char *buf, in ip = (struct ip *)buf; if (ip_len < (int)((ip->ip_hl << 2) + ICMP_EXT_OFFSET + - sizeof(struct icmp_ext_cmn_hdr))) { + sizeof(struct icmp_ext_hdr))) { /* * No support for ICMP extensions on this host */ @@ -1147,7 +1126,7 @@ decode_extensions(unsigned char *buf, in * Move forward to the start of the ICMP extensions, if present */ buf += (ip->ip_hl << 2) + ICMP_EXT_OFFSET; -cmn_hdr = (struct icmp_ext_cmn_hdr *)buf; +cmn_hdr = (struct icmp_ext_hdr *)buf; if (cmn_hdr->version != ICMP_EXT_VERSION) { /*
CVS commit: src/sys/netmpls
Module Name:src Committed By: maxv Date: Fri Jan 19 14:15:35 UTC 2018 Modified Files: src/sys/netmpls: mpls_ttl.c Log Message: Add XXX. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/netmpls/mpls_ttl.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/netmpls/mpls_ttl.c diff -u src/sys/netmpls/mpls_ttl.c:1.10 src/sys/netmpls/mpls_ttl.c:1.11 --- src/sys/netmpls/mpls_ttl.c:1.10 Fri Jan 19 10:54:31 2018 +++ src/sys/netmpls/mpls_ttl.c Fri Jan 19 14:15:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: mpls_ttl.c,v 1.10 2018/01/19 10:54:31 maxv Exp $ */ +/* $NetBSD: mpls_ttl.c,v 1.11 2018/01/19 14:15:35 maxv Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mpls_ttl.c,v 1.10 2018/01/19 10:54:31 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpls_ttl.c,v 1.11 2018/01/19 14:15:35 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -147,7 +147,11 @@ static struct mbuf *ip4_check(struct mbu * Send an ICMP Extended error message. References: RFC4884 and RFC4950. * * This should be in sync with icmp_error() in sys/netinet/ip_icmp.c - * XXX: is called only for ICMP_TIMXCEED_INTRANS but code is too general + * XXX: is called only for ICMP_TIMXCEED_INTRANS but code is too general. + * + * XXX We're not setting the 'length' field of the Extended ICMP header. + * According to RFC4884, we are in 'non-compliant' mode. Moreover, we're + * not computing the checksum of the Extended ICMP header. */ static void mpls_icmp_error(struct mbuf *n, int type, int code, n_long dest, @@ -162,7 +166,7 @@ mpls_icmp_error(struct mbuf *n, int type memset(_icmp_ext, 0, sizeof(mpls_icmp_ext)); mpls_icmp_ext.cmn_hdr.version = ICMP_EXT_VERSION; - mpls_icmp_ext.cmn_hdr.checksum = 0; + mpls_icmp_ext.cmn_hdr.checksum = 0; /* XXX */ mpls_icmp_ext.obj_hdr.length = htons(sizeof(union mpls_shim) + sizeof(struct icmp_ext_obj_hdr));
CVS commit: src/sys/netmpls
Module Name:src Committed By: maxv Date: Fri Jan 19 14:15:35 UTC 2018 Modified Files: src/sys/netmpls: mpls_ttl.c Log Message: Add XXX. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/netmpls/mpls_ttl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/net
Le 19/01/2018 à 13:31, Takeshi Nakayama a écrit : Module Name:src Committed By: nakayama Date: Fri Jan 19 12:31:28 UTC 2018 Modified Files: src/sys/net: if_ethersubr.c Log Message: Fix inverted logic. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/net/if_ethersubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Ah yes, my bad, sorry about that. When I saw this ugly #ifdef DIAGNOSTIC and panic I just machinally replaced it by KASSERTMSG. Maxime
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 13:17:29 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.c Log Message: Fix a buffer overflow in icmp_error. We create in 'm' a packet that must contain: IPv4 header | Fixed part of ICMP header | Variable part of ICMP header But we perform length checks on 'totlen', which does not count the IPv4 header. So now, add sizeof(struct ip) in totlen, and stop doing this m_data nonsense, just get the pointers as usual. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/netinet/ip_icmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 13:17:29 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.c Log Message: Fix a buffer overflow in icmp_error. We create in 'm' a packet that must contain: IPv4 header | Fixed part of ICMP header | Variable part of ICMP header But we perform length checks on 'totlen', which does not count the IPv4 header. So now, add sizeof(struct ip) in totlen, and stop doing this m_data nonsense, just get the pointers as usual. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/netinet/ip_icmp.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/netinet/ip_icmp.c diff -u src/sys/netinet/ip_icmp.c:1.162 src/sys/netinet/ip_icmp.c:1.163 --- src/sys/netinet/ip_icmp.c:1.162 Fri Jan 19 12:50:27 2018 +++ src/sys/netinet/ip_icmp.c Fri Jan 19 13:17:29 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.162 2018/01/19 12:50:27 maxv Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.163 2018/01/19 13:17:29 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -94,7 +94,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.162 2018/01/19 12:50:27 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.163 2018/01/19 13:17:29 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -260,7 +260,8 @@ icmp_error(struct mbuf *n, int type, int struct icmp *icp; struct mbuf *m; struct m_tag *mtag; - unsigned datalen, mblen, totlen; + unsigned datalen, mblen; + int totlen; #ifdef ICMPPRINTFS if (icmpprintfs) @@ -315,10 +316,12 @@ icmp_error(struct mbuf *n, int type, int * Compute the total length of the new packet. Truncate it if it's * bigger than the size of a cluster. */ - CTASSERT(ICMP_MINLEN <= MCLBYTES); - if (datalen + ICMP_MINLEN > MCLBYTES) - datalen = MCLBYTES - ICMP_MINLEN; - totlen = datalen + ICMP_MINLEN; + CTASSERT(ICMP_MINLEN + sizeof(struct ip) <= MCLBYTES); + totlen = sizeof(struct ip) + ICMP_MINLEN + datalen; + if (totlen > MCLBYTES) { + datalen = MCLBYTES - ICMP_MINLEN - sizeof(struct ip); + totlen = MCLBYTES; + } /* * Allocate the mbuf for the new packet. @@ -335,26 +338,23 @@ icmp_error(struct mbuf *n, int type, int goto freeit; MCLAIM(m, n->m_owner); m->m_len = totlen; - - /* - * Advance to the ICMP header. - */ - if ((m->m_flags & M_EXT) == 0) { - MH_ALIGN(m, m->m_len); - } else { - m->m_data += sizeof(struct ip); - m->m_len -= sizeof(struct ip); - } + m->m_pkthdr.len = m->m_len; + m_copy_rcvif(m, n); if ((u_int)type > ICMP_MAXTYPE) panic("icmp_error"); ICMP_STATINC(ICMP_STAT_OUTHIST + type); /* + * Get pointers on the IP header and the ICMP header. + */ + nip = mtod(m, struct ip *); + icp = (struct icmp *)(nip + 1); + + /* * Fill in the fields of the ICMP header: icmp_type, icmp_code * and icmp_ip. icmp_cksum gets filled later. */ - icp = mtod(m, struct icmp *); icp->icmp_type = type; if (type == ICMP_REDIRECT) { icp->icmp_gwaddr.s_addr = dest; @@ -375,21 +375,9 @@ icmp_error(struct mbuf *n, int type, int m_copydata(n, 0, datalen, (void *)>icmp_ip); /* - * Come back to the IP header. - */ - if ((m->m_flags & M_EXT) == 0 && - m->m_data - sizeof(struct ip) < m->m_pktdat) - panic("icmp len"); - m->m_data -= sizeof(struct ip); - m->m_len += sizeof(struct ip); - m->m_pkthdr.len = m->m_len; - m_copy_rcvif(m, n); - - /* * Now, copy the old IP header (without options) in front of the * ICMP message. The src/dst fields will be swapped in icmp_reflect. */ - nip = mtod(m, struct ip *); /* ip_v set in ip_output */ nip->ip_hl = sizeof(struct ip) >> 2; nip->ip_tos = 0;
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 12:50:27 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.c Log Message: Clarify icmp_error: * Rename (and constify) oiplen -> oiphlen. * Rename icmplen -> datalen, it's the size of the variable part of the ICMP header, not the total size of the ICMP header itself. * Introduce totlen, this is the total size of the ICMP header (icmp_ip included). No real functional change. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/netinet/ip_icmp.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/netinet/ip_icmp.c diff -u src/sys/netinet/ip_icmp.c:1.161 src/sys/netinet/ip_icmp.c:1.162 --- src/sys/netinet/ip_icmp.c:1.161 Fri Mar 31 06:49:44 2017 +++ src/sys/netinet/ip_icmp.c Fri Jan 19 12:50:27 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.161 2017/03/31 06:49:44 ozaki-r Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.162 2018/01/19 12:50:27 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -94,7 +94,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.161 2017/03/31 06:49:44 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.162 2018/01/19 12:50:27 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -242,45 +242,55 @@ icmp_mtudisc_callback_register(void (*fu } /* - * Generate an error packet of type error - * in response to bad packet ip. + * Generate an error packet of type error in response to a bad IP packet. 'n' + * contains this packet. We create 'm' and send it. + * + * As we are not required to return everything we have, we return whatever + * we can return at ease. + * + * Note that ICMP datagrams longer than 576 octets are out of spec according + * to RFC1812; the limit on icmpreturndatabytes will keep things below that + * limit. */ void -icmp_error(struct mbuf *n, int type, int code, n_long dest, -int destmtu) +icmp_error(struct mbuf *n, int type, int code, n_long dest, int destmtu) { struct ip *oip = mtod(n, struct ip *), *nip; - unsigned oiplen = oip->ip_hl << 2; + const unsigned oiphlen = oip->ip_hl << 2; struct icmp *icp; struct mbuf *m; struct m_tag *mtag; - unsigned icmplen, mblen; + unsigned datalen, mblen, totlen; #ifdef ICMPPRINTFS if (icmpprintfs) printf("icmp_error(%p, type:%d, code:%d)\n", oip, type, code); #endif + if (type != ICMP_REDIRECT) ICMP_STATINC(ICMP_STAT_ERROR); + /* - * Don't send error if the original packet was encrypted. - * Don't send error if not the first fragment of message. - * Don't error if the old packet protocol was ICMP - * error message, only known informational types. + * Don't send error if: + * - The original packet was encrypted. + * - The packet is multicast or broadcast. + * - The packet is not the first fragment of the message. + * - The packet is an ICMP message with an unknown type. */ if (n->m_flags & M_DECRYPTED) goto freeit; + if (n->m_flags & (M_BCAST|M_MCAST)) + goto freeit; if (oip->ip_off &~ htons(IP_MF|IP_DF)) goto freeit; if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT && - n->m_len >= oiplen + ICMP_MINLEN && - !ICMP_INFOTYPE(((struct icmp *)((char *)oip + oiplen))->icmp_type)) { - ICMP_STATINC(ICMP_STAT_OLDICMP); - goto freeit; + n->m_len >= oiphlen + ICMP_MINLEN) { + struct icmp *oicp = (struct icmp *)((char *)oip + oiphlen); + if (!ICMP_INFOTYPE(oicp->icmp_type)) { + ICMP_STATINC(ICMP_STAT_OLDICMP); + goto freeit; + } } - /* Don't send error in response to a multicast or broadcast packet */ - if (n->m_flags & (M_BCAST|M_MCAST)) - goto freeit; /* * First, do a rate limitation check. @@ -291,34 +301,30 @@ icmp_error(struct mbuf *n, int type, int } /* - * Now, formulate icmp message - */ - icmplen = oiplen + min(icmpreturndatabytes, - ntohs(oip->ip_len) - oiplen); - /* - * Defend against mbuf chains shorter than oip->ip_len - oiplen: + * Compute the number of bytes we will put in 'icmp_ip'. Truncate + * it to the size of the mbuf, if it's too big. */ + datalen = oiphlen + min(icmpreturndatabytes, + ntohs(oip->ip_len) - oiphlen); mblen = 0; - for (m = n; m && (mblen < icmplen); m = m->m_next) + for (m = n; m && (mblen < datalen); m = m->m_next) mblen += m->m_len; - icmplen = min(mblen, icmplen); + datalen = min(mblen, datalen); /* - * As we are not required to return everything we have, - * we return whatever we can return at ease. - * - * Note that ICMP datagrams longer than 576 octets are out of spec - * according to RFC1812; the limit on icmpreturndatabytes below in - * icmp_sysctl will keep things below that limit. + * Compute the total length of the new packet. Truncate it if it's + * bigger than the size of a cluster. */ + CTASSERT(ICMP_MINLEN <= MCLBYTES); + if (datalen + ICMP_MINLEN > MCLBYTES) + datalen = MCLBYTES - ICMP_MINLEN; + totlen =
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 12:50:27 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.c Log Message: Clarify icmp_error: * Rename (and constify) oiplen -> oiphlen. * Rename icmplen -> datalen, it's the size of the variable part of the ICMP header, not the total size of the ICMP header itself. * Introduce totlen, this is the total size of the ICMP header (icmp_ip included). No real functional change. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/netinet/ip_icmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: nakayama Date: Fri Jan 19 12:47:42 UTC 2018 Modified Files: src/sys/arch/sparc64/sparc64: cpu.c Log Message: sun4v doesn't have %ver register. To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/arch/sparc64/sparc64/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: nakayama Date: Fri Jan 19 12:47:42 UTC 2018 Modified Files: src/sys/arch/sparc64/sparc64: cpu.c Log Message: sun4v doesn't have %ver register. To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/arch/sparc64/sparc64/cpu.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/arch/sparc64/sparc64/cpu.c diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.133 src/sys/arch/sparc64/sparc64/cpu.c:1.134 --- src/sys/arch/sparc64/sparc64/cpu.c:1.133 Tue Jan 16 08:23:18 2018 +++ src/sys/arch/sparc64/sparc64/cpu.c Fri Jan 19 12:47:41 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.133 2018/01/16 08:23:18 mrg Exp $ */ +/* $NetBSD: cpu.c,v 1.134 2018/01/19 12:47:41 nakayama Exp $ */ /* * Copyright (c) 1996 @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.133 2018/01/16 08:23:18 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.134 2018/01/19 12:47:41 nakayama Exp $"); #include "opt_multiprocessor.h" @@ -549,8 +549,8 @@ cpu_attach(device_t parent, device_t dev aprint_normal(": %s, CPU id %d\n", buf, ci->ci_cpuid); aprint_naive("\n"); - ci->ci_ver = getver(); if (CPU_ISSUN4U || CPU_ISSUN4US) { + ci->ci_ver = getver(); aprint_normal_dev(dev, "manuf %x, impl %x, mask %x\n", (u_int)GETVER_CPU_MANUF(), (u_int)GETVER_CPU_IMPL(),
CVS commit: src/sys/net
Module Name:src Committed By: nakayama Date: Fri Jan 19 12:31:28 UTC 2018 Modified Files: src/sys/net: if_ethersubr.c Log Message: Fix inverted logic. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/net/if_ethersubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/net
Module Name:src Committed By: nakayama Date: Fri Jan 19 12:31:28 UTC 2018 Modified Files: src/sys/net: if_ethersubr.c Log Message: Fix inverted logic. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/net/if_ethersubr.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_ethersubr.c diff -u src/sys/net/if_ethersubr.c:1.256 src/sys/net/if_ethersubr.c:1.257 --- src/sys/net/if_ethersubr.c:1.256 Mon Jan 15 14:00:34 2018 +++ src/sys/net/if_ethersubr.c Fri Jan 19 12:31:27 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.256 2018/01/15 14:00:34 maxv Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.257 2018/01/19 12:31:27 nakayama Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.256 2018/01/15 14:00:34 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.257 2018/01/19 12:31:27 nakayama Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -756,7 +756,7 @@ ether_input(struct ifnet *ifp, struct mb case ETHERTYPE_SLOWPROTOCOLS: { uint8_t subtype; - KASSERTMSG((m->m_pkthdr.len < sizeof(*eh) + sizeof(subtype)), + KASSERTMSG((m->m_pkthdr.len >= sizeof(*eh) + sizeof(subtype)), "too short slow protocol packet"); m_copydata(m, sizeof(*eh), sizeof(subtype), );
CVS commit: src/sys
Module Name:src Committed By: maxv Date: Fri Jan 19 10:54:31 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.h src/sys/netmpls: mpls_ttl.c Log Message: Move the ICMP Extension structures from mpls_ttl.c to ip_icmp.h; that's part of the ICMP protocol (per RFC4884), and not specific to MPLS. Also add ih_exthdr in struct icmp, the 'length' field appeared. While here, style in MPLS. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/ip_icmp.h cvs rdiff -u -r1.9 -r1.10 src/sys/netmpls/mpls_ttl.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/netinet/ip_icmp.h diff -u src/sys/netinet/ip_icmp.h:1.36 src/sys/netinet/ip_icmp.h:1.37 --- src/sys/netinet/ip_icmp.h:1.36 Fri Jan 19 10:21:24 2018 +++ src/sys/netinet/ip_icmp.h Fri Jan 19 10:54:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.h,v 1.36 2018/01/19 10:21:24 maxv Exp $ */ +/* $NetBSD: ip_icmp.h,v 1.37 2018/01/19 10:54:31 maxv Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -59,6 +59,13 @@ struct icmp { union { int32_t ih_void; + /* Extended Header (RFC4884) */ + struct ih_exthdr { + u_int8_t iex_void1; + u_int8_t iex_length; + u_int16_t iex_void2; + } ih_exthdr __packed; + /* ICMP_PARAMPROB */ u_int8_t ih_pptr; @@ -127,6 +134,33 @@ struct icmp { #define icmp_data icmp_dun.id_data }; +#define ICMP_EXT_VERSION 2 +#define ICMP_EXT_OFFSET 128 + +/* + * ICMP Extension Structure Header (RFC4884). + */ +struct icmp_ext_hdr { +#if BYTE_ORDER == BIG_ENDIAN + u_int8_t version:4; + u_int8_t rsvd1:4; +#else + u_int8_t rsvd1:4; + u_int8_t version:4; +#endif + u_int8_t rsvd2; + u_int16_t checksum; +} __packed; + +/* + * ICMP Extension Object Header (RFC4884). + */ +struct icmp_ext_obj_hdr { + u_int16_t length; + u_int8_t class_num; + u_int8_t c_type; +} __packed; + /* * Lower bounds on packet lengths for various types. * For the error advice packets must first insure that the Index: src/sys/netmpls/mpls_ttl.c diff -u src/sys/netmpls/mpls_ttl.c:1.9 src/sys/netmpls/mpls_ttl.c:1.10 --- src/sys/netmpls/mpls_ttl.c:1.9 Fri Dec 8 17:49:54 2017 +++ src/sys/netmpls/mpls_ttl.c Fri Jan 19 10:54:31 2018 @@ -1,33 +1,4 @@ -/* $NetBSD: mpls_ttl.c,v 1.9 2017/12/08 17:49:54 maxv Exp $ */ - -/* - * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. - * 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. - * 3. Neither the name of the project nor the names of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. - */ +/* $NetBSD: mpls_ttl.c,v 1.10 2018/01/19 10:54:31 maxv Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,6 +37,35 @@ */ /* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * 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. + * 3. Neither the name of the project nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY
CVS commit: src/sys
Module Name:src Committed By: maxv Date: Fri Jan 19 10:54:31 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.h src/sys/netmpls: mpls_ttl.c Log Message: Move the ICMP Extension structures from mpls_ttl.c to ip_icmp.h; that's part of the ICMP protocol (per RFC4884), and not specific to MPLS. Also add ih_exthdr in struct icmp, the 'length' field appeared. While here, style in MPLS. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/ip_icmp.h cvs rdiff -u -r1.9 -r1.10 src/sys/netmpls/mpls_ttl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 10:21:24 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.h Log Message: Style, explain a bit, and fix icmp_radv, it should be icmp_dun.id_radv. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/netinet/ip_icmp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: maxv Date: Fri Jan 19 10:21:24 UTC 2018 Modified Files: src/sys/netinet: ip_icmp.h Log Message: Style, explain a bit, and fix icmp_radv, it should be icmp_dun.id_radv. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/netinet/ip_icmp.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/netinet/ip_icmp.h diff -u src/sys/netinet/ip_icmp.h:1.35 src/sys/netinet/ip_icmp.h:1.36 --- src/sys/netinet/ip_icmp.h:1.35 Fri Feb 17 04:32:10 2017 +++ src/sys/netinet/ip_icmp.h Fri Jan 19 10:21:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.h,v 1.35 2017/02/17 04:32:10 ozaki-r Exp $ */ +/* $NetBSD: ip_icmp.h,v 1.36 2018/01/19 10:21:24 maxv Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -55,57 +55,76 @@ struct icmp { u_int8_t icmp_type; /* type of message, see below */ u_int8_t icmp_code; /* type sub code */ u_int16_t icmp_cksum; /* ones complement cksum of struct */ + union { - u_int8_t ih_pptr; /* ICMP_PARAMPROB */ - struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ + int32_t ih_void; + + /* ICMP_PARAMPROB */ + u_int8_t ih_pptr; + + /* ICMP_REDIRECT */ + struct in_addr ih_gwaddr; + + /* ICMP_ECHO and friends */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + n_short icd_id; + n_short icd_seq; } ih_idseq __packed; - int32_t ih_void; - /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ + /* ICMP_UNREACH_NEEDFRAG (Path MTU Discovery, RFC1191) */ struct ih_pmtu { - n_short ipm_void; - n_short ipm_nextmtu; + n_short ipm_void; + n_short ipm_nextmtu; } ih_pmtu __packed; + + /* ICMP_ROUTERADVERT */ struct ih_rtradv { u_int8_t irt_num_addrs; u_int8_t irt_wpa; u_int16_t irt_lifetime; } ih_rtradv __packed; } icmp_hun /* XXX __packed ??? */; -#define icmp_pptr icmp_hun.ih_pptr -#define icmp_gwaddr icmp_hun.ih_gwaddr -#define icmp_id icmp_hun.ih_idseq.icd_id -#define icmp_seq icmp_hun.ih_idseq.icd_seq -#define icmp_void icmp_hun.ih_void -#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void -#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu -#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs -#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa -#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime + +#define icmp_pptr icmp_hun.ih_pptr +#define icmp_gwaddr icmp_hun.ih_gwaddr +#define icmp_id icmp_hun.ih_idseq.icd_id +#define icmp_seq icmp_hun.ih_idseq.icd_seq +#define icmp_void icmp_hun.ih_void +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime + union { + /* ICMP_TSTAMP and friends */ struct id_ts { - n_time its_otime; - n_time its_rtime; - n_time its_ttime; + n_time its_otime; + n_time its_rtime; + n_time its_ttime; } id_ts __packed; - struct id_ip { - struct ip idi_ip; - /* options and then 64 bits of data */ + + struct id_ip { + struct ip idi_ip; + /* options and then 64 bits of data */ } id_ip /* XXX: __packed ??? */; + + /* ICMP_ROUTERADVERT */ struct icmp_ra_addr id_radv; + + /* ICMP_MASKREQ and friends */ u_int32_t id_mask; - int8_t id_data[1]; + + int8_t id_data[1]; } icmp_dun /* XXX __packed ??? */; -#define icmp_otime icmp_dun.id_ts.its_otime -#define icmp_rtime icmp_dun.id_ts.its_rtime -#define icmp_ttime icmp_dun.id_ts.its_ttime -#define icmp_ip icmp_dun.id_ip.idi_ip -#define icmp_radv icmp_dun.id_mask -#define icmp_mask icmp_dun.id_mask -#define icmp_data icmp_dun.id_data + +#define icmp_otime icmp_dun.id_ts.its_otime +#define icmp_rtime icmp_dun.id_ts.its_rtime +#define icmp_ttime icmp_dun.id_ts.its_ttime +#define icmp_ip icmp_dun.id_ip.idi_ip +#define icmp_radv icmp_dun.id_radv +#define icmp_mask icmp_dun.id_mask +#define icmp_data icmp_dun.id_data }; /*
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: skrll Date: Fri Jan 19 09:04:24 UTC 2018 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: Fix some ARM kernel builds. ARM abuses compat32 for ABI compatibility and this means some ioctls overlap. To generate a diff of this commit: cvs rdiff -u -r1.353 -r1.354 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.353 src/sys/dev/raidframe/rf_netbsdkintf.c:1.354 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.353 Thu Jan 18 00:32:49 2018 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Fri Jan 19 09:04:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.353 2018/01/18 00:32:49 mrg Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.354 2018/01/19 09:04:23 skrll Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.353 2018/01/18 00:32:49 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.354 2018/01/19 09:04:23 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1115,8 +1115,10 @@ raidioctl(dev_t dev, u_long cmd, void *d case RAIDFRAME_GET_COMPONENT_LABEL80: #endif #ifdef COMPAT_NETBSD32 +#ifdef _LP64 case RAIDFRAME_GET_INFO32: #endif +#endif if ((rs->sc_flags & RAIDF_INITED) == 0) return (ENXIO); } @@ -1152,8 +1154,10 @@ raidioctl(dev_t dev, u_long cmd, void *d /* configure the system */ case RAIDFRAME_CONFIGURE: #ifdef COMPAT_NETBSD32 +#ifdef _LP64 case RAIDFRAME_CONFIGURE32: #endif +#endif if (raidPtr->valid) { /* There is a valid RAID set running on this unit! */ @@ -1169,11 +1173,13 @@ raidioctl(dev_t dev, u_long cmd, void *d return (ENOMEM); } #ifdef COMPAT_NETBSD32 +#ifdef _LP64 if (cmd == RAIDFRAME_CONFIGURE32 && (l->l_proc->p_flag & PK_32) != 0) retcode = rf_config_netbsd32(data, k_cfg); else #endif +#endif { u_cfg = *((RF_Config_t **) data); retcode = copyin(u_cfg, k_cfg, sizeof(RF_Config_t)); @@ -1476,8 +1482,10 @@ raidioctl(dev_t dev, u_long cmd, void *d case RAIDFRAME_GET_INFO: #ifdef COMPAT_NETBSD32 +#ifdef _LP64 case RAIDFRAME_GET_INFO32: #endif +#endif RF_Malloc(d_cfg, sizeof(RF_DeviceConfig_t), (RF_DeviceConfig_t *)); if (d_cfg == NULL) @@ -1485,10 +1493,12 @@ raidioctl(dev_t dev, u_long cmd, void *d retcode = rf_get_info(raidPtr, d_cfg); if (retcode == 0) { #ifdef COMPAT_NETBSD32 +#ifdef _LP64 if (cmd == RAIDFRAME_GET_INFO32) ucfgp = NETBSD32PTR64(*(netbsd32_pointer_t *)data); else #endif +#endif ucfgp = *(RF_DeviceConfig_t **)data; retcode = copyout(d_cfg, ucfgp, sizeof(RF_DeviceConfig_t)); }
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: skrll Date: Fri Jan 19 09:04:24 UTC 2018 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: Fix some ARM kernel builds. ARM abuses compat32 for ABI compatibility and this means some ioctls overlap. To generate a diff of this commit: cvs rdiff -u -r1.353 -r1.354 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: ozaki-r Date: Fri Jan 19 08:01:05 UTC 2018 Modified Files: src/sys/net: route.c src/sys/netinet: in.c src/sys/netinet6: in6.c Log Message: Suppress noisy debugging outputs Even if DEBUG they are too noisy under load. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/net/route.c cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/in.c cvs rdiff -u -r1.258 -r1.259 src/sys/netinet6/in6.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.203 src/sys/net/route.c:1.204 --- src/sys/net/route.c:1.203 Tue Jan 9 19:52:29 2018 +++ src/sys/net/route.c Fri Jan 19 08:01:05 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.203 2018/01/09 19:52:29 christos Exp $ */ +/* $NetBSD: route.c,v 1.204 2018/01/19 08:01:05 ozaki-r Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.203 2018/01/09 19:52:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.204 2018/01/19 08:01:05 ozaki-r Exp $"); #include #ifdef RTFLUSH_DEBUG @@ -143,7 +143,7 @@ __KERNEL_RCSID(0, "$NetBSD: route.c,v 1. #define RT_REFCNT_TRACE(rt) do {} while (0) #endif -#ifdef DEBUG +#ifdef RT_DEBUG #define dlog(level, fmt, args...) log(level, fmt, ##args) #else #define dlog(level, fmt, args...) do {} while (0) Index: src/sys/netinet/in.c diff -u src/sys/netinet/in.c:1.215 src/sys/netinet/in.c:1.216 --- src/sys/netinet/in.c:1.215 Mon Jan 15 08:17:34 2018 +++ src/sys/netinet/in.c Fri Jan 19 08:01:05 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: in.c,v 1.215 2018/01/15 08:17:34 ozaki-r Exp $ */ +/* $NetBSD: in.c,v 1.216 2018/01/19 08:01:05 ozaki-r Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.215 2018/01/15 08:17:34 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.216 2018/01/19 08:01:05 ozaki-r Exp $"); #include "arp.h" @@ -2155,7 +2155,7 @@ in_lltable_delete(struct lltable *llt, u lle = in_lltable_find_dst(llt, sin->sin_addr); if (lle == NULL) { -#ifdef DEBUG +#ifdef LLTABLE_DEBUG char buf[64]; sockaddr_format(l3addr, buf, sizeof(buf)); log(LOG_INFO, "%s: cache for %s is not found\n", @@ -2166,7 +2166,7 @@ in_lltable_delete(struct lltable *llt, u LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; -#ifdef DEBUG +#ifdef LLTABLE_DEBUG { char buf[64]; sockaddr_format(l3addr, buf, sizeof(buf)); Index: src/sys/netinet6/in6.c diff -u src/sys/netinet6/in6.c:1.258 src/sys/netinet6/in6.c:1.259 --- src/sys/netinet6/in6.c:1.258 Mon Jan 15 08:17:35 2018 +++ src/sys/netinet6/in6.c Fri Jan 19 08:01:05 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: in6.c,v 1.258 2018/01/15 08:17:35 ozaki-r Exp $ */ +/* $NetBSD: in6.c,v 1.259 2018/01/19 08:01:05 ozaki-r Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.258 2018/01/15 08:17:35 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.259 2018/01/19 08:01:05 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2572,7 +2572,7 @@ in6_lltable_delete(struct lltable *llt, lle = in6_lltable_find_dst(llt, >sin6_addr); if (lle == NULL) { -#ifdef DEBUG +#ifdef LLTABLE_DEBUG char buf[64]; sockaddr_format(l3addr, buf, sizeof(buf)); log(LOG_INFO, "%s: cache for %s is not found\n", @@ -2583,7 +2583,7 @@ in6_lltable_delete(struct lltable *llt, LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; -#ifdef DEBUG +#ifdef LLTABLE_DEBUG { char buf[64]; sockaddr_format(l3addr, buf, sizeof(buf));
CVS commit: src/sys
Module Name:src Committed By: ozaki-r Date: Fri Jan 19 08:01:05 UTC 2018 Modified Files: src/sys/net: route.c src/sys/netinet: in.c src/sys/netinet6: in6.c Log Message: Suppress noisy debugging outputs Even if DEBUG they are too noisy under load. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/net/route.c cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/in.c cvs rdiff -u -r1.258 -r1.259 src/sys/netinet6/in6.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.