mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
Merge branch 'master' of /pub/scm/gpxe
This commit is contained in:
@@ -141,12 +141,20 @@ void del_ipv4_address ( struct net_device *netdev ) {
|
||||
* @v dest Final destination address
|
||||
* @ret dest Next hop destination address
|
||||
* @ret miniroute Routing table entry to use, or NULL if no route
|
||||
*
|
||||
* If the route requires use of a gateway, the next hop destination
|
||||
* address will be overwritten with the gateway address.
|
||||
*/
|
||||
static struct ipv4_miniroute * ipv4_route ( struct in_addr *dest ) {
|
||||
struct ipv4_miniroute *miniroute;
|
||||
int local;
|
||||
int has_gw;
|
||||
|
||||
/* Never attempt to route the broadcast address */
|
||||
if ( dest->s_addr == INADDR_BROADCAST )
|
||||
return NULL;
|
||||
|
||||
/* Find first usable route in routing table */
|
||||
list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) {
|
||||
local = ( ( ( dest->s_addr ^ miniroute->address.s_addr )
|
||||
& miniroute->netmask.s_addr ) == 0 );
|
||||
|
||||
@@ -356,15 +356,17 @@ struct net_device * find_netdev ( const char *name ) {
|
||||
/**
|
||||
* Get network device by PCI bus:dev.fn address
|
||||
*
|
||||
* @v busdevfn PCI bus:dev.fn address
|
||||
* @v bus_type Bus type
|
||||
* @v location Bus location
|
||||
* @ret netdev Network device, or NULL
|
||||
*/
|
||||
struct net_device * find_pci_netdev ( unsigned int busdevfn ) {
|
||||
struct net_device * find_netdev_by_location ( unsigned int bus_type,
|
||||
unsigned int location ) {
|
||||
struct net_device *netdev;
|
||||
|
||||
list_for_each_entry ( netdev, &net_devices, list ) {
|
||||
if ( ( netdev->dev->desc.bus_type == BUS_TYPE_PCI ) &&
|
||||
( netdev->dev->desc.location == busdevfn ) )
|
||||
if ( ( netdev->dev->desc.bus_type == bus_type ) &&
|
||||
( netdev->dev->desc.location == location ) )
|
||||
return netdev;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user