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) }