How do we determine IP Address of interface the packet arrived on

정현 struct.architect at gmail.com
Wed Sep 24 08:03:01 EDT 2014


And you should be careful about obtained IP address, because it is made by
IP spoofing attack or some sort of IP camo technique.

Hope this helps too,
Hyun
On Sep 24, 2014 4:42 PM, "Vlad Dogaru" <ddvlad at herebedragons.ro> wrote:

> On Wed, Sep 24, 2014 at 10:19:34AM +0530, Maninder Singh wrote:
> > Hi,
> >
> > Each time a packet arrives at a router in a subnet during transit, I
> > need to determine the IP address of the incoming interface of the
> > router for that packet. I have a netfilter kernel module running at
> > each router but I dont understand which data structure will give me
> > thw IP address. Can someone please suggest how shall I get that?
>
> An interface can have more than one IP address, so your question is a
> little strange.
>
> However, you can find out all the IPv4 addresses a particular device has
> by iterating through dev->ip_ptr->ifa_list.
>
> Hope this helps,
> Vlad
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140924/12e024c7/attachment.html 


More information about the Kernelnewbies mailing list