This commit is contained in:
esrrhs 2018-12-18 18:05:08 +08:00
parent db72092352
commit c9b5f6658f
2 changed files with 6 additions and 2 deletions

View File

@ -151,6 +151,10 @@ func (p *Client) Accept() error {
func (p *Client) processPacket(packet *Packet) {
if len(packet.target) != 0 {
return
}
fmt.Printf("processPacket %s %s %d\n", packet.id, packet.src.String(), len(packet.data))
clientConn := p.localIdToConnMap[packet.id]

View File

@ -16,7 +16,7 @@ import (
)
const (
DATA uint32 = 0x01010101
DATA uint32 = 0xDEADBEEF
)
// An Echo represents an ICMP echo request or reply message body.
@ -99,7 +99,7 @@ func sendICMP(conn icmp.PacketConn, server *net.IPAddr, target string, connId st
}
msg := &icmp.Message{
Type: ipv4.ICMPTypeExtendedEchoRequest,
Type: ipv4.ICMPTypeTimestamp,
Code: 0,
Body: m,
}