Subject: Endian-ness braindamage on ether type
To: None <port-pmax@sun-lamp.cs.berkeley.edu>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 08/16/1994 18:20:29
Somehow, both if_le.c and ether_input() are doing an ntohs()
on the ethertype of arriving packets. This doesn't work, in general.
The following fix works for me. With it I can telnet out (using the
Ultrix binary) from a 3max. Ultrix nfs_mount can find mount handles,
and Ultrix nfs mounts should work *read-write* soon.
I don't know what the NetBSD Official Architectural Position is on
whether it's the device-specific drivers or ether_input() who should
be byteswapping eh->ether_type. Could someone who knows for sure
make the appropriate fix to if_le.c:leread() if I guessed the wrong
way?
*** sys/net/if_ethersubr.c.DIST Wed Jun 29 03:30:26 1994
--- sys/net/if_ethersubr.c Tue Aug 16 18:05:20 1994
***************
*** 332,338 ****
--- 332,342 ----
if (m->m_flags & (M_BCAST|M_MCAST))
ifp->if_imcasts++;
+ #ifdef BRAINDAMAGE
etype = ntohs(eh->ether_type);
+ #else
+ etype = eh->ether_type;
+ #endif
switch (etype) {
#ifdef INET
case ETHERTYPE_IP:
------------------------------------------------------------------------------