summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-06-10 18:13:14 +0200
committerJiří Klimeš <jklimes@redhat.com>2014-06-11 09:58:44 +0200
commit4e9fc8ad611dabf93e9b698a0ce3466bc5e27bb4 (patch)
tree314e9df8300d275314e856d1178a37da425a0f3d
parent700f5ec0ef584b17b44cc0e1968712d97ba95263 (diff)
downloadNetworkManager-4e9fc8ad611dabf93e9b698a0ce3466bc5e27bb4.tar.gz
cli: don't accept default route entries, NM handles the default route itself
-rw-r--r--cli/src/common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/src/common.c b/cli/src/common.c
index 9635011cd7..272f4961b3 100644
--- a/cli/src/common.c
+++ b/cli/src/common.c
@@ -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: