All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Konrad Rzeszutek <konrad@darnok.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>,
	dwm@enoyolf.org, darnok@68k.org, pjones@redhat.com,
	konradr@redhat.com, konradr@linux.vnet.ibm.com,
	randy.dunlap@oracle.com, hpa@zytor.com, lenb@kernel.org,
	mike.anderson@us.ibm.com, dwm@austin.ibm.com,
	arjan@infradead.org, Andy Whitcroft <apw@shadowen.org>,
	James.Bottomley@hansenpartnership.com
Subject: Re: [PATCH] Add iSCSI IBFT support (v0.4.5) - fixes to the header files.
Date: Tue, 29 Jan 2008 13:15:15 -0600	[thread overview]
Message-ID: <479F7B43.6090801@cs.wisc.edu> (raw)
In-Reply-To: <20080128185503.GA3930@andromeda.dapyr.net>

Konrad Rzeszutek wrote:
> +/*
> + * Helper functions to parse data properly.
> + */
> +static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
> +{
> +	if (ip[0] == 0 && ip[1] == 0 && ip[2] == 0 && ip[3] == 0 &&
> +	    ip[4] == 0 && ip[5] == 0 && ip[6] == 0 && ip[7] == 0 &&
> +	    ip[8] == 0 && ip[9] == 0 && ip[10] == 0xff && ip[11] == 0xff) {
> +		/*
> +		 * IPV4
> +		 */
> +		return sprintf(buf, "%d.%d.%d.%d\n", ip[12],
> +			       ip[13], ip[14], ip[15]);
> +	} else
> +		return 0;
> +}

You probably just want to use the NIPQUAD_FMT and NIP6_FMT macros here. 
Also why isn't ipv6 supported?

  reply	other threads:[~2008-01-29 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 18:55 [PATCH] Add iSCSI IBFT support (v0.4.5) - fixes to the header files Konrad Rzeszutek
2008-01-29 19:15 ` Mike Christie [this message]
2008-01-30  0:32   ` Konrad Rzeszutek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=479F7B43.6090801@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=arjan@infradead.org \
    --cc=darnok@68k.org \
    --cc=dwm@austin.ibm.com \
    --cc=dwm@enoyolf.org \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=konrad@darnok.org \
    --cc=konradr@linux.vnet.ibm.com \
    --cc=konradr@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.anderson@us.ibm.com \
    --cc=pjones@redhat.com \
    --cc=randy.dunlap@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.