mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
[udp] Verify local socket address (if specified) for UDP sockets
UDP sockets can be used for multicast, at which point it becomes plausible that we could receive packets that aren't destined for us but that still match on a port number.
This commit is contained in:
@@ -62,6 +62,15 @@ struct sockaddr_in {
|
||||
uint16_t sin_port;
|
||||
/** IPv4 address */
|
||||
struct in_addr sin_addr;
|
||||
/** Padding
|
||||
*
|
||||
* This ensures that a struct @c sockaddr_tcpip is large
|
||||
* enough to hold a socket address for any TCP/IP address
|
||||
* family.
|
||||
*/
|
||||
char pad[ sizeof ( struct sockaddr ) - sizeof ( sa_family_t )
|
||||
- sizeof ( uint16_t )
|
||||
- sizeof ( struct in_addr ) ];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user