Commit 47d5b72b authored by ginuerzh's avatar ginuerzh

tuntap: ignore read error

parent c0c47749
......@@ -12,6 +12,8 @@ import (
"github.com/go-log/log"
"github.com/shadowsocks/go-shadowsocks2/core"
"github.com/shadowsocks/go-shadowsocks2/shadowaead"
"github.com/shadowsocks/go-shadowsocks2/shadowstream"
"github.com/songgao/water"
"github.com/songgao/water/waterutil"
"github.com/xtaci/tcpraw"
......@@ -210,7 +212,8 @@ func (h *tunHandler) transportTun(tun net.Conn, conn net.PacketConn, raddr net.A
defer mPool.Put(b)
n, addr, err := conn.ReadFrom(b)
if err != nil {
if err != nil &&
err != shadowaead.ErrShortPacket && err != shadowstream.ErrShortPacket {
return err
}
......@@ -537,7 +540,8 @@ func (h *tapHandler) transportTap(tap net.Conn, conn net.PacketConn, raddr net.A
defer mPool.Put(b)
n, addr, err := conn.ReadFrom(b)
if err != nil {
if err != nil &&
err != shadowaead.ErrShortPacket && err != shadowstream.ErrShortPacket {
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment