NSX|V3+P: Prevent IPv6 default router creation as static route

Change-Id: Ie452cf316896b27396fae24989b67aa94947336d
This commit is contained in:
Adit Sarfaty 2019-11-03 08:54:05 +02:00
parent 3d057c1a47
commit 9d03a6e8fb

View File

@ -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)