From owner-freebsd-current@FreeBSD.ORG Fri Jun 13 20:14:57 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C76E37B401; Fri, 13 Jun 2003 20:14:57 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E26143FBF; Fri, 13 Jun 2003 20:14:56 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h5E389ZM012058; Fri, 13 Jun 2003 23:08:10 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h5E3FOZv035969; Fri, 13 Jun 2003 20:15:24 -0700 (PDT) (envelope-from jmg) Date: Fri, 13 Jun 2003 20:15:24 -0700 From: John-Mark Gurney To: FreeBSD Current , sparc64@freebsd.org Message-ID: <20030614031524.GB32701@funkthat.com> Mail-Followup-To: FreeBSD Current , sparc64@FreeBSD.org, Mark Murray Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XOIedfhf+7KOe/yw" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: Mark Murray Subject: bootpd also broke :( X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2003 03:14:57 -0000 --XOIedfhf+7KOe/yw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Well, my further diving into netbooting an Ultra 2 I have found that bootpd doesn't do select too well. It doesn't use fd_set or anything which for some reason causes it not to function on Sparc. A simple switch to using FD_* makes it function. I have also fixed a couple comments that NetBSD had already fixed. Comments? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --XOIedfhf+7KOe/yw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bootpd.patch" ? bootpd ? bootpd.8.gz ? bootptab.5.gz ? bootpgw/bootpgw ? tools/bootpef/bootpef ? tools/bootpef/bootpef.8.gz ? tools/bootptest/bootptest ? tools/bootptest/bootptest.8.gz Index: bootpd.c =================================================================== RCS file: /home/ncvs/src/libexec/bootpd/bootpd.c,v retrieving revision 1.19 diff -u -r1.19 bootpd.c --- bootpd.c 2003/02/05 13:45:25 1.19 +++ bootpd.c 2003/06/14 03:06:40 @@ -186,7 +186,8 @@ struct hostent *hep; char *stmp; int n, ba_len, ra_len; - int nfound, readfds; + int nfound; + fd_set readfds; int standalone; #ifdef SA_NOCLDSTOP /* Have POSIX sigaction(2). */ struct sigaction sa; @@ -503,14 +504,15 @@ /* * Process incoming requests. */ + FD_ZERO(&readfds); for (;;) { struct timeval tv; - readfds = 1 << s; + FD_SET(s, &readfds); if (timeout) tv = *timeout; - nfound = select(s + 1, (fd_set *)&readfds, NULL, NULL, + nfound = select(s + 1, &readfds, NULL, NULL, (timeout) ? &tv : NULL); if (nfound < 0) { if (errno != EINTR) { @@ -530,7 +532,7 @@ } continue; } - if (!(readfds & (1 << s))) { + if (!FD_ISSET(s, &readfds)) { if (debug > 1) report(LOG_INFO, "exiting after %ld minutes of inactivity", actualtimeout.tv_sec / 60); @@ -667,7 +669,7 @@ } hlen = haddrlength(bp->bp_htype); if (hlen != bp->bp_hlen) { - report(LOG_NOTICE, "bad addr len from from %s address %s", + report(LOG_NOTICE, "bad addr len from %s address %s", netname(bp->bp_htype), haddrtoa(bp->bp_chaddr, hlen)); } @@ -1024,7 +1026,7 @@ /* * If the destination address was specified explicitly - * (i.e. the broadcast address for HP compatiblity) + * (i.e. the broadcast address for HP compatibility) * then send the response to that address. Otherwise, * act in accordance with RFC951: * If the client IP address is specified, use that --XOIedfhf+7KOe/yw--