1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 08:21:18 +01:00
bors[bot] f78c3751b9
Merge #19272
19272: gcoap: Do not send responses from multicast addresses r=benpicco a=chrysn

### Contribution description

Since https://github.com/RIOT-OS/RIOT/pull/18026, CoAP requests to multicast addresses (eg. `ff02::1`) came back from that exact address, which Linux rightfully just drops.

The fix uses the existing multicast check from https://github.com/RIOT-OS/RIOT/pull/17978 (thanks `@benpicco` for making me write this as dedicated function, I just had to generalize it removing one struct layer), and foregoes setting the source address when responding to multicasts.

### Testing procedure

* Run the gcoap example
* Send a CoAP request to a multicast address RIOT listens to, eg. `./aiocoap-client coap://'[ff02::1%tapbr0]'/.well-known/core --non`

Before, this got no response (while you see it arrive on wireshark). After, you get a correct response with two lines of note:

```
WARNING:coap:Sending request to multicast via unicast request method
Response arrived from different address; base URI is coap://[fe80::3c63:beff:fe85:ca96%tapbr0]/.well-known/core
```

(The former is aiocoap telling us that we're not using the nonexistent multicast API so it's really more of an anycast, the latter is useful factual information).

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-14 00:28:46 +00:00
..
2022-09-16 14:00:35 +02:00
2023-02-13 21:09:07 +00:00
2022-11-10 23:44:50 +01:00
2022-03-11 09:24:12 +01:00
2023-01-07 09:47:44 +01:00
2022-01-13 17:50:59 +01:00
2022-09-23 16:42:52 +02:00
2022-09-29 22:01:37 +02:00
2023-02-10 16:03:41 +00:00
2022-09-26 19:06:46 +02:00
2022-03-11 09:20:24 +01:00
2022-12-05 16:13:21 +01:00
2022-02-11 12:38:21 +01:00
2023-02-02 00:04:14 +00:00
2023-02-13 21:09:07 +00:00