aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-08-25 09:12:57 +0000
committerBrian Somers <brian@FreeBSD.org>2001-08-25 09:12:57 +0000
commit86b2fc4de58e9878f87e32c31cfba2d08b5144d3 (patch)
tree7d9ab3c9e38a6882bd697bb63fb1d9d50660debd /sys/net/if_tun.c
parent359ebc389c27332d7c86870b49a316aec81b204e (diff)
downloadsrc-86b2fc4de58e9878f87e32c31cfba2d08b5144d3.tar.gz
src-86b2fc4de58e9878f87e32c31cfba2d08b5144d3.zip
TUNSIFINFO now expects IFF_MULTICAST to be OR'd with either IFF_POINTOPOINT
or IFF_BROADCAST. If it's not, the IFF_MULTICAST is removed. This is in line with how NetBSD & OpenBSD do it.
Notes
Notes: svn path=/head/; revision=82319
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index e67a8ada235f..1e6f19b47707 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -572,14 +572,12 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (tp->tun_if.if_flags & IFF_UP)
return(EBUSY);
- switch (*(int *)data) {
+ switch (*(int *)data & ~IFF_MULTICAST) {
case IFF_POINTOPOINT:
- tp->tun_if.if_flags |= IFF_POINTOPOINT;
- tp->tun_if.if_flags &= ~IFF_BROADCAST;
- break;
case IFF_BROADCAST:
- tp->tun_if.if_flags &= ~IFF_POINTOPOINT;
- tp->tun_if.if_flags |= IFF_BROADCAST;
+ tp->tun_if.if_flags &=
+ ~(IFF_BROADCAST|IFF_POINTOPOINT|IFF_MULTICAST);
+ tp->tun_if.if_flags |= *(int *)data;
break;
default:
return(EINVAL);