Skip to content

Commit

Permalink
Fix raw socket ipv6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed May 25, 2016
1 parent 1c3af3e commit 98fe7f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions raw_socket_listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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))

Expand Down

0 comments on commit 98fe7f1

Please sign in to comment.