Problem with ifnet_output_raw on ethernet card
Problem with ifnet_output_raw on ethernet card
- Subject: Problem with ifnet_output_raw on ethernet card
- From: Matteo Merli <email@hidden>
- Date: Tue, 3 Jul 2007 15:03:11 +0200
Hi,
I'm having problems when re-injecting packet from my interface filter.
The strange fact is the re-injection is working _fine_ through
Airport network card but it fails when using ethernet card (en0).
The mbuf I'm re-injecting is the mbuf I receive from a control socket
callback and the code is this:
============================================
mbuf_settype( pkt_buf, MBUF_TYPE_HEADER );
mbuf_adj( pkt_buf, sizeof(SocketMessage) ); // To delete my custom
header struct
size_t hdr_len = ifnet_hdrlen( msg->interface );
mbuf_pkthdr_setheader( pkt_buf, msg->packet );
mbuf_pkthdr_setrcvif( pkt_buf, msg->interface );
setTag( &pkt_buf, Outbound );
mbuf_outbound_finalize( pkt_buf, PF_INET, hdr_len );
mbuf_inbound_modified( pkt_buf );
mbuf_clear_csum_requested( pkt_buf );
ifnet_output_raw( msg->interface, PF_INET, pkt_buf );
============================================
I guess the problems rely on some mbuf flag or checksum calculation
issue I'm using badly...
What are the steps needed to inject a "self-builded" mbuf packet?
Thank you,
Matteo Merli
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden