From owner-p4-projects Fri Sep 27 10: 1:32 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1C92137B406; Fri, 27 Sep 2002 10:01:31 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCA1637B404 for ; Fri, 27 Sep 2002 10:01:30 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 784EF43E81 for ; Fri, 27 Sep 2002 10:01:30 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8RH1UCo071297 for ; Fri, 27 Sep 2002 10:01:30 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8RH1Uii071294 for perforce@freebsd.org; Fri, 27 Sep 2002 10:01:30 -0700 (PDT) Date: Fri, 27 Sep 2002 10:01:30 -0700 (PDT) Message-Id: <200209271701.g8RH1Uii071294@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 18211 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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