From f46cac490405aa9894b21d907b24a8288b3ca4df Mon Sep 17 00:00:00 2001 From: esrrhs Date: Sat, 22 Dec 2018 18:29:55 +0800 Subject: [PATCH] add --- server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.go b/server.go index c3116bf..ff9cbf9 100644 --- a/server.go +++ b/server.go @@ -35,6 +35,7 @@ type ServerConn struct { rproto int echoId int echoSeq int + sendEchoId int } func (p *Server) Run() { @@ -142,6 +143,11 @@ func (p *Server) Recv(conn *ServerConn, id string, src *net.IPAddr) { sendICMP(conn.echoId, conn.echoSeq, *p.conn, src, "", id, (uint32)(DATA), bytes[:n], conn.rproto, -1) + if conn.sendEchoId == conn.echoId { + conn.echoSeq++ + } + conn.sendEchoId = conn.echoId + p.sendPacket++ p.sendPacketSize += (uint64)(n) }