add
This commit is contained in:
parent
db72092352
commit
c9b5f6658f
@ -151,6 +151,10 @@ func (p *Client) Accept() error {
|
|||||||
|
|
||||||
func (p *Client) processPacket(packet *Packet) {
|
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))
|
fmt.Printf("processPacket %s %s %d\n", packet.id, packet.src.String(), len(packet.data))
|
||||||
|
|
||||||
clientConn := p.localIdToConnMap[packet.id]
|
clientConn := p.localIdToConnMap[packet.id]
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DATA uint32 = 0x01010101
|
DATA uint32 = 0xDEADBEEF
|
||||||
)
|
)
|
||||||
|
|
||||||
// An Echo represents an ICMP echo request or reply message body.
|
// 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{
|
msg := &icmp.Message{
|
||||||
Type: ipv4.ICMPTypeExtendedEchoRequest,
|
Type: ipv4.ICMPTypeTimestamp,
|
||||||
Code: 0,
|
Code: 0,
|
||||||
Body: m,
|
Body: m,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user