add TUN write diagnostic: log tun_platform_write errors
This commit is contained in:
1 parent
deaeae747a
commit
f708b1d095
1 file changed
+2
-1
+2
-1
@@ -132,7 +132,8 @@ static err_t tcp_output_cb(void *arg, struct pbuf *p, uint32_t src_ip, uint32_t
|
||||
uint8_t buf[2002];
|
||||
if (proxy->tun) {
|
||||
pbuf_copy_partial(p, buf, len, 0);
|
||||
tun_platform_write(proxy->tun, buf, len);
|
||||
ssize_t wr = tun_platform_write(proxy->tun, buf, len);
|
||||
if (wr != (ssize_t)len) DEBUG_ERROR(DEBUG_CATEGORY_TRAFFIC, "PROXY TCP_OUT TUN write failed: ret=%zd len=%u errno=%d", wr, len, errno);
|
||||
} else if (proxy->ip_fd >= 0) {
|
||||
buf[0] = (len >> 8) & 0xFF; buf[1] = len & 0xFF;
|
||||
pbuf_copy_partial(p, buf + 2, len, 0);
|
||||
|
||||
Reference in new issue
Block a user