mirror of https://github.com/ipxe/ipxe.git
Remove the static IP address hack from netdevice.c, and change the
default test to the DHCP test.pull/1/head
parent
00a1f000b1
commit
e74e20cb55
|
@ -154,7 +154,7 @@ int main ( void ) {
|
||||||
|
|
||||||
netdev = next_netdev ();
|
netdev = next_netdev ();
|
||||||
if ( netdev ) {
|
if ( netdev ) {
|
||||||
test_aoeboot ( netdev );
|
test_dhcp ( netdev );
|
||||||
} else {
|
} else {
|
||||||
printf ( "No network device found\n" );
|
printf ( "No network device found\n" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,6 @@ static struct net_protocol net_protocols_end[0] __table_end ( net_protocols );
|
||||||
/** List of network devices */
|
/** List of network devices */
|
||||||
static LIST_HEAD ( net_devices );
|
static LIST_HEAD ( net_devices );
|
||||||
|
|
||||||
#warning "Remove this static IP address hack"
|
|
||||||
#include <ip.h>
|
|
||||||
#include <gpxe/ip.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmit raw packet via network device
|
* Transmit raw packet via network device
|
||||||
*
|
*
|
||||||
|
@ -179,19 +175,6 @@ struct net_device * alloc_netdev ( size_t priv_size ) {
|
||||||
*/
|
*/
|
||||||
int register_netdev ( struct net_device *netdev ) {
|
int register_netdev ( struct net_device *netdev ) {
|
||||||
|
|
||||||
#warning "Remove this static IP address hack"
|
|
||||||
{
|
|
||||||
const struct in_addr static_address = { htonl ( 0x0afefe01 ) };
|
|
||||||
const struct in_addr static_netmask = { htonl ( 0xffffff00 ) };
|
|
||||||
const struct in_addr static_gateway = { INADDR_NONE };
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
if ( ( rc = add_ipv4_address ( netdev, static_address,
|
|
||||||
static_netmask,
|
|
||||||
static_gateway ) ) != 0 )
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add to device list */
|
/* Add to device list */
|
||||||
list_add_tail ( &netdev->list, &net_devices );
|
list_add_tail ( &netdev->list, &net_devices );
|
||||||
DBG ( "%s registered\n", netdev_name ( netdev ) );
|
DBG ( "%s registered\n", netdev_name ( netdev ) );
|
||||||
|
@ -209,9 +192,6 @@ int register_netdev ( struct net_device *netdev ) {
|
||||||
void unregister_netdev ( struct net_device *netdev ) {
|
void unregister_netdev ( struct net_device *netdev ) {
|
||||||
struct pk_buff *pkb;
|
struct pk_buff *pkb;
|
||||||
|
|
||||||
#warning "Remove this static IP address hack"
|
|
||||||
del_ipv4_address ( netdev );
|
|
||||||
|
|
||||||
/* Discard any packets in the RX queue */
|
/* Discard any packets in the RX queue */
|
||||||
while ( ( pkb = netdev_rx_dequeue ( netdev ) ) ) {
|
while ( ( pkb = netdev_rx_dequeue ( netdev ) ) ) {
|
||||||
DBG ( "%s discarding %p+%zx\n", netdev_name ( netdev ),
|
DBG ( "%s discarding %p+%zx\n", netdev_name ( netdev ),
|
||||||
|
|
Loading…
Reference in New Issue