|
|
|
|
@ -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); |
|
|
|
|
|