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:
parent
ea78cad4bf
commit
0541e456c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147862
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user