Module Name: src Committed By: pgoyette Date: Thu Mar 8 00:23:47 UTC 2018
Modified Files: src/sys/compat/common [pgoyette-compat]: compat_mod.c uipc_syscalls_50.c Log Message: Implement vector initialization for ifreqo2n and ifdatareq To generate a diff of this commit: cvs rdiff -u -r1.24.14.2 -r1.24.14.3 src/sys/compat/common/compat_mod.c cvs rdiff -u -r1.3 -r1.3.56.1 src/sys/compat/common/uipc_syscalls_50.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/compat/common/compat_mod.c diff -u src/sys/compat/common/compat_mod.c:1.24.14.2 src/sys/compat/common/compat_mod.c:1.24.14.3 --- src/sys/compat/common/compat_mod.c:1.24.14.2 Tue Mar 6 23:17:42 2018 +++ src/sys/compat/common/compat_mod.c Thu Mar 8 00:23:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_mod.c,v 1.24.14.2 2018/03/06 23:17:42 pgoyette Exp $ */ +/* $NetBSD: compat_mod.c,v 1.24.14.3 2018/03/08 00:23:47 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.2 2018/03/06 23:17:42 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.3 2018/03/08 00:23:47 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: compat_mod.c #include <compat/common/compat_util.h> #include <compat/common/compat_mod.h> #include <compat/common/if_43.h> +#include <compat/sys/sockio.h> + #if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_50) static struct sysctllog *compat_clog = NULL; Index: src/sys/compat/common/uipc_syscalls_50.c diff -u src/sys/compat/common/uipc_syscalls_50.c:1.3 src/sys/compat/common/uipc_syscalls_50.c:1.3.56.1 --- src/sys/compat/common/uipc_syscalls_50.c:1.3 Wed Jan 19 10:21:16 2011 +++ src/sys/compat/common/uipc_syscalls_50.c Thu Mar 8 00:23:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls_50.c,v 1.3 2011/01/19 10:21:16 tsutsui Exp $ */ +/* $NetBSD: uipc_syscalls_50.c,v 1.3.56.1 2018/03/08 00:23:47 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.3 2011/01/19 10:21:16 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.3.56.1 2018/03/08 00:23:47 pgoyette Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -95,4 +95,27 @@ compat_ifdatareq(struct lwp *l, u_long c return EINVAL; } } + +/* Save and restore compat vector as needed */ + +int (*orig_compat_ifconf)(u_long, void *); +int (*orig_compat_ifdatareq)(struct lwp *, u_long, void *); + +void +if_50_init(void) +{ + + orig_compat_ifreqo2n = vec_compat_ifreqo2n; + orig_compat_ifdatareq = vec_compat_ifdatareq; + vec_compat_ifreqo2n = compat_ifreqo2n; + vec_compat_ifdatareq = compat_ifdatareq; +} + +void +if_50_fini(void) +{ + + vec_compat_ifreqo2n = orig_compat_ifreqo2n; + vec_compat_ifdatareq = orig_compat_ifdatareq; +} #endif