diff options
author | Luigi Rizzo <luigi@FreeBSD.org> | 2002-04-04 05:42:09 +0000 |
---|---|---|
committer | Luigi Rizzo <luigi@FreeBSD.org> | 2002-04-04 05:42:09 +0000 |
commit | 7d3e4c6e71644d51cb644ccef9d65bbf0bfc5c96 (patch) | |
tree | 5169d68ccee6707c197fe9453bd1ece3b92a55b2 /sys/net/ethernet.h | |
parent | 61b60edfd3fff20f884419f8097870c7045315c9 (diff) | |
download | src-7d3e4c6e71644d51cb644ccef9d65bbf0bfc5c96.tar.gz src-7d3e4c6e71644d51cb644ccef9d65bbf0bfc5c96.zip |
Fix a couple of incorrect m_free() vs. m_freem() usages and related issues.
Reviewed-by: brooks
Notes
Notes:
svn path=/head/; revision=93748
Diffstat (limited to 'sys/net/ethernet.h')
-rw-r--r-- | sys/net/ethernet.h | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index ca6325a53215..826363d57a65 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -102,36 +102,16 @@ extern void (*ng_ether_detach_p)(struct ifnet *ifp); extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m); extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m, u_int16_t t); -#define _VLAN_INPUT(eh, m) do { \ - if (vlan_input_p != NULL) { \ - if ((*vlan_input_p)(eh, m) == -1) \ - (m)->m_pkthdr.rcvif->if_noproto++; \ - } else { \ - m_free(m); \ - (m)->m_pkthdr.rcvif->if_noproto++; \ - } \ -} while (0) - -#define VLAN_INPUT(eh, m) do { \ - /* XXX: lock */ \ - _VLAN_INPUT(eh, m); \ - /* XXX: unlock */ \ -} while (0) - -#define _VLAN_INPUT_TAG(eh, m, t) do { \ - if (vlan_input_tag_p != NULL) { \ - if ((*vlan_input_tag_p)(eh, m, t) == -1) \ - (m)->m_pkthdr.rcvif->if_noproto++; \ - } else { \ - m_free(m); \ - (m)->m_pkthdr.rcvif->if_noproto++; \ - } \ -} while (0) -#define VLAN_INPUT_TAG(eh, m, t) do { \ - /* XXX: lock */ \ - _VLAN_INPUT_TAG(eh, m, t); \ - /* XXX: unlock */ \ +#define VLAN_INPUT_TAG(eh, m, t) do { \ + /* XXX: lock */ \ + if (vlan_input_tag_p != NULL) \ + (*vlan_input_tag_p)(eh, m, t); \ + else { \ + (m)->m_pkthdr.rcvif->if_noproto++; \ + m_freem(m); \ + } \ + /* XXX: unlock */ \ } while (0) #else /* _KERNEL */ |