<p dir="ltr">And you should be careful about obtained IP address, because it is made by IP spoofing attack or some sort of IP camo technique.</p>
<p dir="ltr">Hope this helps too,<br>
Hyun</p>
<div class="gmail_quote">On Sep 24, 2014 4:42 PM, "Vlad Dogaru" <<a href="mailto:ddvlad@herebedragons.ro">ddvlad@herebedragons.ro</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Sep 24, 2014 at 10:19:34AM +0530, Maninder Singh wrote:<br>
> Hi,<br>
><br>
> Each time a packet arrives at a router in a subnet during transit, I<br>
> need to determine the IP address of the incoming interface of the<br>
> router for that packet. I have a netfilter kernel module running at<br>
> each router but I dont understand which data structure will give me<br>
> thw IP address. Can someone please suggest how shall I get that?<br>
<br>
An interface can have more than one IP address, so your question is a<br>
little strange.<br>
<br>
However, you can find out all the IPv4 addresses a particular device has<br>
by iterating through dev->ip_ptr->ifa_list.<br>
<br>
Hope this helps,<br>
Vlad<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div>