From 11b14351b053affa40adbcbb1f2db362c54b425e Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 17 Nov 2002 12:00:00 -0500 Subject: [PATCH] Application of mopd-2.5.3-freebsd-put.patch: * Sun Nov 17 2002 Maciej W. Rozycki 2.5.3-15 - handle the FreeBSD peculiarities when sending 802.3 frames; from FreeBSD patches (freebsd-put) Downloaded from: ftp://ftp.linux-mips.org/pub/linux/mips/people/macro/mopd/mopd-2.5.3-freebsd-put.patch.gz .patch SHA256 = 30f88f8670e875e8617ff2ebf734e116065d4375b186559c9f360ce58578795b Patch history copied from: ftp://ftp.linux-mips.org/pub/linux/mips/people/macro/mopd/mopd-2.5.3-15.spec --- common/put.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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: