mirror of
https://github.com/ipxe/ipxe
synced 2025-12-25 00:17:57 +03:00
[netdevice] Add concept of a network device index
IPv6 link-local socket addresses require some way to specify a local network device. We cannot simply use a pointer to the network device, since a struct sockaddr_in6 may be long-lived and has no way to hold a reference to the network device. Using a network device index allows a socket address to cleanly refer to a network device without worrying about whether or not that device continues to exist. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -300,6 +300,8 @@ struct net_device {
|
||||
struct list_head list;
|
||||
/** List of open network devices */
|
||||
struct list_head open_list;
|
||||
/** Index of this network device */
|
||||
unsigned int index;
|
||||
/** Name of this network device */
|
||||
char name[12];
|
||||
/** Underlying hardware device */
|
||||
|
||||
Reference in New Issue
Block a user