Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 2002 22:14:02 +0100 (CET)
From:      Oliver Lehmann <lehmann@ans-netz.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Oliver Lehmann <lehmann@ans-netz.de>
Subject:   bin/45729: make rbootd transfere the default file if it's undefined by the client
Message-ID:  <200211252114.gAPLE27W058364@kartoffel.salatschuessel.net>

next in thread | raw e-mail | index | archive | help

>Number:         45729
>Category:       bin
>Synopsis:       make rbootd transfere the default file if it's undefined by the client
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 25 13:20:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Lehmann
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD kartoffel.salatschuessel.net 4.7-STABLE FreeBSD 4.7-STABLE #0: Thu Nov 21 15:02:15 CET 2002 olivleh1@nudel.salatschuessel.net:/usr/obj/i386/usr/src/sys/KARTOFFEL i386


>Description:
	My HP Apollo does not specify a filename to boot from. Rbootd replies
	with error code 16 (file does not exist).
	Why not let rbootd transfer the file assigned to the senders hardware
	adress (specified in the rbootd.conf) instead of aborting?
>How-To-Repeat:
	Get an older HP 700s (maybe other systems too) and try to "boot lan".
>Fix:


--- patch-src::libexec::rbootd::rmpproto.c begins here ---
--- src/libexec/rbootd/rmpproto.c.orig	Mon Nov 25 01:26:35 2002
+++ src/libexec/rbootd/rmpproto.c	Mon Nov 25 21:55:54 2002
@@ -352,11 +352,20 @@
 			goto match;
 
 	/*
-	 *  Invalid boot file name, set error and send reply packet.
+	 *  If the client didn't declare a filename to boot from, use the
+	 *  default bootimage specified in the rbootd.conf and proceed.
+	 *  In case the client specified a filename which is not available to
+	 *  boot from (not specified in the rboot.conf, or nonexistent in the
+	 *  filesystem), set error and send reply packet.
 	 */
-	rpl->r_brpl.rmp_retcode = RMP_E_NOFILE;
-	retval = 0;
-	goto sendpkt;
+	if((strlen(filename) == 0) && filelist[0]) {
+		filename = filelist[0];
+		goto match;
+	} else {
+		rpl->r_brpl.rmp_retcode = RMP_E_NOFILE;
+		retval = 0;
+		goto sendpkt;
+	}
 
 match:
 	/*
--- patch-src::libexec::rbootd::rmpproto.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

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




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