Raw UDP API, connecting to a multicast IP address results in dropped messages
I noticed a bug while trying to integrate lwIP IPv6 into my
code. I'm not sure if its a bug or if I'm mistaken and utilizing the API
incorrectly. The application that I am writing calls for sending a msg to a
multicast address and
receiving a response back from some server.
To accomplish this I setup my UDP connection as so:
Here it just checks if the remote ip address ISANY or if the
remote address matches the current source address. Since I had set the remote
address to multicast (FF02::1) this if statement would evaluate to false just
set pcb to NULL which in return causes incoming packets to be ignored.
For my application I'm using only one udp pcb, so a
workaround that I used instead was after calling *udp_connect()* to set the
remote ip and port, I called *udp_clear_flags(udp_pcb, UDP_FLAGS_CONNECTED)*.
This allowed the *udp_input()* function touse the first unconnected pcb in the pcb list (and since I have only one
it picks that every time).
Going forward I wouldn't prefer using this workaround as its
not universal. It is possible that I am using the udp api incorrectly and there
is a different way to do what I want, perhaps someone could guide me in the