From olivleh1@kartoffel.salatschuessel.net  Mon Nov 25 13:14:48 2002
Return-Path: <olivleh1@kartoffel.salatschuessel.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9312437B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Nov 2002 13:14:48 -0800 (PST)
Received: from kartoffel.salatschuessel.net (p5084B556.dip.t-dialin.net [80.132.181.86])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 83E3243E88
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Nov 2002 13:14:36 -0800 (PST)
	(envelope-from olivleh1@kartoffel.salatschuessel.net)
Received: from kartoffel.salatschuessel.net (localhost [127.0.0.1])
	by kartoffel.salatschuessel.net (8.12.6/8.12.6) with ESMTP id gAPLE3lw058365;
	Mon, 25 Nov 2002 22:14:03 +0100 (CET)
	(envelope-from olivleh1@kartoffel.salatschuessel.net)
Received: (from olivleh1@localhost)
	by kartoffel.salatschuessel.net (8.12.6/8.12.6/Submit) id gAPLE27W058364;
	Mon, 25 Nov 2002 22:14:02 +0100 (CET)
Message-Id: <200211252114.gAPLE27W058364@kartoffel.salatschuessel.net>
Date: Mon, 25 Nov 2002 22:14:02 +0100 (CET)
From: Oliver Lehmann <lehmann@ans-netz.de>
Reply-To: Oliver Lehmann <lehmann@ans-netz.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Oliver Lehmann <lehmann@ans-netz.de>
Subject: make rbootd transfere the default file if it's undefined by the client
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45729
>Category:       kern
>Synopsis:       [libexec] [patch] make rbootd transfer 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:  Mon Jan 14 04:49:38 UTC 2008
>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:
