From 0541e456c99088d0cfcf7eae1564f6e59e1429d5 Mon Sep 17 00:00:00 2001 From: Roman Kurakin Date: Sat, 9 Jul 2005 16:14:05 +0000 Subject: [PATCH] Use m_length (m, NULL) instead of m->m_pkthdr.len. Problems reported by: strijar at urai dot ru Approved by: re (scottl) --- sys/dev/cp/if_cp.c | 2 +- sys/dev/ctau/if_ct.c | 2 +- sys/dev/cx/if_cx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index bd18f2561f5..a5692fdc543 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -824,7 +824,7 @@ static void cp_send (drv_t *d) if (d->ifp->if_bpf) BPF_MTAP (d->ifp, m); #endif - len = m->m_pkthdr.len; + len = m_length (m, NULL); if (len >= BUFSZ) printf ("%s: too long packet: %d bytes: ", d->name, len); diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index f026a9fbbc0..f231820816e 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -1033,7 +1033,7 @@ static void ct_send (drv_t *d) if (d->ifp->if_bpf) BPF_MTAP (d->ifp, m); #endif - len = m->m_pkthdr.len; + len = m_length (m, NULL); if (! m->m_next) ct_send_packet (d->chan, (u_char*)mtod (m, caddr_t), len, 0); diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index 4f757f6c3ee..7b0425e412e 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -1188,7 +1188,7 @@ static void cx_send (drv_t *d) if (d->ifp->if_bpf) BPF_MTAP (d->ifp, m); #endif - len = m->m_pkthdr.len; + len = m_length (m, NULL); if (! m->m_next) cx_send_packet (d->chan, (u_char*)mtod (m, caddr_t), len, 0);