- 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!
This commit is contained in:
parent
0a0ecc0e52
commit
20f56b3015
|
@ -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 @@ nfs_bootdhcp(struct nfs_diskless *nd, struct lwp *lwp, int *flags)
|
|||
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 @@ bootpcheck(struct mbuf *m, void *context)
|
|||
* 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue