ng_lmi.c (4cf49a43559ed9fdad601bdcccd2c55963008675) ng_lmi.c (bef9dae05a72866e79d97d9bff3fc5a2538b4421)
1
2/*
3 * ng_lmi.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 563 unchanged lines hidden (view full) ---

572 }
573 packetlen = m->m_hdr.mh_len;
574
575 /* XXX what if it's more than 1 mbuf? */
576 if ((packetlen > MHLEN) && !(m->m_flags & M_EXT)) {
577 log(LOG_WARNING, "nglmi: packetlen (%d) too big\n", packetlen);
578 goto drop;
579 }
1
2/*
3 * ng_lmi.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 563 unchanged lines hidden (view full) ---

572 }
573 packetlen = m->m_hdr.mh_len;
574
575 /* XXX what if it's more than 1 mbuf? */
576 if ((packetlen > MHLEN) && !(m->m_flags & M_EXT)) {
577 log(LOG_WARNING, "nglmi: packetlen (%d) too big\n", packetlen);
578 goto drop;
579 }
580 if ((m = m_pullup(m, packetlen)) == NULL) {
581 log(LOG_WARNING, "nglmi: m_pullup failed for %d bytes\n", packetlen);
580 if (m->m_len < packetlen && (m = m_pullup(m, packetlen)) == NULL) {
581 log(LOG_WARNING,
582 "nglmi: m_pullup failed for %d bytes\n", packetlen);
582 NG_FREE_META(meta);
583 return (0);
584 }
585 if (nglmi_checkdata(hook, m, meta) == 0)
586 return (0);
587
588 /* pass the first 4 bytes (already checked in the nglmi_checkdata()) */
589 data = mtod(m, u_char *);

--- 501 unchanged lines hidden ---
583 NG_FREE_META(meta);
584 return (0);
585 }
586 if (nglmi_checkdata(hook, m, meta) == 0)
587 return (0);
588
589 /* pass the first 4 bytes (already checked in the nglmi_checkdata()) */
590 data = mtod(m, u_char *);

--- 501 unchanged lines hidden ---