Bug #2649
closed
SyncLogicHandler does not check validity of SyncSocket before use
Added by Vince Lehman over 9 years ago.
Updated over 9 years ago.
Description
Currently, a SyncSocket is not created until the router builds its first Adjacency LSA.
When the router refreshes its LSAs, it publishes a new routing update which uses the SyncSocket.
If the router refreshes its LSAs before it first builds an Adjacency LSA, SyncLogicHandler will try to use the SyncSocket pointer before an object is created resulting in a segfault.
The sync socket should be created on initialization to fix this issue.
Why is the SyncSocket created only after the first Adjacency LSA is created?
Can we create it at initialization?
I got exactly the same question as Junxiao after trying to review http://gerrit.named-data.net/#/c/1879. Why do we have such an artifact? Creating sync socket doesn't seem to involve any communication operations (or does it?).
Yeah, I agree with both of you. I can't remember why this feature (creating the sync socket after the first Adjacency LSA) was requested in the first place.
I will look through my emails and the associated Redmine issues to see if there is an explanation.
- Description updated (diff)
I can't find any reason why the sync socket can't be created on initialization.
At the worst, a recovering router might receive sync updates for its own outdated LSAs, but there are checks in the code to prevent a router from trying to fetch its own LSAs.
Then can you modify the code to create the syncsocket at the beginning?
Lan Wang wrote:
Then can you modify the code to create the syncsocket at the beginning?
Yes, I will push an updated patch shortly.
- Status changed from In Progress to Code review
- % Done changed from 0 to 90
- Status changed from Code review to Closed
- % Done changed from 90 to 100
- Related to Bug #5009: Sync interest should be sent only after NLSR has registered routes added
Also available in: Atom
PDF