Bugzilla – Full Text Bug Listing |
Summary: | It is possible to register several times the same route | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Matthieu Coudron <mattator> |
Component: | internet | Assignee: | Tom Henderson <tomh> |
Status: | ASSIGNED --- | ||
Severity: | minor | CC: | ns-bugs, tomh, tommaso.pecorella |
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | All | ||
OS: | All |
Description
Matthieu Coudron
2015-09-15 08:07:44 EDT
The behaviour is not limited to GlobalRouting. Also Ipv[4,6]StaticRouting has the same behaviour. basically all the Add[Host,Network]Route functions are assuming that the caller is doing the appropriate checks. The question is: what is the right behaviour ? Shall we change all the code and point in the docs that any successive call will overwrite the old route or shall we point out that it's the caller responsibility to not add duplicate routes ? As a side note, removing a route requires that you knows its index or the *exact* parameters of the route. In the second case, if two identical routes exist, the first will be removed. I would like to propose that the behavior be for IPv4/v6 static routing, and global routing, that any attempt to add multiple routes lead to a NS_LOG_WARN() that the route already exists, and prevent adding duplicate entries. I can work on a patch. |