Re: pcap_inject
Re: pcap_inject
- Subject: Re: pcap_inject
- From: Aaron Turner <email@hidden>
- Date: Mon, 26 Apr 2010 13:21:09 -0700
On Mon, Apr 26, 2010 at 1:09 PM, Andy Huang <email@hidden> wrote:
> Hi,
>
>
>
> I am trying to write a daemon program that sets up the tunnel, with root
> privilege. After I received the packet from the tunnel, then I need to
> inject the packet to the stack, So I I used the pcap_inject, and it works
> w/o error, I can verify that by looking at the wireshark and the packet is
> correct, but the the client application tha tries to receive the packet just
> won't be able to receive that packet. the following is the packet from
> wireshark. Notice it is a multicast packet.
>
> 0000 01 00 5e 1b 6a 01 00 21 91 7e fd d5 08 00 45 00 ..^.j..! .~....E.
> 0010 00 4a 5e 2d 00 00 1e 11 57 83 20 61 74 75 e8 1b .J^-.... W. atu..
> 0020 6a 01 04 24 30 39 00 36 ec 6d 41 54 26 54 20 4d j..$09.6 .mAT&T M
> 0030 75 6c 74 69 63 61 73 74 0d 0a 4d 6f 6e 20 41 70 ulticast ..Mon Ap
> 0040 72 20 32 36 20 31 34 3a 31 37 3a 30 39 20 43 44 r 26 14: 17:09 CD
> 0050 54 20 32 30 31 30 0d 0a T
> 2010..
>
>
>
> But the multicast receiver just can't receive the packet. If I run the
> multicast sender and receiver on the same PC, the multicast receiver program
> is able to receive the packet, I compare the packet, the only difference is
> the src address.
pcap_inject sends packets *out* the interface, bypassing the routing
table & IP stack of the host sending the packet. Wireshark sees the
packets on the way out, but your client application will never see
them. You'll need to parse out the payload of the packet and use the
standard socket calls to send packets to the host.
--
Aaron Turner
http://synfin.net/ Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
"carpe diem quam minimum credula postero"
_______________________________________________
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
References: | |
| >pcap_inject (From: Andy Huang <email@hidden>) |