Bug 1821

Summary: Setting an interface to Down state will cause various asserts in IPv6
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: ipv6Assignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: major CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch

Description Tommaso Pecorella 2013-12-31 13:43:58 UTC
Created attachment 1749 [details]
patch

There are a couple of bugs in Ipv6StaticRouting and Ipv6Interface that will cause panic when an interface is made Down at runtime.

1) Ipv6Interface will not flush the Ndisc entries. The entry NUD timeout will try to use that interface to do the NUD -> assert.

2) The routing table entries following an interface removal in Ipv6StaticRouting is not "safe", since the loop is based on the number of entries, which is changed when you remove one.

The patch fixes this.

Moreover, since it is safer (in any case) to use an iterator over looping through the number of routing table entries, I modified the loops to use an iterator.

For code homogeneity, I also modified Ipv*4*StaticRouting. The code shouldn't be affected directly by this issue (the condition is dynamically checked), but it's still better to use iterators.
Comment 1 Tommaso Pecorella 2013-12-31 13:49:36 UTC
changeset:   10551:e0fa0db84b6b