Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
f11da20f25
4 değiştirilmiş dosya ile 7 ekleme ve 4 silme
  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 Dosyayı Görüntüle

@@ -350,7 +350,7 @@ static int ipv4_ll_addr ( struct in_addr dest, struct in_addr src,
350 350
  * @v pkb		Packet buffer
351 351
  * @v tcpip		Transport-layer protocol
352 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 354
  * @v trans_csum	Transport-layer checksum to complete, or NULL
355 355
  * @ret rc		Status
356 356
  *
@@ -394,7 +394,7 @@ static int ipv4_tx ( struct pk_buff *pkb,
394 394
 	if ( ( rc = ipv4_ll_addr ( next_hop, iphdr->src, netdev,
395 395
 				   ll_dest ) ) != 0 ) {
396 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 398
 		goto err;
399 399
 	}
400 400
 

+ 1
- 1
src/net/tcpip.c Dosyayı Görüntüle

@@ -65,7 +65,7 @@ int tcpip_rx ( struct pk_buff *pkb, uint8_t tcpip_proto,
65 65
  * @v pkb		Packet buffer
66 66
  * @v tcpip_protocol	Transport-layer protocol
67 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 69
  * @v trans_csum	Transport-layer checksum to complete, or NULL
70 70
  * @ret rc		Return status code
71 71
  */

+ 1
- 1
src/net/udp.c Dosyayı Görüntüle

@@ -143,7 +143,7 @@ int udp_senddata ( struct udp_connection *conn ) {
143 143
  *
144 144
  * @v conn		UDP connection
145 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 147
  * @v data		Data to send
148 148
  * @v len		Length of data
149 149
  * @ret rc		Return status code

+ 3
- 0
src/usr/dhcpmgmt.c Dosyayı Görüntüle

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

Loading…
İptal
Kaydet