summaryrefslogtreecommitdiff
path: root/src/bsd
diff options
context:
space:
mode:
Diffstat (limited to 'src/bsd')
-rw-r--r--src/bsd/tun.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bsd/tun.c b/src/bsd/tun.c
index b609a3c..43da1d0 100644
--- a/src/bsd/tun.c
+++ b/src/bsd/tun.c
@@ -256,6 +256,9 @@ int tun_write(tun_device_t* dev, u_int8_t* buf, u_int32_t len)
if(!dev || dev->fd_ < 0)
return -1;
+ if(!buf)
+ return 0;
+
if(dev->with_pi_)
{
struct iovec iov[2];