diff --git a/common/put.c b/common/put.c index 5824a27..60ba663 100644 --- a/common/put.c +++ b/common/put.c @@ -34,6 +34,9 @@ static char rcsid[] = "$Id: put.c,v 1.5 1996/08/16 22:42:56 moj Exp $"; #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include "mopdef.h" void @@ -147,10 +150,7 @@ mopPutHeader(pkt, index, dst, src, proto, trans) mopPutChar (pkt, index, 0x00); mopPutChar (pkt, index, 0x2b); } -#if !defined(__FreeBSD__) - mopPutChar(pkt, index, (proto / 256)); - mopPutChar(pkt, index, (proto % 256)); -#else +#if defined(__FreeBSD__) && __FreeBSD_version < 220000 if (trans == TRANS_ETHER) { mopPutChar(pkt, index, (proto % 256)); mopPutChar(pkt, index, (proto / 256)); @@ -158,6 +158,9 @@ mopPutHeader(pkt, index, dst, src, proto, trans) mopPutChar(pkt, index, (proto / 256)); mopPutChar(pkt, index, (proto % 256)); } +#else + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); #endif if (trans != TRANS_8023) mopPutShort(pkt, index, 0); @@ -180,12 +183,12 @@ mopPutLength(pkt, trans, len) break; case TRANS_8023: index = 12; -#if !defined(__FreeBSD__) - mopPutChar(pkt, &index, ((len - 14) / 256)); +#if defined(__FreeBSD__) && __FreeBSD_version < 220000 mopPutChar(pkt, &index, ((len - 14) % 256)); + mopPutChar(pkt, &index, ((len - 14) / 256)); #else - mopPutChar(pkt, &index, ((len - 14) % 256)); mopPutChar(pkt, &index, ((len - 14) / 256)); + mopPutChar(pkt, &index, ((len - 14) % 256)); #endif break; case TRANS_FDDI_8021H: