net: ipv6: Use correct API to remove router

net_if_ipv6_router_rm() is the correct API to remove IPv6 router
from the interface as it also cancels the timer and raises a mgmt
event. The net_if_router_rm() only sets router as unused and
nothing else.

Change-Id: I55114288c9ae748520b67b206edcd4f5e420b1af
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2017-04-27 11:22:24 +03:00 committed by Jukka Rissanen
commit d9bde9a5ab
2 changed files with 7 additions and 7 deletions

View file

@ -1365,7 +1365,7 @@ static void nd_reachable_timeout(struct k_work *work)
nbr, net_sprint_ipv6_addr(&data->addr),
data->state);
net_if_router_rm(router);
net_if_ipv6_router_rm(router);
nbr_free(nbr);
}
} else {
@ -2332,10 +2332,10 @@ static enum net_verdict handle_ra_input(struct net_pkt *pkt)
&NET_IPV6_HDR(pkt)->src);
if (router) {
if (!router_lifetime) {
/*TODO: Start rs_timer on iface if no routers
/* TODO: Start rs_timer on iface if no routers
* at all available on iface.
*/
net_if_router_rm(router);
net_if_ipv6_router_rm(router);
} else {
if (nbr) {
net_ipv6_nbr_data(nbr)->is_router = true;

View file

@ -1455,7 +1455,7 @@ static void net_rpl_nullify_parent(struct net_if *iface,
NET_DBG("Removing default route %s",
net_sprint_ipv6_addr(addr));
net_if_router_rm(dag->instance->default_route);
net_if_ipv6_router_rm(dag->instance->default_route);
dag->instance->default_route = NULL;
}
@ -1685,7 +1685,7 @@ static int net_rpl_set_default_route(struct net_if *iface,
NET_DBG("Removing default route through %s",
net_sprint_ipv6_addr(&instance->default_route->address.
in6_addr));
net_if_router_rm(instance->default_route);
net_if_ipv6_router_rm(instance->default_route);
instance->default_route = NULL;
}
@ -1706,7 +1706,7 @@ static int net_rpl_set_default_route(struct net_if *iface,
net_sprint_ipv6_addr(&instance->
default_route->address.
in6_addr));
net_if_router_rm(instance->default_route);
net_if_ipv6_router_rm(instance->default_route);
instance->default_route = NULL;
} else {
NET_DBG("Not removing default route because it is "
@ -2361,7 +2361,7 @@ static void net_rpl_move_parent(struct net_if *iface,
NET_DBG("Removing default route %s",
net_sprint_ipv6_addr(addr));
net_if_router_rm(dag_src->instance->default_route);
net_if_ipv6_router_rm(dag_src->instance->default_route);
dag_src->instance->default_route = NULL;
}