From 58e5792e6a0790c619b2f0a897788029333e9459 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Sat, 8 Apr 2006 12:14:42 +0000 Subject: [PATCH] IFHEAD and PREPADDR are mutually exclusive. From FreeBSD. --- sys/net/if_tun.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 456ee1a6eab0..c38b6c0b54a6 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tun.c,v 1.86 2006/04/04 15:43:23 rpaulo Exp $ */ +/* $NetBSD: if_tun.c,v 1.87 2006/04/08 12:14:42 rpaulo Exp $ */ /* * Copyright (c) 1988, Julian Onions @@ -15,7 +15,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.86 2006/04/04 15:43:23 rpaulo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.87 2006/04/08 12:14:42 rpaulo Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -644,16 +644,18 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l) break; case TUNSLMODE: - if (*(int *)data) + if (*(int *)data) { tp->tun_flags |= TUN_PREPADDR; - else + tp->tun_flags &= ~TUN_IFHEAD; + } else tp->tun_flags &= ~TUN_PREPADDR; break; case TUNSIFHEAD: - if (*(int *)data) + if (*(int *)data) { tp->tun_flags |= TUN_IFHEAD; - else + tp->tun_flags &= TUN_PREPADDR; + } else tp->tun_flags &= ~TUN_IFHEAD; break;