Re: [RFC-v4 11/12] iscsi-target: Add misc utility and debug logic

From: Mike Christie
Date: Tue Mar 22 2011 - 01:04:21 EST


On 03/21/2011 11:04 PM, Mike Christie wrote:
+
+void iscsit_ntoa2(unsigned char *buf, u32 ip)
+{
+ memset(buf, 0, 18);
+ sprintf(buf, "%u.%u.%u.%u", ((ip>> 24)& 0xff), ((ip>> 16)& 0xff),
+ ((ip>> 8)& 0xff), (ip& 0xff));
+}

I think we have a function like this already.


If not, I think this should be:

sprintf(buf, "%pI4",

What s up with ipv6 btw? That uses %pI6.



+ if (tpg_np->tpg_np->np_sockaddr.ss_family == AF_INET6) {
+ ip =&tpg_np->tpg_np->np_ipv6[0];


Is ip supposed to be a string with the ip address in it? If so is that
right? Is np_ipv6 a string with the ip address in human readable format,
but below np_ipv4 is the integer representation then you convert it.

Ignore those, I see in the other patches it is different. Why is that?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/