diff options
author | brooks <brooks@FreeBSD.org> | 2003-10-23 16:29:20 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2003-10-23 16:29:20 +0000 |
commit | b5fba617ddb211fd091033c57d49d8680cba5217 (patch) | |
tree | 3eddc2bf02029da5a06890a0414a4c92f193a304 /sys/net/if_tun.c | |
parent | 7b5733448f7255d2d613bd4eb1496b92eb1c7f48 (diff) | |
download | FreeBSD-src-b5fba617ddb211fd091033c57d49d8680cba5217.zip FreeBSD-src-b5fba617ddb211fd091033c57d49d8680cba5217.tar.gz |
Use IF_MAXUNIT instead of rolling our own identical TUN_MAXUNIT.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e605002..6813e84 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -58,7 +58,6 @@ #define TUNDEBUG if (tundebug) printf #define TUNNAME "tun" -#define TUN_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */ static MALLOC_DEFINE(M_TUN, TUNNAME, "Tunnel Interface"); static int tundebug = 0; @@ -106,7 +105,7 @@ tunclone(void *arg, char *name, int namelen, dev_t *dev) return; if (strcmp(name, TUNNAME) == 0) { - r = rman_reserve_resource(&tununits, 0, TUN_MAXUNIT, 1, + r = rman_reserve_resource(&tununits, 0, IF_MAXUNIT, 1, RF_ALLOCATED | RF_ACTIVE, NULL); u = rman_get_start(r); err = rman_release_resource(r); @@ -153,7 +152,7 @@ tunmodevent(module_t mod, int type, void *data) EVENTHANDLER_DEREGISTER(dev_clone, tag); return (err); } - err = rman_manage_region(&tununits, 0, TUN_MAXUNIT); + err = rman_manage_region(&tununits, 0, IF_MAXUNIT); if (err != 0) { printf("%s: tununits: rman_manage_region: Failed %d\n", TUNNAME, err); @@ -257,7 +256,7 @@ tunopen(dev_t dev, int flag, int mode, struct thread *td) int unit; unit = dev2unit(dev); - if (unit > TUN_MAXUNIT) + if (unit > IF_MAXUNIT) return (ENXIO); r = rman_reserve_resource(&tununits, unit, unit, 1, |