From 72dc54c8ff96a356e2154ce387f0a391dfa08091 Mon Sep 17 00:00:00 2001 From: brian Date: Sat, 25 Aug 2001 09:12:57 +0000 Subject: 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. --- sys/net/if_tun.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e67a8ad..1e6f19b 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); -- cgit v1.1