mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fix raw socket ipv6 support
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user