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

John de la Garza john at jjdev.com
Wed Sep 24 10:08:29 EDT 2014


On Wed, Sep 24, 2014 at 10:41:54AM +0300, Vlad Dogaru 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.
> 

why not look at the destination ip of the ip header?



More information about the Kernelnewbies mailing list