Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys pullup (approved by releng-1-5)
details: https://anonhg.NetBSD.org/src/rev/51671937db68
branches: netbsd-1-5
changeset: 489686:51671937db68
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Oct 06 07:00:31 2000 +0000
description:
pullup (approved by releng-1-5)
move privilege check for SIOCSIFPHY* from in{,6}_control to ifioctl.
fix privilege check mistakes (which allows non-root user to modify gif
physical address in some cases). sync with kame.
> cvs rdiff -r1.62 -r1.63 syssrc/sys/netinet/in.c
> cvs rdiff -r1.34 -r1.35 syssrc/sys/netinet6/in6.c
> cvs rdiff -r1.71 -r1.73 syssrc/sys/net/if.c
diffstat:
sys/net/if.c | 8 +++++++-
sys/netinet/in.c | 20 +-------------------
sys/netinet6/in6.c | 24 ++----------------------
3 files changed, 10 insertions(+), 42 deletions(-)
diffs (116 lines):
diff -r de5e6c99374f -r 51671937db68 sys/net/if.c
--- a/sys/net/if.c Thu Oct 05 17:18:05 2000 +0000
+++ b/sys/net/if.c Fri Oct 06 07:00:31 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.62.4.3 2000/10/02 20:54:46 mellon Exp $ */
+/* $NetBSD: if.c,v 1.62.4.4 2000/10/06 07:00:31 itojun Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -134,6 +134,7 @@
#ifdef INET6
/*XXX*/
#include <netinet/in.h>
+#include <netinet6/in6_var.h>
#endif
int ifqmaxlen = IFQ_MAXLEN;
@@ -926,6 +927,11 @@
}
break;
}
+ case SIOCSIFPHYADDR:
+ case SIOCDIFPHYADDR:
+#ifdef INET6
+ case SIOCSIFPHYADDR_IN6:
+#endif
case SIOCADDMULTI:
case SIOCDELMULTI:
case SIOCSIFMEDIA:
diff -r de5e6c99374f -r 51671937db68 sys/netinet/in.c
--- a/sys/netinet/in.c Thu Oct 05 17:18:05 2000 +0000
+++ b/sys/netinet/in.c Fri Oct 06 07:00:31 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.61.4.1 2000/08/18 06:38:45 itojun Exp $ */
+/* $NetBSD: in.c,v 1.61.4.2 2000/10/06 07:00:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -115,12 +115,7 @@
#include <sys/proc.h>
#include <net/if.h>
-#include <net/if_types.h>
#include <net/route.h>
-#include "gif.h"
-#if NGIF > 0
-#include <net/if_gif.h>
-#endif
#include <net/if_ether.h>
@@ -316,19 +311,6 @@
int error, hostIsNew, maskIsNew;
int newifaddr;
-#if NGIF > 0
- if (ifp && ifp->if_type == IFT_GIF) {
- switch (cmd) {
- case SIOCSIFPHYADDR:
- if (p == 0 || (error = suser(p->p_ucred, &p->p_acflag)))
- return(EPERM);
- case SIOCGIFPSRCADDR:
- case SIOCGIFPDSTADDR:
- return gif_ioctl(ifp, cmd, data);
- }
- }
-#endif
-
switch (cmd) {
case SIOCALIFADDR:
case SIOCDLIFADDR:
diff -r de5e6c99374f -r 51671937db68 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Thu Oct 05 17:18:05 2000 +0000
+++ b/sys/netinet6/in6.c Fri Oct 06 07:00:31 2000 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: in6.c,v 1.32.4.2 2000/08/18 06:38:46 itojun Exp $ */
-/* $KAME: in6.c,v 1.99 2000/07/11 17:00:58 jinmei Exp $ */
+/* $NetBSD: in6.c,v 1.32.4.3 2000/10/06 07:00:37 itojun Exp $ */
+/* $KAME: in6.c,v 1.107 2000/10/06 04:58:30 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -83,10 +83,6 @@
#include <net/if.h>
#include <net/if_types.h>
#include <net/route.h>
-#include "gif.h"
-#if NGIF > 0
-#include <net/if_gif.h>
-#endif
#include <net/if_dl.h>
#include <netinet/in.h>
@@ -342,22 +338,6 @@
if (p && !suser(p->p_ucred, &p->p_acflag))
privileged++;
- /*
- * xxx should prevent processes for link-local addresses?
- */
-#if NGIF > 0
- if (ifp && ifp->if_type == IFT_GIF) {
- switch (cmd) {
- case SIOCSIFPHYADDR_IN6:
- if (!privileged)
- return(EPERM);
- /*fall through*/
- case SIOCGIFPSRCADDR_IN6:
- case SIOCGIFPDSTADDR_IN6:
- return gif_ioctl(ifp, cmd, data);
- }
- }
-#endif
switch (cmd) {
case SIOCGETSGCNT_IN6:
case SIOCGETMIFCNT_IN6:
Home |
Main Index |
Thread Index |
Old Index