summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1996-12-02 21:07:33 +0000
committerjulian <julian@FreeBSD.org>1996-12-02 21:07:33 +0000
commit3e183c63bffe7004a612fcd5938586a2479a5279 (patch)
treee86dcedf129c14e84d6b793fa508cadac50d9c69 /sys/net
parent32491cf461dc595de0f3e4143c93e9729846fecf (diff)
downloadFreeBSD-src-3e183c63bffe7004a612fcd5938586a2479a5279.zip
FreeBSD-src-3e183c63bffe7004a612fcd5938586a2479a5279.tar.gz
2 small changes:
1/ increase the tun MTU from 1500 to 1600 to allow it to be used with packets formatted according to RFC1490 and RFC1717 2/ allow the tsleep() when reading, to be interruptable by signals so that one can now do: od -xc </dev/tun0 to dump packets for debugging without getting hung. Passed on by: Archie@whistle.com (archie Cobbs) Nice but not neccessary in 2.2
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_tun.c6
-rw-r--r--sys/net/if_tun.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 3b0d98e..9518c31 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -479,7 +479,11 @@ tunread(dev_t dev, struct uio *uio, int flag)
return EWOULDBLOCK;
}
tp->tun_flags |= TUN_RWAIT;
- tsleep((caddr_t)tp, PZERO + 1, "tunread", 0);
+ if( error = tsleep((caddr_t)tp, PCATCH | (PZERO + 1),
+ "tunread", 0)) {
+ splx(s);
+ return error;
+ }
}
} while (m0 == 0);
splx(s);
diff --git a/sys/net/if_tun.h b/sys/net/if_tun.h
index c35a618..c31b548 100644
--- a/sys/net/if_tun.h
+++ b/sys/net/if_tun.h
@@ -39,7 +39,7 @@ struct tun_softc {
};
/* Maximum packet size */
-#define TUNMTU 1500
+#define TUNMTU 1600
struct tuninfo {
int baudrate; /* linespeed */
OpenPOWER on IntegriCloud