Use m_length (m, NULL) instead of m->m_pkthdr.len.

Problems reported by: strijar at urai dot ru
Approved by:	re (scottl)
This commit is contained in:
Roman Kurakin 2005-07-09 16:14:05 +00:00
parent ea78cad4bf
commit 0541e456c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147862
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);