site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=AJfJD6NpG83WqeDlCdijqGTkbJKHmUZmm1xZAz/aSno=; b=vnHKf1o/T/icg4Kn4zXBGf79HKLeZy+QYoglpTfgvxp9E62FHzjbAMfVQDXRiGKYJY F7Oc0PPT3s8pzhVV/f3x7f00QWvs1CANL2DwGSi2tVJxdZnqOMA/5X61F/6np1xWLkNQ mOYP1aDONh6+rWnKXj5qLkHa/DFjUEC/ZPnRc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=CVg39aB3ubiH9vgm5CEbKXU9mpAQZSNbLNTrdiAaPhi9YwaP33J9legUh/WlboJ6pO Hl6baBhEvHa5POtozOHRnnOiEEm6AfSPOKdxpgLnQw34YBbD9ePzq4lwznjCmDbe6Vta x1EjbtVjzqIXFWtiFSebTIP5Nzr9xT80UnlyA= On Mon, Apr 26, 2010 at 1:09 PM, Andy Huang <andy.y.huang@gmail.com> 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Aaron Turner