This is a POC patch, which must be updated to check if gateway belongs to
subnet , or if it doesn't:
diff --git a/neutron/agent/linux/interface.py b/neutron/agent/linux/interface.py
index 538527b..5a9f186 100644
--- a/neutron/agent/linux/interface.py
+++ b/neutron/agent/linux/interface.py
@@ -116,15 +116,16 @@ class LinuxInterfaceDriver(object): namespace=namespace, ip=ip_cidr)
- if gateway:
- device.route.add_gateway(gateway)
- new_onlink_routes = set(s['cidr'] for s in extra_subnets)
+ if gateway:
+ new_onlink_routes.update([gateway]) existing_onlink_routes = set(device.route.list_onlink_routes())
for route in new_onlink_routes - existing_onlink_routes: device.route.add_onlink_route(route)
for route in existing_onlink_routes - new_onlink_routes: device.route.delete_onlink_route(route)
+ if gateway:
+ device.route.add_gateway(gateway)
def delete_conntrack_state(self, root_helper, namespace, ip):
"""Delete conntrack state associated with an IP address.
This is a POC patch, which must be updated to check if gateway belongs to
subnet , or if it doesn't:
diff --git a/neutron/ agent/linux/ interface. py b/neutron/ agent/linux/ interface. py agent/linux/ interface. py agent/linux/ interface. py river(object) :
namespace= namespace,
ip=ip_ cidr)
index 538527b..5a9f186 100644
--- a/neutron/
+++ b/neutron/
@@ -116,15 +116,16 @@ class LinuxInterfaceD
- if gateway: route.add_ gateway( gateway)
new_onlink_ routes = set(s['cidr'] for s in extra_subnets) routes. update( [gateway] )
existing_ onlink_ routes = set(device. route.list_ onlink_ routes( )) onlink_ routes:
device. route.add_ onlink_ route(route) onlink_ routes - new_onlink_routes:
device. route.delete_ onlink_ route(route) route.add_ gateway( gateway)
- device.
-
+ if gateway:
+ new_onlink_
for route in new_onlink_routes - existing_
for route in existing_
+ if gateway:
+ device.
def delete_ conntrack_ state(self, root_helper, namespace, ip):
"""Delete conntrack state associated with an IP address.