summaryrefslogtreecommitdiffstats
path: root/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'tun.c')
-rw-r--r--tun.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tun.c b/tun.c
index c1494d9..bc3466b 100644
--- a/tun.c
+++ b/tun.c
@@ -2033,7 +2033,12 @@ tun_finalize (
}
if (buf)
- buf->len = ret;
+ {
+ if (ret < 0)
+ buf->len = 0;
+ else
+ buf->len = ret;
+ }
return ret;
}