network: ignore requested ipv6 route when ipv6 is disabled by sysctl
This commit is contained in:
parent
54a1a535bd
commit
c442331750
|
@ -913,8 +913,8 @@ int link_request_set_routes(Link *link) {
|
|||
link_enter_failed(link);
|
||||
return r;
|
||||
}
|
||||
|
||||
link->route_messages++;
|
||||
if (r > 0)
|
||||
link->route_messages++;
|
||||
}
|
||||
|
||||
if (link->route_messages == 0) {
|
||||
|
|
|
@ -121,8 +121,8 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
|||
link_enter_failed(link);
|
||||
return r;
|
||||
}
|
||||
|
||||
link->ndisc_messages++;
|
||||
if (r > 0)
|
||||
link->ndisc_messages++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -259,8 +259,8 @@ static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
|||
link_enter_failed(link);
|
||||
return r;
|
||||
}
|
||||
|
||||
link->ndisc_messages++;
|
||||
if (r > 0)
|
||||
link->ndisc_messages++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -320,8 +320,8 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
|
|||
link_enter_failed(link);
|
||||
return r;
|
||||
}
|
||||
|
||||
link->ndisc_messages++;
|
||||
if (r > 0)
|
||||
link->ndisc_messages++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -500,6 +500,11 @@ int route_configure(
|
|||
assert(IN_SET(route->family, AF_INET, AF_INET6));
|
||||
assert(callback);
|
||||
|
||||
if (route->family == AF_INET6 && manager_sysctl_ipv6_enabled(link->manager) == 0) {
|
||||
log_link_warning(link, "An IPv6 route is requested, but IPv6 is disabled by sysctl, ignoring.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (route_get(link, route->family, &route->dst, route->dst_prefixlen, route->tos, route->priority, route->table, NULL) <= 0 &&
|
||||
set_size(link->routes) >= routes_max())
|
||||
return log_link_error_errno(link, SYNTHETIC_ERRNO(E2BIG),
|
||||
|
@ -688,7 +693,7 @@ int route_configure(
|
|||
sd_event_source_unref(route->expire);
|
||||
route->expire = TAKE_PTR(expire);
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int network_add_ipv4ll_route(Network *network) {
|
||||
|
|
Loading…
Reference in New Issue