diff options
| author | Michael Brown | 2013-08-29 15:10:16 +0200 |
|---|---|---|
| committer | Michael Brown | 2013-09-03 02:24:15 +0200 |
| commit | d5f69e93887cb9ad505b7ed6394891652f393885 (patch) | |
| tree | e2d499055f10b9536db2a544eea626e722d26679 /src/include | |
| parent | [netdevice] Increase maximum network-layer address length (diff) | |
| download | ipxe-d5f69e93887cb9ad505b7ed6394891652f393885.tar.gz ipxe-d5f69e93887cb9ad505b7ed6394891652f393885.tar.xz ipxe-d5f69e93887cb9ad505b7ed6394891652f393885.zip | |
[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>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/netdevice.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/netdevice.h b/src/include/ipxe/netdevice.h index d0e628a43..7288ad86d 100644 --- a/src/include/ipxe/netdevice.h +++ b/src/include/ipxe/netdevice.h @@ -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 */ |
