Ok this is driving me crazy, as you probable know from my other
messages I am filtering packets at the DLIL interface layer, my problem is that
when ever I call dlil_inject_if_input my Mac crashes. Below is the code in my
interface filter input routine:
Int My_intr_filtr_input(caddr_t cookie, struct
ifnet **ifnet_ptr, struct mbuf **m_orig, char **frame_ptr)
{
struct My_Attached_Filters *ifb = (struct
My_Attached_Filters *) cookie;
char *pHeader;
pHeader = *frame_ptr;
struct mbuf *m;
m
= *m_orig;
u_int16_t etype = ntohs(*(u_int16_t*)&pHeader[12]);
if(eType == ETHERTYPE_IP || eType == ETHERTYPE_ARP)
{
dlil_inject_if_input(m, pHeader, ifb->nfilter_id);
*m_orig
= NULL;
}
return
*m_orig != NULL ? 0: EJUSTRETURN;
}
Of course every thing runs fine if I comment out the dlil_inject_if_input
function call and the *m_orig = NULL; line. I have tried adjusting to where
m->m_data points, like m->m_data – 14, thinking dlil_inject_if_input
wanted to be pointing to the beginning of the Ethernet frame but no matter how
I try to call dlil_inject_if_input I get a crash. The documentation is pretty
thin in this area, so any help or suggestions would greatly be appreciated.
Yes I have checked to make sure that pHeader and ifb->nfliter_id are
pointer or contain the correct information.
Thanks
Carl