]> git.proxmox.com Git - pve-container.git/commit - src/PVE/LXC.pm
LXC: more compact network configuration
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 1 Jul 2015 10:58:17 +0000 (12:58 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 2 Jul 2015 05:43:53 +0000 (07:43 +0200)
commit84e0c123c56e58b7cff1715071fc0058d6f36056
tree741525196bcb10fbf6e25f2802adaa29616cb65b
parent662f90a09d98f99a8103aae9852a8ee63e4aa548
LXC: more compact network configuration

Deduplicated network setup code.
Using 'ip route replace' to replace or add the route.
This strategy can be rolled back safely:
1) add new ip (no harm done, old ip still exists)
2) replace route
  on error:
    Delete the new ip, old one is still in place.
    If deleting the new ip fails, it was already modified
    from within the container, so we only warn about it.
  on success do (3):
3) delete old ip
  New IP + gateway are in place, old IP can be deleted.
  If deletion fails, we only warn like in the error case.
src/PVE/LXC.pm