chrysn / aiocoap

The Python CoAP library
Other
264 stars 119 forks source link

Errornous "Response arrived from different address" #355

Closed Teufelchen1 closed 3 months ago

Teufelchen1 commented 3 months ago

Hey hey 🦕

When running: aiocoap-client coap://[fe80:0000:0000:0000:8456:17ff:fe95:b451]/cbor I get this message: Response arrived from different address; base URI is coap://[fe80::8456:17ff:fe95:b451%tap0]/cbor IPv6 is hard but that's the same address :) Also happens with: aiocoap-client coap://[fe80::8456:17ff:fe95:b451]/cbor

(Works as expected for aiocoap-client coap://[fe80::8456:17ff:fe95:b451%tap0]/cbor)

chrysn commented 3 months ago

Hm, that's a hard topic because both sides have their merits.

I think the right behavior here would be to normalize the IP address if it is not sent; gotta look into where precisely that happens. At any rate, the :b451 -> :b451%tap0 is at least a useful bit of information. (Requesting from link-local without a zone identifier is kind of like a multicast request, which is originally where this messages was motivated from).

chrysn commented 3 months ago

The PR in https://github.com/chrysn/aiocoap/pull/357 normalizes IP addresses around request creation time. It does not alter whether or not there is a zone identifier. I think that those should either match, or it is worth pointing out that something changed; does that work for you?

Teufelchen1 commented 3 months ago

I think that should make me happy! 😊 Thanks for the fix!