Re: arcane changling
Re: arcane changling
- Subject: Re: arcane changling
- From: "Peter Sichel" <email@hidden>
- Date: Fri, 28 Jul 2006 14:05:38 -0400
On 7/25/06, David A Rowland wrote:
>From your code and reading the documentation on csum_flags I guess that
>this is all I need to do in my case:
>
> err = mbuf_copyback(mbufPtr, 0, actualLength, pt, MBUF_WAITOK);
> mbuf_clear_csum_requested(mbufPtr);
> ipf_inject_output(mbufPtr, filterRef, options);
> result = EJUSTRETURN;
>
>The packet has been processed and put in final form (I believe) by the
>encryption routine. I copy it back into the mbuf, clear the flags and
>reinject it. But that doesn't seem to do the job.
In my experience, the documentation is incomplete and incorrect. I
ended up looking at the Darwin sources to see how to make it work.
I think you need to call mbuf_outbound_finalize() before you try to make
any changes to the packet. Next, you need to call both
mbuf_clear_csum_requested() and mbuf_inbound_modified(). Why? Because
mbuf_inbound_modified() clears the csum flags field in the mbuf.
Underneath the KPIs, it's still essentially the same BSD stack. Thus my
comment:
mbuf_inbound_modified(mbuf_ref); // mbuf->m_pkthdr.csum_flags = 0;
This part of the KPI is a bit messed up. If you try to read the flags,
they're wrong. It's worse in my case since I'm doing IP routing and/or
Ethernet bridging so mbufs can be passed from one data link to another
and change direction.
Kind Regards,
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden