mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 06:12:01 +01:00
ethernet: Fix logging of frame length
Both the mbuf length and the total packet length are signed. While here, update a stall comment to reflect the current practice. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42390
This commit is contained in:
parent
7e68976408
commit
e7102929bf
@ -534,10 +534,10 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (m->m_len < ETHER_HDR_LEN) {
|
||||
/* XXX maybe should pullup? */
|
||||
if (__predict_false(m->m_len < ETHER_HDR_LEN)) {
|
||||
/* Drivers should pullup and ensure the mbuf is valid */
|
||||
if_printf(ifp, "discard frame w/o leading ethernet "
|
||||
"header (len %u pkt len %u)\n",
|
||||
"header (len %d pkt len %d)\n",
|
||||
m->m_len, m->m_pkthdr.len);
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
m_freem(m);
|
||||
|
Loading…
Reference in New Issue
Block a user