Browse Source

DHCP transmits via specified net device, so no need to create a dummy

routing table entry just to fool ipv4.c any more.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
649b789e93
2 changed files with 2 additions and 10 deletions
  1. 2
    2
      src/net/udp/dhcp.c
  2. 0
    8
      src/tests/dhcptest.c

+ 2
- 2
src/net/udp/dhcp.c View File

582
 	}
582
 	}
583
 
583
 
584
 	/* Transmit the packet */
584
 	/* Transmit the packet */
585
-	if ( ( rc = udp_sendto ( conn, &sa_dhcp_server.st,
586
-				 dhcppkt.dhcphdr, dhcppkt.len ) ) != 0 ) {
585
+	if ( ( rc = udp_sendto_via ( conn, &sa_dhcp_server.st, dhcp->netdev,
586
+				     dhcppkt.dhcphdr, dhcppkt.len ) ) != 0 ) {
587
 		DBG ( "Could not transmit UDP packet\n" );
587
 		DBG ( "Could not transmit UDP packet\n" );
588
 		return rc;
588
 		return rc;
589
 	}
589
 	}

+ 0
- 8
src/tests/dhcptest.c View File

218
 	char filename[256];
218
 	char filename[256];
219
 	int rc;
219
 	int rc;
220
 
220
 
221
-	/* Bring IP interface up with address 0.0.0.0 */
222
-	if ( ( rc = add_ipv4_address ( netdev, address, netmask,
223
-				       gateway ) ) != 0 )
224
-		goto out_no_del_ipv4;
225
-
226
 	/* Issue DHCP request */
221
 	/* Issue DHCP request */
227
 	printf ( "DHCP (%s)...", netdev->name );
222
 	printf ( "DHCP (%s)...", netdev->name );
228
 	memset ( &dhcp, 0, sizeof ( dhcp ) );
223
 	memset ( &dhcp, 0, sizeof ( dhcp ) );
251
 	if ( filename[0] )
246
 	if ( filename[0] )
252
 		printf ( "Bootfile name \"%s\"\n", filename );
247
 		printf ( "Bootfile name \"%s\"\n", filename );
253
 
248
 
254
-	/* Remove old IP address configuration */
255
-	del_ipv4_address ( netdev );
256
-
257
 	/* Set up new IP address configuration */
249
 	/* Set up new IP address configuration */
258
 	if ( ( rc = add_ipv4_address ( netdev, address, netmask,
250
 	if ( ( rc = add_ipv4_address ( netdev, address, netmask,
259
 				       gateway ) ) != 0 )
251
 				       gateway ) ) != 0 )

Loading…
Cancel
Save