huin/goupnp

SSDPRawSearch: With the same USN, ipv4Response was replaced by ipv6Response, which is not effected for ipv4only client.

xiayuhai opened this issue · 1 comments

SSDPRawSearch:

Env: Router(ipv4+ipv6) , Client(ipv4)
With the same USN, ipv4Response was replaced by ipv6Response, which is not effected for ipv4only client.
This will be fixed by change seenUSNs[usn] with seenUSNs[location.String()+"/"+usn].

Code:

usn := response.Header.Get("USN")
location, err := response.Location()
if err != nil {
	continue
}
locusn := location.String() + "/" + usn
if _, alreadySeen := seenUSNs[locusn]; !alreadySeen {
	seenUSNs[locusn] = true
	responses = append(responses, response)
}
huin commented

Yep, this makes sense. I'm going to make a very similar change to your suggestion. Thanks :)