Date: Mon, 10 Jun 1996 16:43:35 -0700 From: Jason Thorpe <thorpej@nas.nasa.gov> To: Ted Lemon <mellon@fugue.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Swapped ethertype in BPF output? Message-ID: <199606102343.QAA19007@lestat.nas.nasa.gov>
next in thread | raw e-mail | index | archive | help
On Mon, 10 Jun 1996 16:05:18 -0700 Ted Lemon <mellon@fugue.com> wrote: > I'm the author of the Internet Software Consortium DHCP server. One > of the operating systems on which ISC dhcpd is supported is FreeBSD. > A FreeBSD user has reported a problem in that on FreeBSD, BPF > apparently swaps the ethertype supplied by the user program when > sending a packet. If true, this breaks code in dhcpd that works on > all other platforms that support BPF, including NetBSD, BSD/OS, and > DEC Alpha OSF/1. > > Is this user correct, and if so, is this a known bug that is going to > be fixed, or a ``feature''? The FreeBSD port is completely clean > other than this, and I would really prefer not to have to put in an > ifdef for something like this. Hi Ted ... long time no see :-) It's not just the ethertype, from what I can tell...See the following kludge in NetBSD's rbootd(8) (the HP Remote Maintainance Protocol boot server): int SendPacket(rconn) register RMPCONN *rconn; { /* * Set Ethernet Destination address to Source (BPF and the enet * driver will take care of getting our source address set). */ bcopy((char *)&rconn->rmp.hp_hdr.saddr[0], (char *)&rconn->rmp.hp_hdr.daddr[0], RMP_ADDRLEN); #ifdef __FreeBSD__ /* BPF (incorrectly) wants this in host order. */ rconn->rmp.hp_hdr.len = rconn->rmplen - sizeof(struct hp_hdr); #else rconn->rmp.hp_hdr.len = htons(rconn->rmplen - sizeof(struct hp_hdr)); #endif /* * Reverse 802.2/HP Extended Source & Destination Access Pts. */ rconn->rmp.hp_llc.dxsap = htons(HPEXT_SXSAP); rconn->rmp.hp_llc.sxsap = htons(HPEXT_DXSAP); [ . . . ] It's been there ever since Mike Hibler and I helped a fellow recover a fairly dead HP-BSD system ... the guy ended up netbooting NetBSD/hp300, mounting his HP-BSD filesystems, and recovering his data (darn, those old HP-IB drives :-) All the guy had was a NeXT and a PC on which he could install FreeBSD (happened to have a 2.0.5 CD laying around...) I don't know if it's a bug or feature (and, am not really willing to make a guess either way :-), but just wanted to point out that it seems as if the packet length needs to be in the wrong order, too... ----save the ancient forests - http://www.bayarea.net/~thorpej/forest/---- Jason R. Thorpe thorpej@nas.nasa.gov NASA Ames Research Center Home: 408.866.1912 NAS: M/S 258-6 Work: 415.604.0935 Moffett Field, CA 94035 Pager: 415.428.6939
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606102343.QAA19007>