mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 12:00:11 +01:00
cli: don't accept default route entries, NM handles the default route itself
This commit is contained in:
parent
700f5ec0ef
commit
4e9fc8ad61
1 changed files with 8 additions and 0 deletions
|
|
@ -586,6 +586,14 @@ _parse_and_build_route (int family,
|
|||
}
|
||||
}
|
||||
|
||||
/* We don't accept default routes as NetworkManager handles it itself */
|
||||
if ( (family == AF_INET && out->dst.ip4_dst == 0)
|
||||
|| (family == AF_INET6 && IN6_IS_ADDR_UNSPECIFIED (&out->dst.ip6_dst))) {
|
||||
g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("default route cannot be added (NetworkManager handles it by itself)"));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
success = TRUE;
|
||||
|
||||
finish:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue