Module Name: src Committed By: manu Date: Sat May 2 21:06:51 UTC 2009
Modified Files: src/sys/nfs: nfs_bootdhcp.c Log Message: - Silence warning when running with debug enabled - Remind the administrator about the required DHCP option when some are missing, instead of silently failing, you stupid computer! To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/nfs/nfs_bootdhcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/nfs/nfs_bootdhcp.c diff -u src/sys/nfs/nfs_bootdhcp.c:1.45 src/sys/nfs/nfs_bootdhcp.c:1.46 --- src/sys/nfs/nfs_bootdhcp.c:1.45 Wed Nov 19 18:36:09 2008 +++ src/sys/nfs/nfs_bootdhcp.c Sat May 2 21:06:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_bootdhcp.c,v 1.45 2008/11/19 18:36:09 ad Exp $ */ +/* $NetBSD: nfs_bootdhcp.c,v 1.46 2009/05/02 21:06:51 manu Exp $ */ /*- * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nfs_bootdhcp.c,v 1.45 2008/11/19 18:36:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_bootdhcp.c,v 1.46 2009/05/02 21:06:51 manu Exp $"); #ifdef _KERNEL_OPT #include "opt_nfs_boot.h" @@ -271,8 +271,11 @@ goto out; } - if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) + if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) { + printf("nfs_boot: missing options (need IP, netmask, " + "gateway, next-server, root-path)\n"); return EADDRNOTAVAIL; + } out: if (error) { @@ -322,13 +325,13 @@ * Is this a valid reply? */ if (m->m_pkthdr.len < BOOTP_SIZE_MIN) { - DPRINTF(("bootpcheck: short packet %d < %d\n", m->m_pkthdr.len, - BOOTP_SIZE_MIN)); + DPRINTF(("bootpcheck: short packet %d < %ld\n", + m->m_pkthdr.len, BOOTP_SIZE_MIN)); return (-1); } if (m->m_pkthdr.len > BOOTP_SIZE_MAX) { - DPRINTF(("Bootpcheck: long packet %d > %d\n", m->m_pkthdr.len, - BOOTP_SIZE_MAX)); + DPRINTF(("Bootpcheck: long packet %d > %ld\n", + m->m_pkthdr.len, BOOTP_SIZE_MAX)); return (-1); }