- Fix sanity check of GIFSOPTS ioctl.
- Rename option mask s/GIF_FULLOPTS/GIF_OPTMASK/ Spotted by: Eygene Ryabinkin, delphij
This commit is contained in:
parent
38676b52dd
commit
fb70e72b0c
@ -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;
|
||||
}
|
||||
|
@ -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_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user