[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH rhel5] Fix parsing of optional portnr in iscsi target IP (#525054)


Thanks for the review.

On 11/24/2009 09:55 AM, Ales Kozumplik wrote:
Hi Hans,

On 11/24/2009 09:29 AM, Hans de Goede wrote:

err = None
- idx = target.rfind(":")
+ count = len(target.split(":"))
+ idx = target.rfind("]:")
+ # Check for IPV6 [IPV6-ip]:port
if idx != -1:
+ ip = target[1:idx]
+ port = target[idx+2:]
+ # Check for IPV4 aaa.bbb.ccc.ddd:port
+ elif count == 2:
+ idx = target.rfind(":")
ip = target[:idx]
- port = target[idx:]
+ port = target[idx+1:]
ip = target
port = "3260"

Just a couple of questions:
1) suppose target is "[a::x]" or something similar, that is an IPv6 with
no port number --- then I think the code will assign
ip = [a::x]
port = 3260
but if the target is "[a::x]:p" then the code will assign
ip = a::x
port = p
ie: there's no brackets around the address. Just a slight inconsistency,
but maybe it doesn't matter?

This is deliberate, I don't think the parts of anaconda getting passed in
the address will like it if there are brackets around it.

2) maybe you want to use count = target.count(":") and then compare
count against one?

That would have worked too, yes, but I'm not going to change this as
I would like to keep the code indentical between 5.5 and 6 / master.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]