Module Name: src
Committed By: pgoyette
Date: Fri Jan 11 07:55:53 UTC 2019
Modified Files:
src/sys/net [pgoyette-compat]: rtsock.c
Log Message:
Don't accept OIFLIST operation unless the rtsock_70_hook is loaded,
even though the results are otherwise identical to those on current.
To generate a diff of this commit:
cvs rdiff -u -r1.238.2.14 -r1.238.2.15 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.238.2.14 src/sys/net/rtsock.c:1.238.2.15
--- src/sys/net/rtsock.c:1.238.2.14 Fri Jan 11 06:27:45 2019
+++ src/sys/net/rtsock.c Fri Jan 11 07:55:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsock.c,v 1.238.2.14 2019/01/11 06:27:45 pgoyette Exp $ */
+/* $NetBSD: rtsock.c,v 1.238.2.15 2019/01/11 07:55:53 pgoyette Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.238.2.14 2019/01/11 06:27:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.238.2.15 2019/01/11 07:55:53 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1839,8 +1839,13 @@ sysctl_iflist(int af, struct rt_walkarg
info.rti_info[RTAX_IFP] = NULL;
if (w->w_where && w->w_tmem && w->w_needed <= 0) {
switch (type) {
- case NET_RT_IFLIST: /* current */
case NET_RT_OIFLIST: /* old _70 */
+ if (rtsock_70_hook.f1 == NULL) {
+ error = EINVAL;
+ break;
+ }
+ /* FALLTHROUGH */
+ case NET_RT_IFLIST: /* current */
error = sysctl_iflist_if(ifp, w, &info, len);
break;
case NET_RT_OOIFLIST: /* old _50 */