summaryrefslogtreecommitdiff
path: root/src/uanytun.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-12-27 15:29:59 +0000
committerChristian Pointner <equinox@anytun.org>2008-12-27 15:29:59 +0000
commit3618c5f3d5ad3c88e5143bd699c7bd7a6771bd8f (patch)
treef2897008a792de8f52738a264fbe53d96edea2d1 /src/uanytun.c
parentadded first version of tun device (needs furhter testing) (diff)
fixed some memory errors at tun device
Diffstat (limited to 'src/uanytun.c')
-rw-r--r--src/uanytun.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/uanytun.c b/src/uanytun.c
index 82085b4..fca5e40 100644
--- a/src/uanytun.c
+++ b/src/uanytun.c
@@ -61,10 +61,15 @@ int main(int argc, char* argv[])
log_printf(INFO, "entering main loop");
u_int8_t buf[1600];
int len = 0;
- while(1) {
+ unsigned int cnt = 0;
+ while(cnt < 10) {
len = tun_read(dev, buf, 1600);
printf("read %d bytes from device\n", len);
+ cnt++;
}
+ tun_close(&dev);
+
+ return 0;
}