[stgt] [PATCH 10/15] tgt: os.h: getnameinfo() is different on none-Linux systems

Boaz Harrosh bharrosh at panasas.com
Mon Mar 2 14:59:54 CET 2009

FUJITA Tomonori wrote:
> On Sun,  1 Mar 2009 18:52:26 +0200
> Boaz Harrosh <bharrosh at panasas.com> wrote:
>> +			if (ret) {
>> +				eprintf("getnameinfo Faild=>%d: %s\n",
>> +					ret, gai_strerror(ret));
>> +				/* Let failure show in target traces */
>> +				strcpy(p, "getnameinfo_Faild");
> Hmm, you put "getnameinfo_Faild" in a buffer that will be sent to an
> initiator? If so, it's unacceptable. Just use eprintf.

Otherwise this is very confusing to debug because the initiator gets
half an address, and tries to go on and only fails down the ladder later
which makes it hard to understand what fails. This way It showed in initiator
traces and it is easy to diagnose.

I got this idea from your code, just below you do:
	text_key_add(conn, key, "NotUnderstood");

Should we do something like this? Is there a protocol text_key_add()
we can use to denote proper failure here?

To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list