Bug #2649
closedSyncLogicHandler does not check validity of SyncSocket before use
100%
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.
Updated by Junxiao Shi over 9 years ago
Why is the SyncSocket created only after the first Adjacency LSA is created?
Can we create it at initialization?
Updated by Alex Afanasyev over 9 years ago
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?).
Updated by Vince Lehman over 9 years ago
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.
Updated by Vince Lehman over 9 years ago
- 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.
Updated by Vince Lehman over 9 years ago
- Blocks Feature #1834: Runtime advertise and withdraw added
Updated by Lan Wang over 9 years ago
Then can you modify the code to create the syncsocket at the beginning?
Updated by Vince Lehman over 9 years ago
Lan Wang wrote:
Then can you modify the code to create the syncsocket at the beginning?
Yes, I will push an updated patch shortly.
Updated by Vince Lehman over 9 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 90
Updated by Vince Lehman over 9 years ago
- Status changed from Code review to Closed
- % Done changed from 90 to 100
Updated by Ashlesh Gawande almost 5 years ago
- Related to Bug #5009: Sync interest should be sent only after NLSR has registered routes added