Don't pass a src argument to 'ip route del' in case the host's "main IP"
authorMitchell E Berger <mitchb@mit.edu>
Fri, 25 May 2018 07:14:42 +0000 (03:14 -0400)
committerMitchell E Berger <mitchb@mit.edu>
Fri, 25 May 2018 07:14:42 +0000 (03:14 -0400)
has changed and caused the route to be added with a different src than we
expect.

invirt-dhcpserver

index e049f15..1541e27 100755 (executable)
@@ -201,7 +201,7 @@ class DhcpBackend:
                     s.syslog(s.LOG_ERR, "Could not check and/or add DNAT for IP %s to %s: %s" % (n.other_ip, n.ip, e))
             if other_action == 'remove':
                 try:
-                    p = Popen(['ip', 'route', 'del', n.other_ip, 'dev', intf, 'src', main_ip], stdout=PIPE, stderr=PIPE)
+                    p = Popen(['ip', 'route', 'del', n.other_ip, 'dev', intf], stdout=PIPE, stderr=PIPE)
                     (out, err) = p.communicate()
                     sys.stderr.write(err)
                     sys.stderr.write(out)