libipq and destination IP address
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
I am writing a small libipq program to extract packet info. I "queued" all packets in the OUTPUT chain. It looks like the packet has the same source and destination packet ( = host interface address). Why is that? Is there a way in libipq to extract the REAL destination address?
Thanks,
Khoa
Hi,
Quoted 7 lines · Khoa Nguyen
Hi,
I am writing a small libipq program to extract packet info. I "queued" all packets in the OUTPUT chain. It looks like the packet has the same source and destination packet ( = host interface address). Why is that? Is there a way in libipq to extract the REAL destination address?
First of all: switch to libnetfilter_queue
For your question, libipq sends to userspace the whole content of the packet. Thus there is no potential problem of address rewriting. You can have a look at the following code extract from NuFW:
http://docs.nufw.org/doxygen/trunk/html/packetsrv_8c-source.html#l00292
BR,
Signature · 3 lines
Éric Leblond, [email protected] Téléphone : 01 44 89 46 40, Fax : 01 44 89 45 01 INL, http://www.inl.fr
Hi,
Thanks for your response. Actually, the problem is inet_ntoa() function -- I should have printed out the IP address right away before calling the function again
Thanks,
Khoa
Quoted 25 lines · Eric Leblond
Hi,
Quoted 7 lines · Khoa Nguyen
Hi,
I am writing a small libipq program to extract packet info. I "queued" all packets in the OUTPUT chain. It looks like the packet has the same source and destination packet ( = host interface address). Why is that? Is there a way in libipq to extract the REAL destination address?
First of all: switch to
libnetfilter_queueFor your question, libipq sends to userspace the whole content of the packet. Thus there is no potential problem of address rewriting. You can have a look at the following code extract from NuFW:
http://docs.nufw.org/doxygen/trunk/html/packetsrv_8c-source.html#l00292BR,
--
Éric Leblond, [email protected]
Téléphone : 01 44 89 46 40, Fax : 01 44 89 45 01
INL, http://www.inl.fr