|
|
@ -715,6 +715,7 @@ func (rs *reportState) probePortMapServices() {
|
|
|
|
uc.WriteTo(pcpPacket(myIP, tempPort, false), port5351)
|
|
|
|
uc.WriteTo(pcpPacket(myIP, tempPort, false), port5351)
|
|
|
|
|
|
|
|
|
|
|
|
res := make([]byte, 1500)
|
|
|
|
res := make([]byte, 1500)
|
|
|
|
|
|
|
|
sentPCPDelete := false
|
|
|
|
for {
|
|
|
|
for {
|
|
|
|
n, addr, err := uc.ReadFrom(res)
|
|
|
|
n, addr, err := uc.ReadFrom(res)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -732,6 +733,8 @@ func (rs *reportState) probePortMapServices() {
|
|
|
|
if n == 60 && res[0] == 0x02 { // right length and version 2
|
|
|
|
if n == 60 && res[0] == 0x02 { // right length and version 2
|
|
|
|
rs.setOptBool(&rs.report.PCP, true)
|
|
|
|
rs.setOptBool(&rs.report.PCP, true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !sentPCPDelete {
|
|
|
|
|
|
|
|
sentPCPDelete = true
|
|
|
|
// And now delete the mapping.
|
|
|
|
// And now delete the mapping.
|
|
|
|
// (PCP is the only protocol of the three that requires
|
|
|
|
// (PCP is the only protocol of the three that requires
|
|
|
|
// we cause a side effect to detect whether it's present,
|
|
|
|
// we cause a side effect to detect whether it's present,
|
|
|
@ -741,6 +744,7 @@ func (rs *reportState) probePortMapServices() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var pmpPacket = []byte{0, 0} // version 0, opcode 0 = "Public address request"
|
|
|
|
var pmpPacket = []byte{0, 0} // version 0, opcode 0 = "Public address request"
|
|
|
|
|
|
|
|
|
|
|
|