Hello,

I just noticed that NuttX responds with an ICMP port unreachable on UDP
broadcasts.
AFAIK this shouldn't happen.

I followed the code, and I found that the broadcast reaches udp_input.c:
line 256, where the ICMP response is generated.

There is a note there that indeed the ICMP shouldn't be sent if this is a
broadcast.
As I see, the ICMP code is left to check this condition.

Within icmp_reply.c: line 105 I see that there is a check about broadcasts.
My understanding is that this check is wrong.

It checks for pure equality, between the destination IP and
INADDR_BROADCAST.

In my (quite typical) network, the broadcast IP is 192.168.1.255.
The check expects to see exactly 255.255.255.255, so it fails to realise
that this is a broadcast and responds nevertheless.

Shall this check be fixed somehow?
Or have I misunderstood something?

Reply via email to