LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-07-2014, 06:57 AM   #1
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Rep: Reputation: Disabled
link local address notification


Hi, I am using a application which runs in kernel as kernel module. This kernel module creates netdevice in the stack. During runtime this netdevice is made if flag UP and DOWN. When this netdevice is made UP, my kernel module need to know the ipv6 link local address learnt on this netdevice. For this my kernel module register a callback for stack notifications using register_inet6addr_notifier. In my callback I listen for NETDEV_UP and NETDEV_DOWN notifications. On NETDEV_UP notification I check the ip address received as argument of callback function. and if it is link local address I try to use this. But looks it is not usable for another 1-2 sec. I can use it successfully after 1-2 sec.
Can anybody let me know which notification, and how, I should listen from kernel module to know that link local address is now usable.
 
Old 10-08-2014, 02:33 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,868

Rep: Reputation: 162Reputation: 162
How do you know the local address isn't available?
 
Old 10-10-2014, 03:44 AM   #3
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
because sendmsg call returns with "Invalid argument". And if sendmsg is retried after 1-2 sec then it works fine. I can see following content in the RFC 4862. I feel that when stack notify the link local address to application using NET_DEVUP, it is in the tentative state and so not usable.
####
tentative address - an address whose uniqueness on a link is being verified, prior to its assignment to an interface. A tentative address is not considered assigned to an interface in the usual sense. An interface discards received packets addressed to a tentative address, but accepts Neighbor Discovery packets related to Duplicate Address Detection for the tentative address
####
An address is considered unique if none of the tests indicate the presence of a duplicate address within RetransTimer milliseconds after having sent DupAddrDetectTransmits Neighbor Solicitations. Once an address is determined to be unique, it may be assigned to an interface.
####
 
Old 10-10-2014, 02:48 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,868

Rep: Reputation: 162Reputation: 162
You can try NETDEV_CHANGE notification to check weather the device is ready.
 
Old 10-13-2014, 03:13 AM   #5
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Will NETDEV_CHANGE be received only for link local address ready? Or it is received for some other link changes also? How to know that it is received for link local address ready?
 
Old 10-13-2014, 02:29 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,868

Rep: Reputation: 162Reputation: 162
If the device is ready, link local address should be ready, too.
 
Old 10-14-2014, 01:54 AM   #7
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
So I understand that NETDEV_CHANGE will only be received indicating device ready. No other indication?
 
Old 10-14-2014, 10:52 AM   #8
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
I tested and found that when I do the netdev up then NETDEV_CHANGE is not received in the callback. This callback I registered with kernel using register_inet6addr_notifier. Although NETDEV_UP (for dev up) and NETDEV_DOWN (for dev down) are received.
 
Old 10-14-2014, 02:37 PM   #9
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,868

Rep: Reputation: 162Reputation: 162
You can register other notifier.
 
Old 10-15-2014, 01:45 AM   #10
toramanand
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Can you suggest which notifier I should use?
 
Old 10-16-2014, 02:16 PM   #11
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,868

Rep: Reputation: 162Reputation: 162
register_netdevice_notifier
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ipv6 local link address s_hcl Linux - Networking 1 03-29-2012 03:07 AM
Double Local Link (Scope:Link) IPv6 address on one interface BernardLinux Linux - Networking 0 09-08-2011 02:43 AM
How to view webpages using a global address and a link local address DragonKnight Linux - Newbie 0 12-11-2009 03:26 PM
Find real ip address using link local address, mdns/zeroconf dannemanare Linux - Networking 0 01-17-2008 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration