diff options
author | Bill Paul <wpaul@FreeBSD.org> | 2000-12-07 23:30:51 +0000 |
---|---|---|
committer | Bill Paul <wpaul@FreeBSD.org> | 2000-12-07 23:30:51 +0000 |
commit | 15f43fcb0bb51a159b3d3c36e85d0f2b5202ec86 (patch) | |
tree | bb191cdd00e38c8848ad3b6842f76ea53a24a039 /sys/dev/vx | |
parent | 5e1aea9fd7e05fde595747aa979fdc95709f10a9 (diff) | |
download | src-15f43fcb0bb51a159b3d3c36e85d0f2b5202ec86.tar.gz src-15f43fcb0bb51a159b3d3c36e85d0f2b5202ec86.zip |
When I converted this driver, I neglected to deal with packet alignment.
We must force payload alignment to a longword boundary to make the
alpha happy. This should stop the driver from trapping on the alpha
when the interface is ifconfig'ed (actually, when the first frame is
received).
Notes
Notes:
svn path=/head/; revision=69732
Diffstat (limited to 'sys/dev/vx')
-rw-r--r-- | sys/dev/vx/if_vx.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 30ce7ccecf6a..e1fa7605b54b 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -77,6 +77,7 @@ #define ETHER_MAX_LEN 1518 #define ETHER_ADDR_LEN 6 +#define ETHER_ALIGN 2 static struct connector_entry { int bit; @@ -687,6 +688,22 @@ again: ++ifp->if_ipackets; + { + struct mbuf *m0; + + m0 = m_devget(mtod(m, char *) - ETHER_ALIGN, + m->m_pkthdr.len + ETHER_ALIGN, 0, ifp, NULL); + + if (m0 == NULL) { + ifp->if_ierrors++; + goto abort; + } + + m_adj(m0, ETHER_ALIGN); + m_freem(m); + m = m0; + } + /* We assume the header fit entirely in one mbuf. */ eh = mtod(m, struct ether_header *); |