From 89e8f275befe635eaf2458586177b741d6c4467a Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 15 Jan 2001 13:40:35 +0000 Subject: [PATCH] Don't peek at part of a structure via fuword. Does not work well on 64bit architectures. XXX - have to check other changes in the I4B distribution, this had been fixed there a long time ago. --- sys/net/if_spppsubr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index ee487444eb2e..d2cc1f954bcc 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.17 2001/01/07 21:47:28 martin Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.18 2001/01/15 13:40:35 martin Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -4928,10 +4928,10 @@ sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest) static int sppp_params(struct sppp *sp, int cmd, void *data) { - int subcmd; struct ifreq *ifr = (struct ifreq *)data; struct spppreq spr; +#if 0 /* * ifr->ifr_data is supposed to point to a struct spppreq. * Check the cmd word first before attempting to fetch all the @@ -4939,11 +4939,12 @@ sppp_params(struct sppp *sp, int cmd, void *data) */ if ((subcmd = fuword(ifr->ifr_data)) == -1) return EFAULT; +#endif if (copyin((caddr_t)ifr->ifr_data, &spr, sizeof spr) != 0) return EFAULT; - switch (subcmd) { + switch (spr.cmd) { case SPPPIOGDEFS: if (cmd != (int)SIOCGIFGENERIC) return EINVAL;