Hi.. Thanks for your reply. I agree that an interface can have more than one ipv6 addresses but in the PoC I am doing for an IP Traceback technique, I need to record a hash of the IP of incoming interface. For that I need to be able to read the packet. Your reply gave me a direction to explore the use of dev->ip6_ptr->ac_list .. For ipv6. However I m not sure what is ac_list and what is mc_list here.. I wonder if there is some documentation around it in this world. Can you please give me a pointer or if you could brief me about how do I list all ipv6 addresses of the interface. Well, yet I tried to get the ip addresses pointed to by ac_list and before I could see if it displays something, system slows down unbelievably with syllogism error as 'takedown serio0. Some program might be trying to access hardware directly." And mouse stops moving. I am not sure if this error is a result of my operation or something else. I will try loading this module Again. But any comments from your side on this please? Thanks Maninder
On 24-Sep-2014, at 1:11 pm, Vlad Dogaru <ddvlad@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