<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, &quot;Vlad Dogaru&quot; &lt;<a href="mailto:ddvlad@herebedragons.ro">ddvlad@herebedragons.ro</a>&gt; 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>
&gt; Hi,<br>
&gt;<br>
&gt; Each time a packet arrives at a router in a subnet during transit, I<br>
&gt; need to determine the IP address of the incoming interface of the<br>
&gt; router for that packet. I have a netfilter kernel module running at<br>
&gt; each router but I dont understand which data structure will give me<br>
&gt; 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-&gt;ip_ptr-&gt;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>