Fix raw socket ipv6 support

This commit is contained in:
Leonid Bugaev
2016-05-25 16:27:18 +05:00
parent 1c3af3ef6d
commit 98fe7f19b2
+2 -2
View File
@@ -398,7 +398,7 @@ func (t *Listener) readPcap() {
}
func (t *Listener) readRAWSocket() {
conn, e := net.ListenPacket("ip4:tcp", t.addr)
conn, e := net.ListenPacket("ip:tcp", t.addr)
t.conn = conn
if e != nil {
@@ -425,7 +425,7 @@ func (t *Listener) readRAWSocket() {
if n > 0 {
if t.isValidPacket(buf[:n]) {
newBuf := make([]byte, n+4)
newBuf := make([]byte, n+16)
copy(newBuf[16:], buf[:n])
copy(newBuf[:16], []byte(addr.(*net.IPAddr).IP))