Change in vdsm[master]: Add IPv6 support to configNetwork
psebek at redhat.com
psebek at redhat.com
Tue Oct 22 11:26:46 UTC 2013
Petr Šebek has posted comments on this change.
Change subject: Add IPv6 support to configNetwork
......................................................................
Patch Set 9:
(3 comments)
....................................................
File vdsm/sourceRoute.py
Line 49: self.rules = None
Line 50:
Line 51: def _generateTableId(self):
Line 52: #TODO: Future proof for IPv6
Line 53: return netaddr.IPAddress(self.ipaddr.split('/')[0]).value
Dan: I used it because ipv6 address is usually in form address[/prefixlen].
Assaf: Ok, I didn't understand that comment so I just tried something. I will think about some solution how to assign 32b number to ipv6 address.
Line 54:
Line 55: def _buildRoutes(self):
Line 56: return [Route(network='0.0.0.0/0', ipaddr=self.gateway,
Line 57: device=self.device, table=self.table),
Line 93: def remove(self):
Line 94: self.configurator.removeSourceRoute(None, None, self.device)
Line 95:
Line 96:
Line 97: class StaticIPv6SourceRoute(StaticSourceRoute):
Dan: Currently there is not working setting gateway to nics. I had to add source route adding for ipv6 to netconf/__init__.py. I thought it will be easier to add new more specific class than add some conditions to original StaticSourceRoute class. Anyway, it still does not set the gateway :(.
Assaf: I will think about it.
Line 98: def __init__(self, device, configurator):
Line 99: super(StaticIPv6SourceRoute, self).__init__(device, configurator)
Line 100:
Line 101: def _buildRoutes(self):
Line 110: return
Line 111:
Line 112: addr = ipaddr.split('/')
Line 113: self.ipaddr = addr[0]
Line 114: self.prefixlen = addr[1] if len(addr) > 1 else '0'
Currently for nothing. I had to split it because netaddr.IPAddress does not accept ipaddr[/prefixlen] but just ipaddr.
Line 115: self.gateway = gateway.split('/')[0]
Line 116: self.table = self._generateTableId()
Line 117: self.network = ipaddr
Line 118:
--
To view, visit http://gerrit.ovirt.org/18284
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8ed056b683f0cb893b2edcf1ae673c64ce5cd18c
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Šebek <psebek at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Kiril Nesenko <knesenko at redhat.com>
Gerrit-Reviewer: Petr Šebek <psebek at redhat.com>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list