mirror of https://github.com/ipxe/ipxe.git
When a network device is specified to tcpip_tx() or it's children, treat
it as a fallback network device rather than an explicitly forced network device. Clear routing table entries before re-attempting DHCP.pull/1/head
parent
1a1fc23417
commit
f11da20f25
|
@ -350,7 +350,7 @@ static int ipv4_ll_addr ( struct in_addr dest, struct in_addr src,
|
||||||
* @v pkb Packet buffer
|
* @v pkb Packet buffer
|
||||||
* @v tcpip Transport-layer protocol
|
* @v tcpip Transport-layer protocol
|
||||||
* @v st_dest Destination network-layer address
|
* @v st_dest Destination network-layer address
|
||||||
* @v netdev Network device (or NULL to route automatically)
|
* @v netdev Network device to use if no route found, or NULL
|
||||||
* @v trans_csum Transport-layer checksum to complete, or NULL
|
* @v trans_csum Transport-layer checksum to complete, or NULL
|
||||||
* @ret rc Status
|
* @ret rc Status
|
||||||
*
|
*
|
||||||
|
@ -394,7 +394,7 @@ static int ipv4_tx ( struct pk_buff *pkb,
|
||||||
if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
|
if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
|
||||||
ll_dest ) ) != 0 ) {
|
ll_dest ) ) != 0 ) {
|
||||||
DBG ( "IPv4 has no link-layer address for %s: %s\n",
|
DBG ( "IPv4 has no link-layer address for %s: %s\n",
|
||||||
inet_ntoa ( iphdr->dest ), strerror ( rc ) );
|
inet_ntoa ( next_hop ), strerror ( rc ) );
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ int tcpip_rx ( struct pk_buff *pkb, uint8_t tcpip_proto,
|
||||||
* @v pkb Packet buffer
|
* @v pkb Packet buffer
|
||||||
* @v tcpip_protocol Transport-layer protocol
|
* @v tcpip_protocol Transport-layer protocol
|
||||||
* @v st_dest Destination address
|
* @v st_dest Destination address
|
||||||
* @v netdev Network device (or NULL to route automatically)
|
* @v netdev Network device to use if no route found, or NULL
|
||||||
* @v trans_csum Transport-layer checksum to complete, or NULL
|
* @v trans_csum Transport-layer checksum to complete, or NULL
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -143,7 +143,7 @@ int udp_senddata ( struct udp_connection *conn ) {
|
||||||
*
|
*
|
||||||
* @v conn UDP connection
|
* @v conn UDP connection
|
||||||
* @v peer Destination address
|
* @v peer Destination address
|
||||||
* @v netdev Net device via which to send (or NULL)
|
* @v netdev Network device to use if no route found, or NULL
|
||||||
* @v data Data to send
|
* @v data Data to send
|
||||||
* @v len Length of data
|
* @v len Length of data
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
|
|
|
@ -58,6 +58,9 @@ int dhcp ( struct net_device *netdev ) {
|
||||||
dhcp_options = NULL;
|
dhcp_options = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clear any existing routing table entry */
|
||||||
|
del_ipv4_address ( netdev );
|
||||||
|
|
||||||
/* Issue DHCP request */
|
/* Issue DHCP request */
|
||||||
printf ( "DHCP (%s %s)...", netdev->name, netdev_hwaddr ( netdev ) );
|
printf ( "DHCP (%s %s)...", netdev->name, netdev_hwaddr ( netdev ) );
|
||||||
memset ( &dhcp, 0, sizeof ( dhcp ) );
|
memset ( &dhcp, 0, sizeof ( dhcp ) );
|
||||||
|
|
Loading…
Reference in New Issue