Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change child route on new rank #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lib/libndmgmt/dag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,10 @@ bool dag_network::check_security(const struct nd_rpl_dao *dao, int dao_len)
/* here we mark that a DAO is needed soon */
void dag_network::maybe_send_dao(void)
{
if(dao_needed && dag_bestparent != NULL) {
if(!root_node()) {
schedule_dao();
}
dao_needed = false;
if(dao_needed && dag_bestparent && !root_node()) {
schedule_dao();
}
dao_needed = false;
}

void dag_network::add_childnode(rpl_node *announcing_peer,
Expand All @@ -433,7 +431,7 @@ void dag_network::add_childnode(rpl_node *announcing_peer,
char b1[256];
subnettot(&prefix, 0, b1, 256);

if(!pre.is_installed()) {
//if(!pre.is_installed()) {
dao_needed = true;
pre.set_debug(this->debug);
pre.set_prefix(prefix);
Expand All @@ -442,7 +440,7 @@ void dag_network::add_childnode(rpl_node *announcing_peer,
announcing_peer->add_route_via_node(prefix, iface);
set_dao_needed();
pre.set_installed(true);
}
//}
#if 0
debug->verbose("added child node %s/%s from %s\n",
b1, pre.node_name(),
Expand Down Expand Up @@ -1133,4 +1131,3 @@ bool dag_network::set_interface_filter(const char *filter)
* compile-command: "make programs"
* End:
*/

2 changes: 1 addition & 1 deletion lib/libndmgmt/netlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool network_interface::add_route_to_node(const ip_subnet &prefix,
addrtot(&src, 0, sbuf, sizeof(sbuf));

snprintf(buf, 1024,
"ip -6 route add %s via %s dev %s src %s", pbuf, tbuf, if_name, sbuf);
"ip -6 route replace %s via %s dev %s src %s", pbuf, tbuf, if_name, sbuf);

debug->log(" invoking %s\n", buf);
nisystem(buf);
Expand Down