Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2002 10:01:30 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 18211 for review
Message-ID:  <200209271701.g8RH1Uii071294@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18211

Change 18211 by rwatson@rwatson_tislabs on 2002/09/27 10:01:02

	Manually merge the NFS diskless patch I committed to the main
	tree: PXE will set the mygateway field, but set the IP to 0 if
	DHCP doesn't return the value.  Take that into account and try
	to add the default route if it's 0, avoiding the panic that
	results.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/nfsclient/nfs_vfsops.c#16 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/nfsclient/nfs_vfsops.c#16 (text+ko) ====

@@ -438,8 +438,12 @@
 
 	/*
 	 * If the gateway field is filled in, set it as the default route.
+	 * Note that pxeboot will set a default route of 0 if the route
+	 * is not set by the DHCP server.  Check also for a value of 0
+	 * to avoid panicking inappropriately in that situation.
 	 */
-	if (nd->mygateway.sin_len != 0) {
+	if (nd->mygateway.sin_len != 0 &&
+	    nd->mygateway.sin_addr.s_addr != 0) {
 		struct sockaddr_in mask, sin;
 
 		bzero((caddr_t)&mask, sizeof(mask));

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209271701.g8RH1Uii071294>