Browse Source

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.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
f11da20f25
4 changed files with 7 additions and 4 deletions
  1. 2
    2
      src/net/ipv4.c
  2. 1
    1
      src/net/tcpip.c
  3. 1
    1
      src/net/udp.c
  4. 3
    0
      src/usr/dhcpmgmt.c

+ 2
- 2
src/net/ipv4.c View File

350
  * @v pkb		Packet buffer
350
  * @v pkb		Packet buffer
351
  * @v tcpip		Transport-layer protocol
351
  * @v tcpip		Transport-layer protocol
352
  * @v st_dest		Destination network-layer address
352
  * @v st_dest		Destination network-layer address
353
- * @v netdev		Network device (or NULL to route automatically)
353
+ * @v netdev		Network device to use if no route found, or NULL
354
  * @v trans_csum	Transport-layer checksum to complete, or NULL
354
  * @v trans_csum	Transport-layer checksum to complete, or NULL
355
  * @ret rc		Status
355
  * @ret rc		Status
356
  *
356
  *
394
 	if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
394
 	if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
395
 				   ll_dest ) ) != 0 ) {
395
 				   ll_dest ) ) != 0 ) {
396
 		DBG ( "IPv4 has no link-layer address for %s: %s\n",
396
 		DBG ( "IPv4 has no link-layer address for %s: %s\n",
397
-		      inet_ntoa ( iphdr->dest ), strerror ( rc ) );
397
+		      inet_ntoa ( next_hop ), strerror ( rc ) );
398
 		goto err;
398
 		goto err;
399
 	}
399
 	}
400
 
400
 

+ 1
- 1
src/net/tcpip.c View File

65
  * @v pkb		Packet buffer
65
  * @v pkb		Packet buffer
66
  * @v tcpip_protocol	Transport-layer protocol
66
  * @v tcpip_protocol	Transport-layer protocol
67
  * @v st_dest		Destination address
67
  * @v st_dest		Destination address
68
- * @v netdev		Network device (or NULL to route automatically)
68
+ * @v netdev		Network device to use if no route found, or NULL
69
  * @v trans_csum	Transport-layer checksum to complete, or NULL
69
  * @v trans_csum	Transport-layer checksum to complete, or NULL
70
  * @ret rc		Return status code
70
  * @ret rc		Return status code
71
  */
71
  */

+ 1
- 1
src/net/udp.c View File

143
  *
143
  *
144
  * @v conn		UDP connection
144
  * @v conn		UDP connection
145
  * @v peer		Destination address
145
  * @v peer		Destination address
146
- * @v netdev		Net device via which to send (or NULL)
146
+ * @v netdev		Network device to use if no route found, or NULL
147
  * @v data		Data to send
147
  * @v data		Data to send
148
  * @v len		Length of data
148
  * @v len		Length of data
149
  * @ret rc		Return status code
149
  * @ret rc		Return status code

+ 3
- 0
src/usr/dhcpmgmt.c View File

58
 		dhcp_options = NULL;
58
 		dhcp_options = NULL;
59
 	}
59
 	}
60
 
60
 
61
+	/* Clear any existing routing table entry */
62
+	del_ipv4_address ( netdev );
63
+
61
 	/* Issue DHCP request */
64
 	/* Issue DHCP request */
62
 	printf ( "DHCP (%s %s)...", netdev->name, netdev_hwaddr ( netdev ) );
65
 	printf ( "DHCP (%s %s)...", netdev->name, netdev_hwaddr ( netdev ) );
63
 	memset ( &dhcp, 0, sizeof ( dhcp ) );
66
 	memset ( &dhcp, 0, sizeof ( dhcp ) );

Loading…
Cancel
Save