This commit is contained in:
esrrhs committed 2018-12-19 11:48:48 +08:00
1 parent b83e6e7d45
commit 743b82dda4
4 files changed
+18 -10

No files matched your search

+2 -2
View File
@@ -89,7 +89,7 @@ func (p *MyMsg) UnmarshalString(b []byte) string {
return string(data)
}
func sendICMP(conn icmp.PacketConn, server *net.IPAddr, target string, connId string, msgType uint32, data []byte) {
func sendICMP(conn icmp.PacketConn, server *net.IPAddr, target string, connId string, msgType uint32, data []byte, proto int) {
m := &MyMsg{
ID: connId,
@@ -99,7 +99,7 @@ func sendICMP(conn icmp.PacketConn, server *net.IPAddr, target string, connId st
}
msg := &icmp.Message{
Type: ipv4.ICMPTypeExtendedEchoRequest,
Type: (ipv4.ICMPType)(proto),
Code: 0,
Body: m,
}