From owner-svn-src-head@FreeBSD.ORG Tue Jun 9 02:27:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF6C106566C; Tue, 9 Jun 2009 02:27:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5F98FC0A; Tue, 9 Jun 2009 02:27:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n592RxXS052708; Tue, 9 Jun 2009 02:27:59 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n592RxDs052706; Tue, 9 Jun 2009 02:27:59 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200906090227.n592RxDs052706@svn.freebsd.org> From: Hiroki Sato Date: Tue, 9 Jun 2009 02:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193796 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 02:28:00 -0000 Author: hrs Date: Tue Jun 9 02:27:59 2009 New Revision: 193796 URL: http://svn.freebsd.org/changeset/base/193796 Log: - Fix sanity check of GIFSOPTS ioctl. - Rename option mask s/GIF_FULLOPTS/GIF_OPTMASK/ Spotted by: Eygene Ryabinkin, delphij Modified: head/sys/net/if_gif.c head/sys/net/if_gif.h Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Jun 9 01:43:58 2009 (r193795) +++ head/sys/net/if_gif.c Tue Jun 9 02:27:59 2009 (r193796) @@ -912,10 +912,10 @@ gif_ioctl(ifp, cmd, data) case GIFSOPTS: if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) break; - if ((error = copyin(&options, &sc->gif_options, - sizeof(sc->gif_options)))) { - if ((options | GIF_FULLOPTS) == GIF_FULLOPTS) - ifr->ifr_data = (caddr_t)options; + if (!(error = copyin(ifr->ifr_data, &options, + sizeof(options)))) { + if ((options | GIF_OPTMASK) == GIF_OPTMASK) + sc->gif_options = options; else error = EINVAL; } Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Tue Jun 9 01:43:58 2009 (r193795) +++ head/sys/net/if_gif.h Tue Jun 9 02:27:59 2009 (r193796) @@ -150,11 +150,11 @@ extern struct vnet_gif vnet_gif_0; #endif /* _KERNEL */ -#define GIFGOPTS _IOR('i', 150, struct ifreq) +#define GIFGOPTS _IOWR('i', 150, struct ifreq) #define GIFSOPTS _IOW('i', 151, struct ifreq) #define GIF_ACCEPT_REVETHIP 0x0001 #define GIF_SEND_REVETHIP 0x0010 -#define GIF_FULLOPTS (GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP) +#define GIF_OPTMASK (GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP) #endif /* _NET_IF_GIF_H_ */