From 9d03a6e8fb615e8fbbdb99860d3227b96bb70ffd Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Sun, 3 Nov 2019 08:54:05 +0200 Subject: [PATCH] NSX|V3+P: Prevent IPv6 default router creation as static route Change-Id: Ie452cf316896b27396fae24989b67aa94947336d --- vmware_nsx/plugins/common/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/common/plugin.py b/vmware_nsx/plugins/common/plugin.py index f03d2338a4..83cd85533b 100644 --- a/vmware_nsx/plugins/common/plugin.py +++ b/vmware_nsx/plugins/common/plugin.py @@ -359,7 +359,8 @@ class NsxPluginBase(db_base_plugin_v2.NeutronDbPluginV2, context, router_id, routes) # do not allow adding a default route. NSX-v/v3 don't support it for route in routes: - if route.get('destination', '').startswith('0.0.0.0/'): + if (route.get('destination', '').startswith('0.0.0.0/') or + route.get('destination', '').startswith('::/')): msg = _("Cannot set a default route using static routes") raise n_exc.BadRequest(resource='router', msg=msg)