Dan Kenigsberg has posted comments on this change.

Change subject: Improve the validation of netmask and gateway
......................................................................


Patch Set 4: I would prefer that you didn't submit this

(2 inline comments)

a little question

....................................................
File vdsm/configNetwork.py
Line 713:     if not _validateIpAddress(gateway):
Line 714:         raise ConfigNetworkError(ne.ERR_BAD_ADDR,
Line 715:                                  "Bad gateway: %r" % gateway)
Line 716: 
Line 717:     else:
style: the nice thing about "raise" is that you do not need to care about 
"else". I know that some do not agree with me, but I hate to "waste" 
indentation.
Line 718:         (gw, ip, mask) = [_dottedQuadToNum(addr) for addr
Line 719:                           in (gateway, ipaddr, netmask)]
Line 720:         if ip & mask != gw & mask:
Line 721:             raise ConfigNetworkError(ne.ERR_BAD_ADDR,


Line 716: 
Line 717:     else:
Line 718:         (gw, ip, mask) = [_dottedQuadToNum(addr) for addr
Line 719:                           in (gateway, ipaddr, netmask)]
Line 720:         if ip & mask != gw & mask:
Does IP not allow a gateway which is outside of the relevant netmask? I am 
really not sure. For sure, it is uncommon, but I can think of a twisted network 
where this can be useful.
Line 721:             raise ConfigNetworkError(ne.ERR_BAD_ADDR,
Line 722:                                      "Bad gateway: %r" % gateway)
Line 723: 
Line 724: 


--
To view, visit http://gerrit.ovirt.org/7713
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3c0a39f3f681a9e587f9118246e42a29e18d604b
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to