Change in vdsm[master]: Add IPv6 support to configNetwork

amuller at redhat.com amuller at redhat.com
Mon Oct 21 17:19:14 UTC 2013


Assaf Muller has posted comments on this change.

Change subject: Add IPv6 support to configNetwork
......................................................................


Patch Set 9: Verified-1 Code-Review-1

(2 comments)

New generateTableId won't work for IPv6 addresses whose value representation is over (2 ** 32) - 1.

....................................................
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
netaddr.IPAddress supports both IPv4 and IPv6. self.ipaddr should be the ip address both for IPv4 and IPv6 without the netmask so I am unclear why the split is needed.

For IPv6 this won't work as the value can be a number requiring more than 32 bits and the table ID must be represented by 32 bits or less. (This is the reason for the TODO comment) - We need a clever-er solution than just getting the value :)
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):
Seems like there's a decent amount of code duplication, is there a way to share more code with the base class?
Line 98:     def __init__(self, device, configurator):
Line 99:         super(StaticIPv6SourceRoute, self).__init__(device, configurator)
Line 100: 
Line 101:     def _buildRoutes(self):


-- 
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-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list