diff options
author | hrs <hrs@FreeBSD.org> | 2009-06-09 02:27:59 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2009-06-09 02:27:59 +0000 |
commit | d14474a66cf12fdd52ae5cd77c2c9676937dc738 (patch) | |
tree | f47f7c50016ed289a1e27f87f9c507636388f067 /sys/net | |
parent | cfc92528a54728ef44bee6a14e7e87f24764aa47 (diff) | |
download | FreeBSD-src-d14474a66cf12fdd52ae5cd77c2c9676937dc738.zip FreeBSD-src-d14474a66cf12fdd52ae5cd77c2c9676937dc738.tar.gz |
- Fix sanity check of GIFSOPTS ioctl.
- Rename option mask s/GIF_FULLOPTS/GIF_OPTMASK/
Spotted by: Eygene Ryabinkin, delphij
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_gif.c | 8 | ||||
-rw-r--r-- | sys/net/if_gif.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index c6f7285..d8fb54b 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -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; } diff --git a/sys/net/if_gif.h b/sys/net/if_gif.h index bdc9562..c8768b5 100644 --- a/sys/net/if_gif.h +++ b/sys/net/if_gif.h @@ -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_ */ |