Commit ba0db0b
authored
fix: UDP packet buffer initialization pointing all msg_name to same address (#245)
Fix bug in bsd_create_udp_packet_buffer() where all mmsghdr structures
were pointing their msg_name field to the same address (&b->addr[0])
instead of their respective slots in the address array (&b->addr[n]).
This caused all received UDP packets to appear as coming from the same
peer address when using Linux recvmmsg(), making it impossible to
distinguish between different clients in UDP server applications.
Changes:
- Line 251: Change .msg_name = &b->addr to .msg_name = &b->addr[n]
Fixes issue where us_udp_packet_buffer_peer() would return identical
pointers for different packet indices on Linux systems.1 parent a80584e commit ba0db0b
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
| 767 | + | |
0 commit comments